Flaps Indicator on LED's P3Dv5 PMDG737NGXu

The forum for all issues related to the new OC4BAv5 and the new OCP4NGXu driver for PMDG B737NGXu.
Post Reply
User avatar
krzynior
Posts: 3
Joined: Fri Jul 31, 2020 8:34 am

Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Post 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
P3Dv5
PMDG 737NGXu
Home Cockpit of own construction
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Post 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
User avatar
krzynior
Posts: 3
Joined: Fri Jul 31, 2020 8:34 am

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Post 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
P3Dv5
PMDG 737NGXu
Home Cockpit of own construction
User avatar
krzynior
Posts: 3
Joined: Fri Jul 31, 2020 8:34 am

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Post 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
}
P3Dv5
PMDG 737NGXu
Home Cockpit of own construction
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: Flaps Indicator on LED's P3Dv5 PMDG737NGXu

Post by mvr1918 »

Thanks for your input.
Post Reply