Page 1 of 1

Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Posted: Fri Jul 31, 2020 3:44 pm
by krzynior
Hello
I built a Flaps indicator on LED's with USBOutput Card from Opencockpits in my simulator.
How to modify script OCP4NGX_v5.5 to use LED for the Flaps Indicator PMDG737NGXu P3Dv5 ?
...
Var ????, name ??????????, static, Link IOCARD_OUT, Device 6, Output 1 // Flaps indicator: Flaps 1 LED number 1 is on
Var ????, name ??????????, static, Link IOCARD_OUT, Device 6, Output 1+2 // Flaps indicator: Flaps 2 LED number 1 and 2 is on
Var ????, name ??????????, static, Link IOCARD_OUT, Device 6, Output 1+2+3 // Flaps indicator: Flaps 5 LED number 1 and 2 and 3 is on
and so on until flaps full ...

Thank you very much for help.
Krzysztof

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Posted: Sun Aug 02, 2020 8:21 pm
by mvr1918
You choose Var number and name yourself, just make sure they are not in use already.

add to script and

then you need to set this var to 1 from within the flaps routine that indicates Flaps 1 is set

and then to 0 from same code part

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Posted: Mon Aug 03, 2020 12:30 pm
by krzynior
Thank You Roar for answer.
Please write an example of this script for one flap position, for better understanding
because I don't know how to set this variable to 1 from within the flap routine that Flaps Indicator shows 1 (2,5-full),
and then to 0 from the same part.
I'm sorry for the trouble, programming is just my hobby for amateur flight simulations.
Best Regards.
Krzysztof

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Posted: Tue Sep 15, 2020 3:33 pm
by krzynior
After many attempts, the script modification looks like this:
And it works :D
(in the place of the dots ... , write as many lines as you have LEDs)
Greetings from Poland
Krzysztof


Var 0717, name flaps_1, static, Link IOCARD_OUT, Device 6, Output 1
Var 0718, name flaps_2, static, Link IOCARD_OUT, Device 6, Output 2
...
Var 0757, name flaps_40, static, Link IOCARD_OUT, Device 6, Output 40
Var 1328, name flaps, static, Value 0
{
L0 = &flaps
&flaps_1 = 0 // LEDs off
&flaps_2 = 0
...
&flaps_40 = 0
IF L0 > 0
{
&flaps_1 = 1 // LED 1 on
}
IF L0 >= 1000
{
&flaps_2 = 1 // LED 2 on
{
...
IF L0 >= 4000
{
&flaps_40 = 1 // LED 40 on
}

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Posted: Mon Sep 21, 2020 9:30 am
by mvr1918
Thanks for your input.