Results 11 to 20 of 69
-
05-19-2011, 02:31 PM #11
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Jack,
I understand. Leave it as it is.
Regards,
Nico
-
05-19-2011, 03:15 PM #12
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Jack,
I have tested the Pulses Subrutine with a led. Works like a charm
Nico
-
05-19-2011, 03:37 PM #13
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Nico,
Thanks so much for testing with an LED BTW.
I have good news! Whilst there are some problems, the HSI display works most of the time, accurately representing the distance (eg 1.6 nm appears as "16", but it's actually 1.6 because of the DP).
The problem was, that when the HSI counted to 16, I flew towards the VOR station. The value counted down, as it should, but stopped at 0.4. Then, when I flew over the VOR station, and the distance started to increase again, the HSI value remained stuck at 0.4nm.
One thing, I had to change the script slightly. The "UP" and "DOWN" Pins I mentioned are infact the same pin. +5V to the pin (ON) means that it counts up, whilst 0V (OFF) to the pin makes the display count down.
This is the script; identical, just for that minor change:
Code:Var 0 Value 0 { &Out = 0 &CurrentD = 0 &Control = 0 &Control = TIMER 1 0 100 // control is called each second } Var 100 name Control Link SUBRUTINE { L0 = &NewDistance - &CurrentD 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 10 name Pulses link SUBRUTINE // parameter is number of pulses ... { &Out = 1 &PulseDown = DELAY &Pulses 5 // 50 msec for a half pulse } Var 11 name PulseDown { L0 = &PulseDown IF L0 > 0 { &Out = 0 &Finish = DELAY &PulseDown 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 { &PulseDown = 0 // make responsive for another series of pulses. &Finish = 0 // make responsive for another series of pulses. } } }
One thing; when using the script, SIOC seems to activate output 28 (unrelated) when it is counting up. There is a RESET pin on the pulse meter, which, if tampered with, can seriously affect the pulse. Is it possible SIOC is accidently activating this output, just like 28?
Kindest regards,
Jack
-
05-19-2011, 05:01 PM #14
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Jack,
We're making progress!
I see you have removed the IF L0 <> 0 test in Var 100.... that's not right, now if L0 = 0 you try to count down...
And no, it's not very likely that the SIOC script changes Output 28. That output is not mentioned at all, is it? Are you sure you have no short-circuits in your hardware?
regards,
Nico
-
05-19-2011, 05:22 PM #15
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Nico,
I have changed the script back to the <>; so now it's the same just with that one alteration.
This is what I did this time:
- Started a flight
- Started SIOC
- VOR1 DME = Out of range
- I then tune 116:00, VOR1 DME = 1.6nm away
- The range counter went to 1.4
- I changed back to the "0" range frequency, it went down to 2 (or something like that; not 0)
Weirdly, this is what the IOCPConsole log states:
Code:5=0 - New Distance 5 = 16 New Distance 5 = 15 New Distance 5 = 14 New Distance
As you can see, even though "New Distance" changes; no other var at all changes.
Regards,
Jack
-
05-19-2011, 06:01 PM #16
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Nico,
To add to my last post, here is the full IOCPConsole Log:
Code:5=9 - NewDistance 2=1 - UPDOWN_Pin 1=9 - CurrentD 10=9 - Pulses 11=9 - PulseDown 4=0 - Out 12=9 - Finish 10=8 - Pulses 4=1 - Out 11=8 - PulseDown 4=0 - Out 12=8 - Finish 10=7 - Pulses 4=1 - Out 11=7 - PulseDown 4=0 - Out 12=7 - Finish 10=6 - Pulses 4=1 - Out 11=6 - PulseDown 4=0 - Out 12=6 - Finish 10=5 - Pulses 4=1 - Out 11=5 - PulseDown 4=0 - Out 12=5 - Finish 10=4 - Pulses 4=1 - Out 11=4 - PulseDown 4=0 - Out 12=4 - Finish 10=3 - Pulses 4=1 - Out 11=3 - PulseDown 4=0 - Out 12=3 - Finish 10=2 - Pulses 4=1 - Out 11=2 - PulseDown 4=0 - Out 12=2 - Finish 10=1 - Pulses 4=1 - Out 11=1 - PulseDown 4=0 - Out 12=1 - Finish 11=0 - PulseDown 12=0 - Finish 2=0 - UPDOWN_Pin 10=0 - Pulses 4=1 - Out 5=8 - NewDistance 2=1 - UPDOWN_Pin 1=8 - CurrentD 10=-1 - Pulses 11=-1 - PulseDown 2=0 - UPDOWN_Pin 10=0 - Pulses 11=0 - PulseDown 5=7 - NewDistance 2=1 - UPDOWN_Pin 1=7 - CurrentD 10=-1 - Pulses 11=-1 - PulseDown 2=0 - UPDOWN_Pin 10=0 - Pulses 11=0 - PulseDown 5=6 - NewDistance 2=1 - UPDOWN_Pin 1=6 - CurrentD 10=-1 - Pulses 11=-1 - PulseDown 2=0 - UPDOWN_Pin 10=0 - Pulses 11=0 - PulseDown 5=0 - NewDistance 2=1 - UPDOWN_Pin 1=0 - CurrentD 10=-6 - Pulses 11=-6 - PulseDown 2=0 - UPDOWN_Pin 10=0 - Pulses 11=0 - PulseDown 5=6 - NewDistance 2=1 - UPDOWN_Pin 1=6 - CurrentD 10=6 - Pulses 11=6 - PulseDown 4=0 - Out 12=6 - Finish 10=5 - Pulses 4=1 - Out 11=5 - PulseDown 4=0 - Out 12=5 - Finish 10=4 - Pulses 4=1 - Out 11=4 - PulseDown 4=0 - Out 12=4 - Finish 10=3 - Pulses 4=1 - Out 11=3 - PulseDown 4=0 - Out 12=3 - Finish 10=2 - Pulses 4=1 - Out 11=2 - PulseDown 4=0 - Out 12=2 - Finish 10=1 - Pulses 4=1 - Out 11=1 - PulseDown 4=0 - Out 12=1 - Finish 11=0 - PulseDown 12=0 - Finish 2=0 - UPDOWN_Pin 10=0 - Pulses 4=1 - Out 5=5 - NewDistance 5=6 - NewDistance 5=7 - NewDistance 5=8 - NewDistance
kindest regards,
Jack
-
05-20-2011, 02:52 AM #17
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Jack,
I have no experience with IOCPConsole, never work with it.
I recommend to build it up from the ground up with small steps.
We know that the Pulses SUBRUTINE is ok.
So first make a script that sends say 5 pulses to your HSI and count UP, then do the same counting down. Check the correct working of that first.
If that's OK, do some tests with the NewDistance variable.
If that's ok bring in the control routine without the test about sending more then 9 pulses.
If that's ok maximise the number of pulses sent in a control cycle.
and so on...
Such an approach gives a lot more insight then "staring at a IOCPlog file...."
regards,
Nico
-
05-20-2011, 08:12 PM #18
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Nico,
I'm so sorry; I couldn't quite understand that.
Do you mean a script with JUST the pulse subroutine on its own? Maybe linked to a pushbutton or something? Because that subroutine on its own doesn't do anything unless it's used with the other variables in the script.
Kindest regards,
Jack
-
05-21-2011, 01:52 AM #19
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
-
05-21-2011, 05:21 AM #20
Re: HSI Pulse Range Counter Display - How to manipulate in SIOC?
Hi Nico,
How is this:
Code:Var 2 name Trigger Link IOCARD_IN Input 25 { IF &Trigger = 1 { CALL &Pulses } } Var 1 name Pulses link SUBROUTINE // parameter is number of pulses ... { &Out = 1 &PulseDown = DELAY &Pulses 5 // 50 msec for a half pulse } Var 3 name Out Link IOCARD_OUT Output 29 // Pulse Pin Var 11 name PulseDown { L0 = &PulseDown IF L0 > 0 { &Out = 0 &Finish = DELAY &PulseDown 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 { &PulseDown = 0 // make responsive for another series of pulses. &Finish = 0 // make responsive for another series of pulses. } } }
Regards,
Jack
Pretty Womans in your city
Find Sexy Womans from your city...