Page 5 of 7 FirstFirst 1234567 LastLast
Results 41 to 50 of 69
  1. #41
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Jack,
    I have modified Var 0 start up a little to be sure that the two pulses in Var0 have been processed before we start de Control loop...

    Code:
    Var 0 Value 0
    {
      &Out = 1
      &CurrentD = 0   
      &UPDOWN_Pin = 1     // count up
      CALL &Pulses 2    // correct for two OFF/ON pulse at startup
      &StartControl = DELAY 1 100 // wait a second to let two pulses above happen first
    }
    
    Var 9999 name StartControl
    {
      &Control = 0
      &Control = TIMER 1 0 100   // control is called each second
    }
    
    Var 100 name Control Link SUBRUTINE
    {
      L0 = &NewDistance - &CurrentD                                                                                                                                                                                              
      IF L0 <> 0
      {
        IF L0 > 0 
        {  
          &UPDOWN_Pin = 1  // Ensure HSI counts UP                                                                                          
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
            &CurrentD = &CurrentD  + 9
          } 
          ELSE
          {
            &CurrentD = &NewDistance
          }  
        }
        ELSE
        {                                                                                          
          &UPDOWN_Pin = 0    // We don't want to count up here!
          L0 = L0 * -1
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
            &CurrentD = &CurrentD  - 9
          } 
          ELSE
          {
            &CurrentD = &NewDistance
          }  
        }
        CALL &Pulses L0                           
      }                                                                                                                     
    }
    
    Var 1, name CurrentD
    
    Var 2, name UPDOWN_Pin, Link IOCARD_OUT, Output 21 // Count UP or DOWN selector Pin
    
    Var 4, name Out, Link IOCARD_OUT, Output 29 // Pulse Pin
    
    Var 5, name NewDistance, Link FSUIPC_IN, Offset $0300, Length 2  // FSUIPC VOR1 DME Input Source
    
    Var 43 name Pulses link SUBRUTINE    // parameter is number of pulses ...
    {
      &Out = 0
      &PulseUp = DELAY &Pulses 9  // 50 msec for a half pulse
    }
    
    Var 11 name PulseUp
    {
      L0 = &PulseUp
      IF L0 > 0 
      {
        &Out = 1
        &Finish = DELAY L0 9  // 50 msec for the other half of the pulse
     }
    }
    
    Var 12 name Finish
    {
      L0 = &Finish
      IF L0 > 0
      {
        IF L0 > 1
        {
          L0 = L0 - 1
          CALL &Pulses L0   // recursive subroutine call
        }
        ELSE
        {
          &PulseUp = 0   // make responsive for another series of pulses.
          &Finish = 0      // make responsive for another series of pulses.
        }
      }
    }
    
    Var 84, name RangeFlag, Link IOCARD_OUT, Output 17 // Range Flag
    Nico

  2. #42
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Nico,

    A bit of good news, but we're still not quite there.

    Firstly, I can confirm that still only 1 pulse is needed at startup instead of 2 (but I still need 2 if I'm doing the "switch test" script).

    Anyway, I tuned a VOR station 1.6nm (16 pulses) away. The HSI went to 1.4, again, not bad, very close. I then tuned back to a "dead" frequency (which means "0" on the NewDistance variable) and it went perfectly back to 0.

    So in other words, the HSI did not count up 16, but it did not count 16 down either (14 up and 14 down).

    Then, I approached the VOR slowly. It was always off by 0.2, but it went down in perfect increments, so clearly the script is working somewhat correctly.

    I then tuned a station 51.7 nm away. The HSI only went to 15, not 15.7 (157) pulses. I think this is a script fault, not hardware, as IOCPConsole reported only a few pulses sent; definitely not 517.

    This was the script, same as yours, just CALL &Pulses 1, not 2:

    Code:
    Var 0 Value 0
    {
      &Out = 1
      &CurrentD = 0   
      &UPDOWN_Pin = 1     // count up
      CALL &Pulses 1    // correct for two OFF/ON pulse at startup
      &StartControl = DELAY 1 100 // wait a second to let two pulses above happen first
    }
    
    Var 9999 name StartControl
    {
      &Control = 0
      &Control = TIMER 1 0 100   // control is called each second
    }
    
    Var 100 name Control Link SUBRUTINE
    {
      L0 = &NewDistance - &CurrentD                                                                                                                                                                                              
      IF L0 <> 0
      {
        IF L0 > 0 
        {  
          &UPDOWN_Pin = 1  // Ensure HSI counts UP                                                                                          
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
            &CurrentD = &CurrentD  + 9
          } 
          ELSE
          {
            &CurrentD = &NewDistance
          }  
        }
        ELSE
        {                                                                                          
          &UPDOWN_Pin = 0    // We don't want to count up here!
          L0 = L0 * -1
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
            &CurrentD = &CurrentD  - 9
          } 
          ELSE
          {
            &CurrentD = &NewDistance
          }  
        }
        CALL &Pulses L0                           
      }                                                                                                                     
    }
    
    Var 1, name CurrentD
    
    Var 2, name UPDOWN_Pin, Link IOCARD_OUT, Output 21 // Count UP or DOWN selector Pin
    
    Var 4, name Out, Link IOCARD_OUT, Output 29 // Pulse Pin
    
    Var 5, name NewDistance, Link FSUIPC_IN, Offset $0300, Length 2  // FSUIPC VOR1 DME Input Source
    
    Var 43 name Pulses link SUBRUTINE    // parameter is number of pulses ...
    {
      &Out = 0
      &PulseUp = DELAY &Pulses 9  // 50 msec for a half pulse
    }
    
    Var 11 name PulseUp
    {
      L0 = &PulseUp
      IF L0 > 0 
      {
        &Out = 1
        &Finish = DELAY L0 9  // 50 msec for the other half of the pulse
     }
    }
    
    Var 12 name Finish
    {
      L0 = &Finish
      IF L0 > 0
      {
        IF L0 > 1
        {
          L0 = L0 - 1
          CALL &Pulses L0   // recursive subroutine call
        }
        ELSE
        {
          &PulseUp = 0   // make responsive for another series of pulses.
          &Finish = 0      // make responsive for another series of pulses.
        }
      }
    }
    
    Var 84, name RangeFlag, Link IOCARD_OUT, Output 17 // Range Flag
    I also remember at the start of this thread our original script used a variable called "NoPulses". We seem to have substitued this for L0.

    Also, on another note, at the end of my test, the NewDistance variable changed value 5 times but not a single pulse was sent. Weird!

    Regards,

    Jack

  3. #43
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Jack,

    I have simplified the Control routine a bit. Don't think it will make a difference but it is less code.

    However, I also changed the PulseUp and PulseDown delays to 5 (instead of 9) equals 50 msec for half a pulse.

    Originally I used 5, don't know why you have changed that to 9???

    9 pulses of 90+90 = 9 x 180 msec is more then a second delay so that will not work... These max. 9 pulses per control cycle must fit within 1 second because then the next call to the control routine starts... (do you understand?)

    Here the improved script:

    Code:
    Var 0 Value 0
    {
      &Out = 1
      &CurrentD = 0   
      &UPDOWN_Pin = 1     // count up
      CALL &Pulses 1    // correct for two OFF/ON pulse at startup
      &StartControl = DELAY 1 100 // wait a second to let two pulses above happen first
    }
    
    Var 9999 name StartControl
    {
      &Control = 0
      &Control = TIMER 1 0 100   // control is called each second
    }
    
    Var 100 name Control Link SUBRUTINE
    {
      L0 = &NewDistance - &CurrentD                                                                                                                                                                                              
      IF L0 <> 0
      {
        IF L0 > 0 
        {  
          &UPDOWN_Pin = 1  // HSI counts UP                                                                                          
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
          }
          &CurrentD = &CurrentD  + L0
        }
        ELSE
        {                                                                                          
          &UPDOWN_Pin = 0  // HSI counts Down
          L0 = L0 * -1
          IF L0 > 9
          {
            L0 = 9  // no more then 9 pulses per second
          }
          &CurrentD = &CurrentD  - L0
        }
        CALL &Pulses L0                           
      }                                                                                                                     
    }
    
    Var 1, name CurrentD
    
    Var 2, name UPDOWN_Pin, Link IOCARD_OUT, Output 21 // Count UP or DOWN selector Pin
    
    Var 4, name Out, Link IOCARD_OUT, Output 29 // Pulse Pin
    
    Var 5, name NewDistance, Link FSUIPC_IN, Offset $0300, Length 2  // FSUIPC VOR1 DME Input Source
    
    Var 43 name Pulses link SUBRUTINE    // parameter is number of pulses ...
    {
      &Out = 0
      &PulseUp = DELAY &Pulses 5  // 50 msec for a half pulse
    }
    
    Var 11 name PulseUp
    {
      L0 = &PulseUp
      IF L0 > 0 
      {
        &Out = 1
        &Finish = DELAY L0 5  // 50 msec for the other half of the pulse
     }
    }
    
    Var 12 name Finish
    {
      L0 = &Finish
      IF L0 > 0
      {
        IF L0 > 1
        {
          L0 = L0 - 1
          CALL &Pulses L0   // recursive subroutine call
        }
        ELSE
        {
          &PulseUp = 0   // make responsive for another series of pulses.
          &Finish = 0      // make responsive for another series of pulses.
        }
      }
    }
    
    Var 84, name RangeFlag, Link IOCARD_OUT, Output 17 // Range Flag
    regards,
    Nico

  4. #44
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Nico,

    More good news.

    Firstly, the HSI counts perfect to 0000 each time at startup.

    Secondly, the HSI counted perfectly 16 pulses, and then 16 back again when I reset the distance to 0.

    One thing that is weird; the HSI actually counts DOWN 16 pulses from 0 (to 9984), and then down another 16 when I reset to 0. Resetting the display fixes this issue, but it is strange, especially because UPDOWN_Pin = 1 in the script.

    Also, I tuned the station 51.7nm away. Unfortunately, it only got to 54 (5.4 nm) before stopping. I also noticed that it counted up in perfect blocks of 9 as you said, and 54 is 9 X 6 (so maybe 6 is a "limit" or something? I don't know, guessing here).

    This is real progress though!

    Regards,

    Jack

  5. #45
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Jack,
    What happens if you fly over that VOR at 1.6 nm?
    Nico
    Last edited by kiek; 05-26-2011 at 04:29 PM.

  6. #46
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Nico,

    Sorry for my late reply.

    I just conducted the following test...

    - Tuned VOR 1.6 nm away.

    - Went 1.7nm away

    - Went 1.6, 1.5, 1.4, 1.3...

    - Down to 0.5, then I went back to 0.7nm

    - Then, from 0.7nm, 0.5, 0.4, 0.3...

    - Down to 0. Then, I went back up to 0.7

    - I then dis-tuned the VOR. (aka "0")

    UP TO THIS POINT, the HSI performed absolutely brilliantly; not a single error. Then...

    - Retuned VOR, which was 1.2nm away.

    - HSI went to 0.6

    - NewDistance increased as aI flew away. 1.3, 1.4, 1.5, 1.6, 1.7...

    - The HSI stayed locked on 0.6

    After studying IOCPConsole it is clear two things:

    - Firstly, the HSI did not count back up correctly from 0 to 1.2

    - Secondly, The NewDistance Var changed 5 times and the HSI did not receive a single pulse.

    I hope these results help, but it was awesome up to 1.7 -> 0 -> 0.7 -> 0, not a single error!

    Regards,

    Jack

  7. #47
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Jack,
    I really have no idea at the moment. Try some more tests and try to detect a common pattern.
    It looks as if the Control routine stopped...
    Are you sure SIOC is still running at the end of your test (check the SIOC main window)?

    regards,
    Nico
    Last edited by kiek; 05-27-2011 at 04:54 PM.

  8. #48
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    HI Nico,

    I can confirm that SIOC is still running.

    How is it even possible for the Timer to stop? I mean, surely, if it is aleady running, then SIOC must purposely give a command to stop it. If so, why?

    Regards,

    Jack

  9. #49
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Jack,
    Quote Originally Posted by Boeing 747 Flyer View Post
    How is it even possible for the Timer to stop?
    If you look at the script that is very unlikely if not impossible (it is an endless timer), but it could have stopped due to a bug in the SIOC implementation...
    But you confirm SIOC is still running...
    That is very strange however, because then the script should sent pulses ... Are you sure the script is dead (not sending any more pulses) and not your HSI?

    Regards,
    Nico

  10. #50
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?

    Hi Nico,

    I can confirm that IOCPConsole shows no pulses being sent.

    IOCPConsole reports on everything SIOC does, and thus tells me exactly when it is sending the pulses. There is absolutely no reaction when the NewDistance variable changes in SIOC.

    If it was a HSI fault, IOCPConsole would show pulses being sent, but the HSI display would remain dead.

    Jack

Page 5 of 7 FirstFirst 1234567 LastLast