PDA

View Full Version : Switch Position, LED & FSUIPC-Offset runs out of sync



starmarky
03-29-2009, 01:08 PM
Hello,

I tried a first simple test with my USB-Expansion, Mastercard an Input- and Output-Adapter. The test was to switch the FlightDirector in FS9 and send the status to a LED. No problem at all. But:

After a few times switching, the LED runs out of sync with the switch position AND the status of the FSUIPC-offset. This seems strange to me because the LED reads directly the bit-value of the corresponding FSUIPC-offset. It seems the the switch bounces a bit, but this is not noticable in the controllador.exe. I found out that the result changes with different MasterCard_Refresh-Values in the IOcard.ini (slower=less bouncing of the contact). But sooner or later the error appears again.

Any ideas?

Michael Carter
03-29-2009, 01:39 PM
What kind of switches are you using?

Break-before-make should be used. Also called non-shorting.

starmarky
03-29-2009, 02:06 PM
For my first test I used the big switches from OC. I tried a big ON-OFF and a (ON)-OFF-(ON). The same in both cases. Because there is absolutely no contact-bouncing when checked with the OC-control-program, I think the problem is somewhere else but not in the switches.

kiek
03-29-2009, 03:16 PM
Hi,
In order to help you you should provide some more details...
What software are you using? IOCards 'basic' or SIOC, which aircraft are you trying to control the FlightDirector, which FSUIPC offset are you using?

regards,
Nico

starmarky
03-29-2009, 04:45 PM
Hi Nico,

I use the standard IO-Software without SIOC. Simply the config- and controlprogram on a Laptop, networked via WLAN to the FS9-PC.

I used the standard FSUIPC-offset $2ee0, length 4, On= B+0, Off=B-0 for FD On/Off. I tried it with the standard FS9 Beech Baron just for testing the communication via WideFS. It works well besides the effect of the unsynced offset/LED/switch from time to time.

kiek
03-30-2009, 03:37 AM
Hi,

It is a long time ago I used IOcards basic, but the problem might be the 'dual' behaviour of this fsuipc offset, being as well a control (sending values into the simulator) as an indicator (a state coming out of the simulator).

I'm not sure if you have specified that well in IOcards basic, or whether that is even possible there.

In my opinion using SIOC is a good alternative and worth while trying.. ;-)

The script below deals with your application, you only have to adjust (with the Notepad editor) the input number (of Var 3) and the output number of Var 4) to the ones that you are using, save the script as FD.txt.

Then (after installing SIOC3.5 package), run config_sioc.exe, Import (as TXT) FD.txt, save as FD.ssi.

Change in sioc.ini, the parameter CONFIG_FILE to FD.ssi and make sure FSUIPC is enabled.

Then Run SIOC and off you go!

// begin of script
Var 1 name FD_OUT Link FSUIPC_OUT Offset $2EEO Length 4

Var 2 name FD_IN Link FSUIPC_IN Offset $2EEO Length 4
{
&FD_Led = &FD_IN
}

Var 3 Link IOCARD_SW Input 23 Type I
{
&FD_OUT = v3
}

Var 4 name FD_Led Link IOCARD_OUT Output 92
// end of script

regards,
Nico

starmarky
03-30-2009, 09:16 AM
Thank you very much, Nico, for your detailed answer. :)

I will give SIOC a try. But i thought that it is absolutely usual to use offsets as an input and output at the same time (otherwise there must be an offset each for incoming status-change and outgoing indicator, which I think is rather unusual?).

kiek
03-30-2009, 10:38 AM
But i thought that it is absolutely usual to use offsets as an input and output at the same time (otherwise there must be an offset each for incoming status-change and outgoing indicator, which I think is rather unusual?).

No it is only usual for rotary encoder values, such as heading, course, frequency and so on, not for switches and status of switches.

In the latter case you normally have two offsets (i'm not talking FSUIPC but interfacing technology in general), one as control for input and another as state as output. Note that you cannot be sure that if you put the switch to 1, that the FD switch in the panel also becomes 1... (otherwise you had better connect the led directly to your physical switch).

And also if the physical switch is 1 and the led is on, what hapepns if you click the FD switch back to 0 in the panel with the mouse? Then the led has to go out (value 0) while your physical switch is still is in the 1 position....

I don't know how FSUIPC deals with this 'problem' in offset $2ee0, again this is more a general remark about interfacing.

Nico

mmakela
03-30-2009, 11:40 AM
I get same kind of odd behaviour with right 3green led.
It goes off when I switch seatbelt sign on. Crazy, or what?
Maybe I finally go for SIOC also.

starmarky
04-01-2009, 01:12 AM
Note that you cannot be sure that if you put the switch to 1, that the FD switch in the panel also becomes 1... (otherwise you had better connect the led directly to your physical switch).

Again, thank you Nico.
It is not clever to connect the LED directly to the switch because the FD could go off due to other events in the cockpit without any switching of the knob. So the FD-status for the LED has to come directly from the offset, not from the switch position. A usual case for a lot of announciators I think.

In 1 hour I make a journey to Latvia for 5 days. Then I'll test SIOC and continue this thread.

Regards from germany
Mark

kiek
04-01-2009, 03:01 AM
.
It is not clever to connect the LED directly to the switch because the FD could go off due to other events in the cockpit without any switching of the knob. So the FD-status for the LED has to come directly from the offset, not from the switch position.

Exactlly! That is also the reason why one should not combine a control and a state in one and the same offset.

A good example, of how one should interface, is the Level-D SDK, in there you will find control commands for switches, and separate state variables for the position of a switch.
Take for instance a Korry Switch, that one has even two states, the position of the switch (On/Off) and an indicator whether the function controlled by the switch works or not (see for instance the 'press' light in Fuel Pump korries)

regards,
Nico