MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
calibra2001
Posts: 11
Hi,
I've just started to use mobiflight from Link2FS as I require more outputs than Link2 can manage.
I have a rotary encoder connected to a leo bodnar board and LED's for GRD, CONT & FLT (OFF doesn't have LED for obvious reasons). Using a rotary encoder allows for it to automatically switch from GRD to OFF when engine starts.
i had the offset set to 64FC
64FC ENG_StartSelector[2]
0: GRD
1: OFF
2: CONT
3: FLT

I tried size in Bytes 1, then 3 dots button (deselect all except 0 to try to light led when in GRD position)
I tried size in Bytes 1, then 3 dots button (deselect all except 2 to try to light led when in CONT position)
I tried size in Bytes 1, then 3 dots button (deselect all except 3 to try to light led when in FLT position)
But unfortunately the desired Effect doesn't seem to work GRD stays on when CONT is selected instead of the one LED I require.
Could someone please direct me in the correct direction?

Many Thanks
Phil
2019-05-25 19:12
Avatar
StephanHo
From: EDDG, Germany
Posts: 1447
Supporter
Hi Phil,

welcome to MobiFlight!

I think, you do not know the difference between an offset and an eventID? An Offset is an OUTPUT from the simulator and an EventID is an INPUT to he sim.

So your rotary switch produces inputs whereupon the sim has to react. If you turn the rotary you have to use for every position an EventID to transmit from MobiFlight to the sim.

In your case you need two EventIDs for two engine start selectors.

Please try out for the left engine the EventID 60751 with the paramters 0=GRD, 1=OFF, 2=CONT and 3=FLT - always the same EventID
For the right engine use the EventID 69753 with the same parameters

If you do not have the list with the EventIDs you can download it here:
https://myhomecockpit.de/PMDG_737NGX_EVENT_IDs_SP1d.pdf

Normally the PMDG does not have LEDs to lit depending on the switch position. This is your own construction.
Here comes the offset into play.

For explanation: if you set in the offser list ENG_Start_Selector[2] that is what is meant that the exist two ones. The length of the offset is always 1 Byte. First is 0x64FC (left engine) and the second is 0x64FD.
Now you need three configs, one for every parameter to drive your LEDs (if offset is 0, 2 or 3 - 1 os OFF). Here you read out the offset and set a precondition with the corresponding parameter.

I thinks you are now on the right horse ;)
Grüße,
Stephan
2019-05-26 01:24
Avatar
calibra2001
Posts: 11
Hi Stephan
Many thanks for your reply.

I am fully aware of the difference between an offset and eventID.
At the moment I'm only using offset as I don't need to use any eventID. (this is already configured in LINDA through leobodnar board)

I was testing using the overhead on screen, It looks like i have everything setup correctly, just need to master the precondition.
I already have it programmed and working correctly using link2 and my arduino programming.

So I know its possible.
case 'a':
LENG = ""; LENG += getChar();
if (LENG == "0") {
digitalWrite(LGND, HIGH);
digitalWrite(LCONT, LOW);
digitalWrite(LFLT, LOW);
}
else if (LENG == "1") {
digitalWrite(LGND, LOW);
digitalWrite(LCONT, LOW);
digitalWrite(LFLT, LOW);
}
else if (LENG == "2") {
digitalWrite(LGND, LOW);
digitalWrite(LCONT, HIGH);
digitalWrite(LFLT, LOW);
}
else if (LENG == "3") {
digitalWrite(LGND, LOW);
digitalWrite(LCONT, LOW);
digitalWrite(LFLT, HIGH);
}

I'll try again later today.

Many thanks
Phil
2019-05-26 07:21
Avatar
calibra2001
Posts: 11
Hi
Unfortunately I don't seem to be able to make the GRD LED light up when the parameter = 0
I have tried using transform with no success.
:confused:

Many Thanks
Phil
2019-05-26 12:47
Avatar
calibra2001
Posts: 11
Ok. I managed to fix my problem using the compare tab.
If current value <1 set to 1 else 0 :thumbup:

Many Thanks

Phil
2019-05-26 15:58
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3096
Supporter
Hiho.

You just mix up "Bitwise Output" and "INT Output"

iconQuote:

64FC 2 BYTE x 2 ENG_StartSelector[2]
0: GRD
1: OFF
2: CONT
3: FLT



This NOT means Bit 0 is GRD .... Bit 1 = OFF and so on.
This means the Value (INT, Decimal) is 0,1,2,3 representing the modus.

Using "Bits" will work only at "BIT-based" Offsets like this....
iconQuote:

3122 1 Radio audio switches. Read/write bit settings as follows:
2^7 COM1 transmit
2^6 COM2 transmit
2^5 COM receive both
2^4 NAV1 sound
2^3 NAV2 sound
2^2 Marker sound
2^1 DME sound
2^0 ADF1 sound



Here the "bits" (like you try to set with the "...dot" Button ) can be used to controll the LED.

******************

Last Note:

Always remember.... a LED will be OFF on value "0" .... And it will be ON on EVERY other value. .... So it light at value 1 but also at value 2, 3 or 99999999.
The key here is simply the compare Tab. May you still know there are lots of ways here.
Your "If current value <1 set to 1 else 0" is correct.
.... Also correct is IF value =0 set to 1 else 0 ..... or ..... if value !=0 (!= menas not equal) then 0 else 1
Lots of ways possible here.

So for the FLT Light ( Offset value 3) you can simply use "If value !=3 then 0 "
This set to OFF if its not 3 ..... If its 3 then it do nothing..... But LED still light at value 3 ... You Not need to say ELSE 1 here. 3 is Ok too.
Good Luck !
2019-05-27 22:22
Avatar
calibra2001
Posts: 11
Many thanks,

This part of my project is now working perfectly.

Phil
2019-06-02 14:23
icon