Loading ...
Sorry, an error occurred while loading the content.
 

Re: [tracker2] Re: How can I test the current speed in a script?

Expand Messages
  • James Ewen
    ... Yeah, you really need to understand what is happening, and where it is happening. I could see getting tripped up on that aspect. Just think of scripting as
    Message 1 of 8 , Apr 2, 2013
      On Tue, Apr 2, 2013 at 11:34 AM, francois.rogez <ffdef@...> wrote:

      > Thanks James, I updated my script based on your explanation.
      > My initial script was not working, because I had assumed that the profiles
      > defined in OTWINCFG were static, and just used to set the active parameters.
      > Instead, as you described, the profiles are directly modified avery time a
      > script modifies a parameter, therefore I needed to re-set the parameters to
      > their original value.

      Yeah, you really need to understand what is happening, and where it is
      happening. I could see getting tripped up on that aspect. Just think
      of scripting as you sending commands to the unit. I still have to sit
      and ponder on changing parameters in the other profile and such...
      scripting is pretty darned powerful. I like it when people dream up
      weird things to do, and ask how to do it. It's a challenge to see if
      you can figure out how to complete the task with the tools available.

      > The parameters I want to change are POWER, INTERVAL, and COMMENT.
      > The attached script has been working well for the last 2 weeks

      The script looks okay...

      > If Profile 1
      > Do Once
      > Exec "POWER ON"
      > Exec "INTERVAL 60"
      > Exec "COMMENT S"
      > Set Counter 1 = 0
      > Exec "BEACON"
      > End Block

      So when profile 1 tests are true, and the unit is in profile 1, you
      fire up whatever is hooked up to the power output, send an immediate
      position report followed by one every minute with a comment of S until
      5 minutes elapses.

      > On Second
      > Increment Counter 1
      > If Counter 1 = 300
      > Exec "COMMENT P"
      > Exec "POWER 3"
      > Exec "INTERVAL 900"
      > End Block
      > End Block
      > End Block

      So once 5 minutes elapses, the interval gets changed to 15 minutes,
      and the power to the external device gets turned off until 15 minutes
      has elapsed, where upon power gets turned on for 3 seconds before a
      transmission occurs (with a comment of P), then power gets shut off.
      The timer runs continuously, so the counter 1 = 300 becomes true about
      every 18.2 hours. (I beleive the max counter value is 65535, and it
      rolls over back to 0) Putting the contents of the IF statement within
      a DO ONCE block would make it only happen once. This is minor, but
      there are a maximum number of write cycles available. Rewriting once
      every 18 hours is going to take a long time to wear out the device,
      but the DO ONCE will make it only happen once per switch to profile 1.

      > If Profile 2
      > Do Once
      > Exec "COMMENT M"
      > Exec "BEACON"
      > End Block
      > End Block

      You shouldn't have to do this at all if the comment is set to M, and
      you select "Transmit when switching to this profile" on the profile
      switching page. All parameters in profile 2 are not affected by what
      you do while in profile 1.

      --
      James
      VE6SRV
    Your message has been successfully submitted and would be delivered to recipients shortly.