Assignment of DCMotors Plus card

This is the forum to discuss and ask questions related to the new Oi4FS app for MSFS 2020
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

super cool - I think, I've a lot of work to do next days.
I'm very thankful for help and your info!!
I'll keep you informed.

På forhånd tak og god aften!
Rolf
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

the STAB TRIM Switch in PMDG 737-700 is guarded and you fortunately designed a seperat EVENT.
On my B737 Control stand from OC the switch is simply mechanical guarded, too, but the guard isn't
assigned with a electromechanical switch, it's a security, only.
Ok, I unlock the Stab Trim switch (OC hardware) and I'm able to shift the switch.
This switching is triggering the Stab Trim switch in PMDG 737-700 synchron by your EVENT 2347 = CONTROL_STAND_STABTRIM_AP_SWITCH, but I've to unlock the switch in the PMDG 737 by mouse click before - otherwise it's blocked by the guard (logical).

Now, I would like to make my changed script suitable in combination with EVENT 2348 = CONTROL_STAND_STABTRIM_AP_SWITCH_GUARD, in order to unlock it automaticaly befor shifting the switch. But always the guard is open first (ok), but the switch didn't shift. Therefore I integrated a delay (please see my script cutout below), but without the awaiting result.
It would be very nice to get another idea maybe. And a second question please: What's the meaning of static in a lot of your script lines
(e.g. Var 2638, name FAST_B_LI_SW, static) ?
Stab Trim AP Switch.7z
(345 Bytes) Downloaded 157 times
Med venlig hilsen
Rolf
mvr1918
Site Admin
Posts: 1628
Joined: Thu Aug 30, 2012 3:35 pm

Re: Assignment of DCMotors Plus card

Post by mvr1918 »

SIOC events for STAB_TRIM SWITCH on PEDESTAL

2727 = STAB_TRIM_OVRD_SWITCH
2728 = STAB_TRIM_OVRD_SWITCH_GUARD

SIOC events for CONTROL STAND STAB_TRIM

2347 = CONTROL_STAND_STABTRIM_AP_SWITCH
2348 = CONTROL_STAND_STABTRIM_AP_SWITCH_GUARD
2349 = CONTROL_STAND_STABTRIM_ELEC_SWITCH
2350 = CONTROL_STAND_STABTRIM_ELEC_SWITCH_GUARD

here is an example of script code used for a guarded OVH switch that could be used:
Screenshot 2022-08-21 121430.jpg
Screenshot 2022-08-21 121430.jpg (170.08 KiB) Viewed 1246 times
static is used to make sure the compilation does not change the variable numbers
the static variable numbers must be correct to set correct function
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,
phantastisch, now it‘s much clearer.
Two question in addition please.
The s in front of a lot variable names (e.g. sSPOILER_A_OFF) means it‘s a variabel that transfer Datas directly with MSFS comparable the offsets $ from Pete Dowson?

Would it theoretical possibel to set instead of CHANGEBITN 0 —> CHANGEBIT 1 and would it then change the same?
Sorry for my „stupid“ questions, but it‘s very important for me to understand SIOC more and more.

Med venlig hilsen!
Rolf
mvr1918
Site Admin
Posts: 1628
Joined: Thu Aug 30, 2012 3:35 pm

Re: Assignment of DCMotors Plus card

Post by mvr1918 »

The s in front of a lot variable names (e.g. sSPOILER_A_OFF) means it‘s a variabel that transfer Datas directly with MSFS comparable the offsets $ from Pete Dowson?
s = switch b = button r= rotary, just a naming metods to see what type of variable it is, it does not have any other meaning

the driver and script software do not use FSUIPC, no need for it

to understand SIOC better, please read https://www.lekseecon.nl/downloads/psx/How_to_SIOC.pdf

and just try to write code, that is the way I learned it
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

thank you for explanation and the link!
Yes, I wrote little codes in the past with FSUIPC offsets and UIPCX(using an offset table) for X-Plane with success, but actually it's one point to understand exactly how your EVENTS realy work and how to integrate it in SIOC scripts respectively to "play" with it. I know no need FSUIPC because you designed the special EVENTS! So I don't really understand whether I need these EVENTS for flaps only
2326 = CONTROL_STAND_FLAPS_LEVER_0
2327 = CONTROL_STAND_FLAPS_LEVER_1
2328 = CONTROL_STAND_FLAPS_LEVER_10
2329 = CONTROL_STAND_FLAPS_LEVER_15
2330 = CONTROL_STAND_FLAPS_LEVER_2
2331 = CONTROL_STAND_FLAPS_LEVER_25
2332 = CONTROL_STAND_FLAPS_LEVER_30
2333 = CONTROL_STAND_FLAPS_LEVER_40
2334 = CONTROL_STAND_FLAPS_LEVER_5
or in combination with 2325 = CONTROL_STAND_FLAPS_LEVER?
Or is EVENT 2325 = CONTROL_STAND_FLAPS_LEVER seperataly in relation to a suitable script what handels all 8 notchs then?

