View Full Version : SIOC help with low volts light needed

02-22-2010, 06:08 PM

I am trying to figure out how to light the low volts light on my panel, but as I am not an expert in these things I am struggling.

The first thing I'm not sure on is which FSUIPC offset to use, eg main battery or hot bus voltage or main bus voltage.... and so on.

Secondly, I'm not entirely sure how to only light the low volts LED if the master battery is state is 1 or the master battery switch is on, in other words how do I make it conditional .

Thirdly, I basically don't have a clue, little out of my depth, but enjoying and learning fast!!

Anybody have any tips, example code?? -SIOC that is

Many thanks

02-22-2010, 06:28 PM

Try this link to begin with - it will give you an idea of the structure and how to make conditional actions




02-22-2010, 07:06 PM
I've been on Nico's site already, but am still strugling some

thanks for the pointer though


Try this link to begin with - it will give you an idea of the structure and how to make conditional actions




02-22-2010, 10:21 PM
The low volts light comes on when the battery running while the engine is running?

Thinking outside the box a little. Sometimes hardware is better then software?

Seems like a timer circuit should do the trick?

You could set up a timer on the master battery switch that times the length of time the battery is on. When that time runs out the low volt light comes on. If you then turn the master battery switch off (on or before that time runs out) the timer runs backward to simulate the charging of the battery when that is done the relay then turns the low volts light off again.

That condition will also cause the engine to fail if it continues. So there should be a 2 points where the timer does 2 things. First would be to turn the low volts light on. The second would be to shut the engine off. If you are simulating that? It would depend on the specs of the aircraft as to when those conditions happen? How powerful the battery is? That would depend on the amount of avionics the aircraft is equipped with. More demand increases battery size requirements.

You could find that out by flying the plane with the master battery switch on and timing the length of time it takes the low volts light to come on - then the length of time to engine failure. If your aircraft model is modeling those two things? For some aircraft that isn't built in so then you will need to take your best guess? There could be something in a POH somewhere I'll take a look.

NOTE: I couldn't find anything in the 172 POH either describing the low voltage condition or the charging times.

I would think a key press could take care of the engine fail.

Now I have no idea how to build it. It would be a combination Timer + Logic circuit to handle the 4 conditions.

Battery Switch ON
- Count up to point x (then turn on low volts light)
- Continue count to point y (shut engine off) ctrl+e
Battery Switch OFF
- Count down (if count has exceeded Low volts condition then keep light on till timer is < low volts condition
- Continue count down till 0 (battery fully recharged).

Shouldn't be too to hard to do? Wiley helped me with a landing gear action (this is quite similar) So drop him a line he should be able to take this on pretty easily?

You have a few other things to consider though the ammeter gauge that shows voltage flow under these conditions? If the ammeter was digital you could perhaps even be a stop watch of sorts to do this with?

Keep us posted though. I'll be needing something like this as well...

02-23-2010, 04:20 AM
Hi there,

no need for any hardware circuit here. SIOC has the needed power to do just as you describe what that hardware should do but much more easier.
Just get on with it, check out Nikos site, try out some things and iocpconsole program allows you to follow what is happening with the variables
so its easy to trace and debug what your try out script is doing.
Trial and error ... thats te thing ...
Greetings Peter

02-23-2010, 04:50 AM

Peter has given some sound advice here. H/W is not the answer. When I first started SIOC it was daunting, but just dive in and try it. Yes, it is frustrating but the power is immense and in a while all will become clear!



02-23-2010, 06:31 AM
I think I could code this, but I am maybe confusing myself with the logic of how a real low volts light functions in a PA28.

All I know is that when I fly real world, the low volts light should go out after engine is started and the alternator is running. This is part of the checklist.

In flight if it comes on, land asap. I am not that bothered about coding failures in the SIM so I am not worried about that.

I can't remember for the life of me if the low volts light comes on from a cold and dark cockpit when the master switch is first switched on.

Does anybody know the logic behind this, putting aside the coding of SIOC for a while.



02-23-2010, 02:09 PM
ALT Master and BAT master switch work kind of opposite to each other.

BAT master is used to start your engine and after your rpms are to a good value you should switch on your ALT master and turn your BAT master off. At that point the plane is running on the Alternator. If you fail to turn that on you will continue to drain the battery till there it gets to a low level. In the Cessna there is a safety for that to keep the battery from completely draining but it cuts power off from the battery.

At some point perhaps at half drain the LOW Volts light will come on and in some cases there is a audible warning as well. The LOW Volts can come on for other reasons as well. A short could be draining the battery or other system failure. I've not experienced that in the sim though. Although perhaps possible with realism set on high?

I was thinking from the standpoint of a hardwired light on your MIP the timer circuit would fit the bill. If you are only simulating that failure to switch between ALT and BAT master. If you're simulating the condition in the sim that would cause the low volts light then you'll need to dig into the coding. It perhaps is the more authentic solution. As there is more then just the low volts light involved there is the ammeter too.

The BAT master is used only to start the aircraft and in case of emergency. Don't quite know why there isn't a automatic switch? Perhaps as a safe guard in case you need to go back on battery power.

The only reason I can think of for the LOW Volts to come in a cold dark cockpit would be if the battery was already drained or you let the battery drain by leaving the BAT Master on too long. The battery not only powers the lights and starts the engine but powers the radios and gyros for AH and HI. In Pre start though you are supposed to turn you AVIONICS Master off to prevent power spikes/disruptions due to engine cranking and firing from damaging the equipment.

If the low volts light comes on during flight that would indicate (if not the BAT Master still being on) that there is a fault in the electrical system draining your battery. If reseting by turning on your Bat Master on and then off again doesn't reset the light then the fault will continue to drain the battery until the safety cuts battery power off. At that point you won't be able to crank the engine for a restart during flight should you need to. It then almost becomes a condition of low fuel and landing is imperative.

They are two separate systems I'm thinking so that if there is a fault in one it doesn't effect both. Say for instance an alternator failure you still have the battery as a back up to a degree.

If you have a POH for the PA-28 handy it should be in there. Electrical system.

For the Cessna 172 this is there electrical schematic.

02-23-2010, 07:20 PM
Thanks for all your help, in the end I cracked it, understanding that SIOC is events based is the key, its a mindset that does not come easily or obviously from the outset as a non programmer like me. Full respect to those programmers!!

Thanks to Nico for his website, very good resource.

I think I will post my code here for comments and reference, its a bit messy but it works.

02-23-2010, 09:47 PM
Cool. I myself haven't looked into coding but seems like that is a hurdle I'll need to get over. Not quite there yet though hehe. I have had some programing experience but it was quite some time ago. Perhaps like riding a bike though ;) it may not be so bad.