PDA

View Full Version : Overhead Sync & IOCARD



excalibur67
03-09-2007, 07:32 PM
Hi at all, i would like to know in what way i can sync my hardware (for example one switch) with PMSYSTEM. I mean , for example , if i leave the battery switch hardware in ON position, when i restart PMSYSTEM the switch software stay in OFF position.
I use IOCARD and SIOC Code

Some suggestions ?

Thanks.
Giuseppe Reda

oal331
03-10-2007, 04:04 AM
First as i remember from my first tests opencockpits can "see" the switch position only if it is on on position and let the power to pass.

Second you have to check in pmsystems menu "IO card active" and not check the "hardware connected ignores switch position" from user menu

regards


Eddie

Peter Dowson
03-10-2007, 07:53 AM
i would like to know in what way i can sync my hardware (for example one switch) with PMSYSTEM. I mean , for example , if i leave the battery switch hardware in ON position, when i restart PMSYSTEM the switch software stay in OFF position.

In my PFC hardware driver I save the last set positions of each of the switches in the INI file, and as soon as I am re-connected to pmSystems I set all the offsets correctly for the last known settings, thus gaining synchronisation.

This works fine as long as no one messes with any of the switches whilst the driver isn't running! There's no way to "scan" the switches, the driver is only notified when one of them changes.

I don't know how your hardware links to pmSystems, but possibly this could be the subject of an enhancement request -- i.e to get your driver to save the positions before shutdown and re-establish them when reloaded. If your hardware connects direct to pmSystems then it sounds like a good idea for a pmSystems enhancement which would no doubt help many folks.

Meanwhile, all I can suggest is that you always land, park and shut things off into a known cold-and-dark setting, for every single switch, and ensure that the Initial settings in pmSystems are set accordingly.

Regards

Pete Dowson

excalibur67
03-10-2007, 08:45 AM
Thanks Pete and Oal331... To discover where is the problem in my Sioc Code (ver.3.4) , i coded only one switch (battery) in this way:

Var 1150,name Batt1, Link FSUIPC_INOUT, Offset $5628, Length 1 // Batt

Var 1154,name BattSW, Link IOCARD_SW, Input 16 // Batt Sw
{
IF &BattSW = 0
{
&Batt1 = SETBIT 0
}
IF &BattSW = 1
{
&Batt1 = CLEARBIT 0
}
}
Now i don't know if you know SIOC but the code is clear. The only thing is that my switch is opposite, i mean , when my switch hardware is in OFF position must give the signal ON at PMSYSTEM. This code works perfectly but only the sync....
Other suggestions ?

Thanks.
Giuseppe Reda

Peter Dowson
03-10-2007, 10:05 AM
Now i don't know if you know SIOC but the code is clear. The only thing is that my switch is opposite, i mean , when my switch hardware is in OFF position must give the signal ON at PMSYSTEM. This code works perfectly but only the sync....

But is the SIOC driver, or whatever they provide, actively scanning the switches, or is it only getting a signal when one changes? Is that code of yours being entered continuously or only when the relevant switch changes?

As I said, if the switches are not being actively polled, but only noticed when they change, then the answer would then have to be for either the SIOC driver (or whatever) or pmSystems to be made to save the last seen settings and reload them next time. This will then always work provided you don't change the switch positions in between.

If the SIOC system is supposed to be actively polling and your code recursively entered to deal with it, then there is evidently something wrong with it (not your code, but whatever is calling it).

Regards

Pete

excalibur67
03-10-2007, 10:50 AM
Hi Peter, yes is the reply for the SIOC lead the polling. Also after different try, i saw that sometimes i have the sync and sometimes no and all this very randomly. But when i sync manually all my switches hardware with Pmsystem after goes all fine also if i close and i reopen Pmsystem and in the meantime i did one change in one switch hardware this is synced when pmsystem is running again. The bad situation comeback if i close and i reopen Flight Simulator like happen one sort of reset general. Bah !!!!.

Thanks,
Giuseppe Reda