To implement switches was good to handel for me, but analog potentiometer (for flap lever) is the next step. In the past in X-Plane it was no problem for me with FSUIPC, but now it's a little other situation.
So I try to write a code with your EVENTS for flap lever and function step by step, but I got problems in the beginning.

E.g. if I tried to implement this line (s.below and an additional cutout script please in the attatchment)
Var 2351, name TH_flapslev, static, Link IOCARD_ANALOGIC, Device 14, Input 8, PosL 70, PosC 161, PosR 231 // Flaps Lever TQ OC
but after compilation the script with this line Oi4FS driver started with big delay and OVH and implemented switches from B737 OC TQ didn't work anymore. Compilation was ok!
I don't know realy why and SIOC manual didn't deliver an answer from my point of view.
Flaps_.7z
(357 Bytes) Downloaded 157 times
På forhånd tak og god aften!
Rolf
mvr1918
Site Admin
Posts: 1628
Joined: Thu Aug 30, 2012 3:35 pm

Re: Assignment of DCMotors Plus card

Post by mvr1918 »

When using analoge inputs you must ensure that the inputs do not changes all the time, they have to be stable, otherwise SIOC will get overfloded.

Try to connect pin 1 to pin 2 on unused analoge inputs to get rid of fluctuation. Small fluctuations can be eliminated bu added a software filter in the script code.

The Var 2325 is independent of the other flap variables.

Setting 8192 will mode up and 16384 will move down. You need to set 1000 in between so SIOC detect another up or down setting.

In the analog input variable you can set different values to trigger different flap variables ( the Vars 2326- 2334)
or make a function that trigger the flap either up or down via Var 2325

Flap positions can be read from Var 1328 and Var 1329.

I do not have time to make this script, but it should be possible with some clever scripting.
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

thank you for valuable tips and it will help me a lot!

Tak og god aften!
Rolf
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

I wrote some progam lines in relation of my OC Flap lever (please see below in the attachment) and it was mostly succesfull.
If I run Oi4FS with changed script and Flap lever on hardware is at 40°, I'm able to set it step by step until 0° synchronized with flap lever of PMDG 737-700 (the values in IOCP console alle changed to aktiv -1 - see attachment).
If I go back from 0° to 40° then at step 1° nothing happens because the value didn't change from -1 to 0 and after that to -1 again. (The value of 0°changed in IOCP console from -1 to 2147483647). If I go further on to 2°the flap lever in PMDG moved to 1°(The value of 1°changed in IOCP console from -1 to 2147483647, too) etc. At the end flap lever 40°( TQ OC) the flap lever of PMDG is on 30°

If I start/run the Oi4FS driver new and start now Flap lever on hardware at position 0°, I'm able to set it step by step until 40° synchronized with flap lever of PMDG 737-700 because all values are 0 after driver new start. Further I'm able to go back from 40° to 0° synchronized with PMDG, but the the same problem happens, if I go back to 1°with hardware lever it don't move in PMDG, but the if I go on 2° (TQ OC) it moved to 1° in PMDG etc (like above).

How could I set the values after -1 to 0 and after that -1 again? I tried a lot of terms in the last days, but without success. I beg you for help respectively a hint.
Flaps_TQ.7z
(668 Bytes) Downloaded 151 times
IOCP Console 1.png
IOCP Console 1.png (32.09 KiB) Viewed 1187 times
IOCP Console 2.png
IOCP Console 2.png (33.74 KiB) Viewed 1187 times
Tak og god aften!
Rolf
Skycowboy
Posts: 52
Joined: Wed Jul 20, 2022 3:20 pm

Re: Assignment of DCMotors Plus card

Post by Skycowboy »

Hej Roar,

I modified my flap lines a little bit - maybe not very elegant, but flap lever is working synchronized with all steps now!
Some steps, like 2° --> 1° is delayed obviousely in relation to transit time and partly and irregular 25° or 30° to 40°.
I suspect a noise of the OC potentiometer. It would be nice if you could send me the lines and application of the SIOC noise filter you mentioned before.
By the way, The Oi4FS driver is working with the new PMDG 737-800 partly. So the annunciator of the OVH don't illuminated - the switches are working. I'll test it furthermore.
Flaps_TQ_2.7z
(648 Bytes) Downloaded 155 times
Med venlig hilsen!
Rolf
Post Reply