December 28, 201213 yr Moderator In the aircraft.cfg file you have the option of choosing the type of gyro used: vacuum or electric. If you choose electric, then the "rundown" will only occur when the master battery switch is off. You can add conditional logic to your gauge script such that the value remains zero when electric power is removed. <Value Minimum="-90" Maximum="90"> (A:Electrical Master Battery,bool) if{ (A:Attitude indicator pitch degrees, degrees) /-/ } els{ 0 } </Value> To the best of my knowledge there are no "reference books" or "tutorials" for XML gauge scripting aside from those very few at http://www.fs2x.com/Tutorials.htm Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 29, 201213 yr Author Thanks Fr. Bill, I've been working through those tutorials, I guess no easy way to learn, all I can do is keep setting myself new challenges and asking for help when I get completely stuck (which seems to be quite often!) I'll see how I can get on with the coding for controlling the 'rundown'.
December 29, 201213 yr Moderator You will need to add two things; a timer (for the 50 second spinup) and a counter from 0 to 359 to provide the 'rotation'... Keep in mind that the counter will run by default around 18Hz, so you would also need to program a way to "slow down the counter", perhaps by incrementing the count by +0.01 instead of +1... B) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 29, 201213 yr (P:LOCAL TIME, seconds) int (>L:MyTimer, seconds) This is what I use for timers. It's not dependent on outside influences. It also works if you pause the simulation. Hook Larry Hookins Oh! I have slipped the surly bonds of EarthAnd danced the skies on laughter-silvered wings;
December 29, 201213 yr Author Thanks guys, New Year duties are looming, but I've some good pointers there to get me going with it all when I can get back to it. It's probably a bit off-topic and I know there are several specialist forums on the topic, but do you think what I'm learning here with xml will help at all with interfacing the real instrument to the sim? I'm still researching the thing, it appears to pre-date any of the current established avionics programming protocols, but I'm just wondering if I ought to investigate some C programming at this stage, or will the xml variables and coding I'm learning still help out later down the road?
December 29, 201213 yr Using (P:ABSOLUTE TIME, seconds) avoids the rollover at midnight. Gerry Howard
December 29, 201213 yr Using (P:ABSOLUTE TIME, seconds) avoids the rollover at midnight. You're right. It's been a year or so since I used that function. The code I looked at was using (P:LOCAL TIME, seconds) to seed a random number generator. Hook Larry Hookins Oh! I have slipped the surly bonds of EarthAnd danced the skies on laughter-silvered wings;
December 30, 201213 yr Moderator Driving a "real instrument" will require either using C++ or possibly Lua scripting via FSUIPC to access a hardware device. In either case, XML scripting will be useless for driving any external hardware device. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 30, 201213 yr Author Thanks Fr. Bill, at least I know where I stand, the xml is a journey in itself though so worth my time. I started to dismantle the unit this morning, at least some of the assumptions I made in the xml gauge programming turned out to be correct assumptions! In small ways it has helping to understand the functions of the unit. I guess also the xml gauges can act as a sort of template, in that when the real instrument behaves the same way as the xml gauge, I know I'm on to something.
Create an account or sign in to comment