Peter Dowson
03-10-2007, 12:00 PM
Hi Peter, yes is the reply for the SIOC lead the polling. Also after different try, i saw that sometimes i have the sync and sometimes no and all this very randomly. But when i sync manually all my switches hardware with Pmsystem after goes all fine also if i close and i reopen Pmsystem and in the meantime i did one change in one switch hardware this is synced when pmsystem is running again.

Okay, so something is working right.


The bad situation comeback if i close and i reopen Flight Simulator like happen one sort of reset general. Bah !!!!.

Of course after an FS crash it is a good idea to close programs like pmSystems too, and restart them. Otherwise it may see the reload as simply the resetting of all of the FSUIPC switch offsets to zero, as they will be initially, and act accordingly. You need pmSystems to go through its normal initialisation phase when FS does the same. I know my drivers may not work correctly otherwise as they expect pmSystems to re-install its version number in the appropriate offset, as this is used to detect that it is running, and I'm not sure pmSystems does that again after its own initialisation.

Regards

Pete

dcutugno
03-10-2007, 12:02 PM
This was my long concerning about SIOC and OpneCockpits cards, the way it works is stated in the Doc, SIOC will monitor only if a Switch or Offset change it's state.

I've the same problem and i found a workaround, as long Sioc only detect a switch in its On position, i suggest you to invert the switch, so when ON(1) it send a signal to SIOC, the problem are the 3 Pos switch, no way to detect it's central Pos, unless you Initialize it in Sioc code at startup.

To solve your specific problem you have to Start the things in this order:

Start FS (at gate or runway)
Start PMsystems and let it fully load and initialize
Start SIOC and you will see your hardware get Sync

I can provide my SIOC example code to show you how to deal with 3 Pos switch and Initialization Routine.

I asked many times to OpenCockpit to provide some sort of scanning hardware at regular interval so we can get Sync everytime. But nothing as changed :-(

excalibur67
03-10-2007, 02:53 PM
Hi Dcutugno, finalmente un italiano, sto letteralmente impazzendo per questa sincronizzazione. Funziona tutto solo questo.. :( Se vuoi, mandami la parte relativa all'inizializzazione anche perchè tutto il resto mi funziona perfettamente.
In any case the problem is in SIOC because i did this try:

In my server Pc:
I started FS (at terminal)
I started SIOC Software
I putted the switch hardware for battery in On position
I Sarted FSINTERROGATE scanning the 5628 Address and the situation is as follow:
The software read 0, then SIOC at start don't send the value for the actual status of my switch hardware. But the thing strange is, if i move the switch in OFF position and after in ON the value goes at 1 and this it's ok,but after this, if i close FSINTERROGATE and SIOC software and i put the switch in ON position another time ,when i restart SIOC and after FSINTERROGATE doesn't give me the problem anymore. Like if the SIOC would in absolute one start per Flight Simulatior session. In fact if restart also the Flight Simulator and i repeat the try, the problem comeback...

Thanks.
Giuseppe Reda

oal331
03-10-2007, 06:50 PM
I've the same problem and i found a workaround, as long Sioc only detect a switch in its On position, i suggest you to invert the switch, so when ON(1) it send a signal to SIOC, the problem are the 3 Pos switch, no way to detect it's central Pos, unless you Initialize it in Sioc code at startup.
(

That also i said in my post, that has to be on ON position to have a circiut and let electric power to infomr Opencockpit's s/w that this switch is ON, otherwise OFF.
In 3 position switches, (On/Off/On) where is the problem? If it will be on ON no problem, right? Otherwise it will be on Off...


I also need feedback from people using sioc, as i only made some tests before 6 months and now ending my overhead i will start to work on opencokpits s/w and for wiring the switches. Do i have something to take care about? :-P

Regards


Eddie Armaos

excalibur67
03-12-2007, 12:26 PM
Hi at all, i solved finally my problems.
I followed the suggestion for dcutugno about one routine of initialiting. Then i putted inside this routine all the variables that point at segments interested and i give them the value 1. But only for the switches at 3 way (On-Off-On) and some switches that give the problems (some On-Off). Now works great !!!

Thanks at all.

Giuseppe Reda