Batt Warning Light - Reset on Battery Switch

Help creating logic scripts for Air Manager Instruments

Moderators: Ralph, russ

Post Reply
Message
Author
warbirdguy1
Posts: 1
Joined: Sat May 01, 2021 12:57 am

Batt Warning Light - Reset on Battery Switch

#1 Post by warbirdguy1 » Sat May 01, 2021 1:19 am

Hey all I am starting to work on some LED caution panel for a project I am working on.

---On the real aircraft

The Battery Warning light comes on when the Battery is no longer charging (failed charging system or the generator is not on).

If the charging system kicks back on the Battery Warning light will only turn off if the Battery Switch is reset.

--In my code

The Battery Warning light turns on when the charging system fails or the generator is off which is correct.

My problem is that the light goes out as soon as the charging system is restored.

How can I make a condition where the Battery Warning LED can only turn off if the Battery Switch is cycled once the charging system is restored?

See below for my current code. Thanks in advance!

-----

Code: Select all


led_is_charging = hw_led_add("Arduino_MEGA_2560_A_D13",0)

function num(bool)
if bool then return 1 else return 0 end
end

function is_charging(charging)
    hw_led_set(led_is_charging, 1-num(charging))
end

fsx_variable_subscribe("ELECTRICAL BATTERY IS CHARGING", "Bool", is_charging)


JackZ
Posts: 1790
Joined: Mon Feb 22, 2016 1:02 pm

Re: Batt Warning Light - Reset on Battery Switch

#2 Post by JackZ » Mon May 03, 2021 12:56 pm

Hi

Without more information(addon used, type of airplane, for the sim platform I assume it’s FSX), it’s gonna be difficult to help, but from what I see, the answer is in part in the question.

You are only subscribing to the ELECTRICAL BATTERY IS CHARGING state. But the annunciator BATTERY WARNING LIGHT is not linked to this! It is usually related to a minimum battery voltage.

The battery bus is usually used at startup and during emergency when the generators are non longer generating voltage.
When the battery voltage is below a certain value, then the charging system automatically kicks in, unless the generator is not working (engines off, or generators turned off).

After startup this annunciator should light up for a brief moment until the battery is fully replenished (batt voltage above a certain voltage).
If the charging system fails the battery voltage will not raise to its charged level and the warning light comes on again.

So I would rather use the « battery voltage » as a trigger, along with a « generator are on » surveillance as a criteria for turning on the light.
But once again, without further information, it is difficult

Jacques
My YouTube Chanel on the A320 (Real SOPs):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
jph
Posts: 516
Joined: Fri Apr 10, 2020 12:50 pm
Location: A Brit exiled to Portugal

Re: Batt Warning Light - Reset on Battery Switch

#3 Post by jph » Tue May 04, 2021 9:36 am

Agree with Jacques 100%

Out of interest and just as a guide , you can also reduce your existing code to -

Code: Select all

led_is_charging = hw_led_add("Arduino_MEGA_2560_A_D13",0)
function is_charging(charging)
    hw_led_set(led_is_charging,(charging)) 
end
fsx_variable_subscribe("ELECTRICAL BATTERY IS CHARGING", "Bool", is_charging)
Providing the led is supposed to illuminate when charging. ?
Joe
“Everything in moderation, including moderation.”
“I am not young enough to know everything.”
“Experience is merely the name men gave to their mistakes.”
-- Oscar Wilde --
Joe (CISSP) -IT security consultant

JackZ
Posts: 1790
Joined: Mon Feb 22, 2016 1:02 pm

Re: Batt Warning Light - Reset on Battery Switch

#4 Post by JackZ » Sat May 08, 2021 12:14 pm

Nearly one week from the initial message of the OP & no reply from him/her. Typical. :x
Sometimes one wonders why spend time to help people like this one. Lesson learnt.

Jacques
My YouTube Chanel on the A320 (Real SOPs):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
jph
Posts: 516
Joined: Fri Apr 10, 2020 12:50 pm
Location: A Brit exiled to Portugal

Re: Batt Warning Light - Reset on Battery Switch

#5 Post by jph » Sat May 08, 2021 1:12 pm

JackZ wrote:
Sat May 08, 2021 12:14 pm
Nearly one week from the initial message of the OP & no reply from him/her. Typical. :x
Sometimes one wonders why spend time to help people like this one. Lesson learnt.

Jacques
Jacques
It is Fecking annoying !.
I agree, It makes one pissed off. Perhaps we need a section where people with a few posts can only post in ? - I know, I know, it is difficult, and I don't know the answer. :cry:
But..............
“Everything in moderation, including moderation.”
“I am not young enough to know everything.”
“Experience is merely the name men gave to their mistakes.”
-- Oscar Wilde --
Joe (CISSP) -IT security consultant

User avatar
Sling
Posts: 4388
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Batt Warning Light - Reset on Battery Switch

#6 Post by Sling » Sat May 08, 2021 2:06 pm

jph wrote:
Sat May 08, 2021 1:12 pm
Jacques
Perhaps we need a section where people with a few posts can only post in ? - I know, I know, it is difficult, and I don't know the answer. :cry:
But..............
I proposed something like this to help with the spamming issue quite recently and some of you didn’t like it. Other forums do it in varying different ways. Anyone been through the FSE registration process will know what a pain that is. No perfect answer but something a little different might be worth a trial.

User avatar
Keith Baxter
Posts: 2719
Joined: Wed Dec 20, 2017 11:00 am
Location: South Africa

Re: Batt Warning Light - Reset on Battery Switch

#7 Post by Keith Baxter » Sat May 08, 2021 2:49 pm

Hi

I have a different view... :evil:

The OP posted his first post on...
Post by warbirdguy1 » Sat May 01, 2021 3:19 am

The first response was a few days later.,...
by JackZ » Mon May 03, 2021 2:56 pm


If it was me posting here for the first time waiting all this time for some help. Would you return???

Looks like the OP did and now is accessing advice given

And was last on line on the ....
Last active:Fri May 07, 2021 11:15 pm

We all to often take things for granted and do not look in the mirror.

I sure hope that we all reconsider how new members are treated and stop taking digs and cheep swipes at them. Most come here for advise and guidance expecting some warm fuzzies. Lets provide that to all the new members and keep the cold pricklies off this forum.

My 2p

Keith

EDIT: I see the OP was online at "Last active:Sat May 08, 2021 5:25 pm" soon after I posted. Hopefully he takes heart and reverts to us.
AMD RAZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply

Who is online

Users browsing this forum: Keith Baxter and 3 guests