Jump to content
Sign in to follow this  
n4gix

FS9 no amps from generator-alternator

Recommended Posts

Hi,all I wanted was a small xml-gauge that would display amps from engines alternators.This is the code I used:(A:ELECTRICAL GENALT1 BUS AMPS, amps)Getting absolute no result, I tried with all other available bus-types, but no matter what I try, the needle wont move.Is this covered by the wide choice of bugs in the simulators electrical system?best regards and thanks in advance for any hint or comment.

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

For a generator to be powering the main bus, the engine must be running. Also, while volatage can be negative with AC current, amps are always going to be a positive number.You'll need to post more of your code for us to be able to see if it needs debugging.Suggest you take a look at one of the XML files that comes with a default aircraft. Just unzip it.

Share this post


Link to post
Share on other sites

Hi,Use this string somewhere in a gauge and it will read amps:%((A:ELECTRICAL GENALT1 BUS AMPS,amps))%!d!As an element:%((A:ELECTRICAL GENALT1 BUS AMPS,amps))%!d!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

thx alot, primary problem solved.but there's one last question:I use local vars to simulate APU. It works fine - except 2 last problems.1st. I try to delay the reaction of the needle on the ammeter and voltmeter. The code looks like this for the ammeter, same for the volts with different vars and values:(L:ELECTRICAL APU BUS AMPS, amps) Works, but the needle jumps right up to 60, and I want it to take some time on it's way. Any way to do that?edit: 2nd problem solved, topic found.

Share this post


Link to post
Share on other sites

Hi,Try:orAnother way is:(L:ELECTRICAL APU BUS AMPS,amps) 1 + (>L:ELECTRICAL APU BUS AMPS,amps) But I don't know what gives the value 60 to the amps in your gauge.A possibility is:(L:APU,bool (on)if{ (L:ELECTRICAL APU BUS AMPS,amps) 1 + 60 min (>L:ELECTRICAL APU BUS AMPS,amps) } els{ (L:ELECTRICAL APU BUS AMPS,amps) 1 - 0 max (>L:ELECTRICAL APU BUS AMPS,amps) } So the gauge becomes:(L:APU,bool) if{ (L:ELECTRICAL APU BUS AMPS,amps) 1 + 60 min (>L:ELECTRICAL APU BUS AMPS,amps) } els{ (L:ELECTRICAL APU BUS AMPS,amps) 1 - 0 max (>L:ELECTRICAL APU BUS AMPS,amps) } (L:ELECTRICAL APU BUS AMPS,amps) You don't need "imagesizes".Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

One last thing.. I want to change several local vars with the click-event. In my code it looks like that: 0 (>L:ELECTRICAL APU BUS VOLTAGE,volts) 0 (>L:ELECTRICAL APU BUS AMPS, amps) Needless to say, this is not working. I guessed it should, I saw it in several other gauges.. but it just does nothing. Each event put there as a single one works.

Share this post


Link to post
Share on other sites

Hi,Why should you want to set amps and volts at zero in the click?If the previous case is still valid the amount of amps or volts are determinded in the value statement.So if you click 0 the value is going to override this.On the other hand you can put as many >L, >G, >P and >K's in the click section as you want.Logically in your APU it should contain:0 (>L:APU,bool) or(L:APU,bool) ! (>L:APU,bool) Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

I have several other gauges that display volts and amps from different sources, like the alternators-generators of the engines, the avionics-bus, the battery and hot-battery and so on.Those instruments already have a readout for L:ELECTRICAL APU BUS AMPS and L:ELECTRCAL APU BUS VOLTS. So I tried to set those values from within the new APU-gauge without changing the code of the existing gauges. This is why I wanted that to happen on click. The code-snipet was from the "off"-section of the switch, intended to set all the values back to zero when the APU is shut down.I still try to find out - with kind help of the SDK and your way more helpfull hints - what the different event-types really do, and were to use which of them.I guess, there is no way to code an APU in XML that will really "replace" or at least recharge the battery, right? Would C++ do the trick?

Share this post


Link to post
Share on other sites

Hi,You can set battery life in the registered version of FSUIPC.The more difficult way, but with a lot of satisfaction, is to create a custom elec. system 100% real as designed for the plane.Then the aircraft becomes independant of FS and you can recharge batteries by the generators, apu or external power unit.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

One caveat regarding battery life. If FS sees the battery dead, no amount of custom code will start the engines. ;)


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

>One caveat regarding battery life. If FS sees the battery>dead, no amount of custom code will start the engines. ;)This entry in aircraft.cfg will give unlimited battery power, a good start point for a custom electrical system.[electrical]......electric_always_available = 1Tom

Share this post


Link to post
Share on other sites

Well,I guessed it would be like that. Makes sense, from the pov of the simulator ;-)But if it does only apply to the startes - and I guess the radios - it's not quite a problem. The "virtual" electric system will run, and when it comes to starting the engines, it's not a problem to make the starter-switch turn on the batt and hook up a gen-alt when the engine is running.Looks different if more systems need "real" battery-power. Then you could drain the battery quite fast while going thru the prestart-procedures.There is a section in the acft.cfg that sets load for several systems in amps. Would it help if the load is set to zero there and only simulated using local vars in the virtual electric system?

Share this post


Link to post
Share on other sites

>>One caveat regarding battery life. If FS sees the battery>>dead, no amount of custom code will start the engines. ;)>>This entry in aircraft.cfg will give unlimited battery power,>a good start point for a custom electrical system.>>[electrical]>...>...>electric_always_available = 1>>Tom>Okay, then one doesn't need to tinker with the other stuff at all :-D

Share this post


Link to post
Share on other sites

>>Okay, then one doesn't need to tinker with the other stuff at>all :-DProbably no :-) I can assure you that my a/c will go completely dark after 40 mins of battery only power draining...Tom

Share this post


Link to post
Share on other sites

>I guess, there is no way to code an APU in XML that will>really "replace" or at least recharge the battery, right?>Would C++ do the trick?Just for sake of completeness... although FS9 doesn't have a GPU or APU system available......FSX does. The new APU "system" will actually keep the battery "charged" and supply unlimited power to the a/c systems. ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...