Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

delay in a XML function

Featured Replies

HiHow can I in XML build in a delay for a function.E.g. when I start the APU, I want to have a delay of, say, 5 seconds before I see the effect: "RUN" or "Power available"(No needle's etc)Thanksphjvh

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Assume you have a switch or button to initialize a variable.. (G:Var1)OFF = 0Start = 1Running = 2(G:Var1) 1 == if{ (P:Local Time, seconds) 6 % int 5 == if{ 2 (>G:Var1) } } (P:Local Time, seconds) 6 % int 5 == takes the local time, % divides time by 6 and gives the remainder as an integer, when the remainder = 5 it will toggle (G:Var1) to 2.. ( running )(P:Local Time, seconds) 6 % int 5 == or something similar is useful for things such as blinking displays. etc..Hope it helps... Regards,RomanProject 737-400Note, the way it looks here on the forum is different since HTML has processed it. On paper the " < " would be " & l t ; " , the " > " would be " & g t ; " and the " & " would be " & a m p ; ". All without the quotes and remove spaces between characters.

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Hi,Thanks for your work, but it didn't work out.Here are the gauges:1. this is the APU switch:(L:Battery Mode,bool) 1 == if{ (A:Electrical master battery,bool) } els{ (L:Dummy5, bool) }APU Main Switch(L:Battery Mode,bool) if{ 0 (>K:TOGGLE_MASTER_BATTERY) 1 (>K:TOGGLE_AFTERBURNER1) } els{ 0 (L:Dummy5, bool) ! (>L:Dummy5, bool) 1 (>K:TOGGLE_AFTERBURNER1) }2. the next one shows up when I press the switch and I want it to happen some 5 seconds later:(A:Electrical master battery,bool) (L:Battery Mode,bool) && I Hope you can help me.phjvh

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Sorry, but I donot understand the part of L:Dummy,bool.. So here is an example (not tested) using your L:battery mode which I assume is the state of battery bus. The light has been incorporated to the whole APU panel. Also in this code you need to provide a backround. When the APU is on the master battery is on, when the APU is off so is the FS battery, the engines should provide power through the gen busses and the L:Battery mode could keep power to the gauges tied to the Batt. buss. Also there is a 3rd bitmap for the start position. If L:Batt mode is off, and the APU is in start, or run and not running, it will return to OFF. (G:Var1)0 == off1 == run position not running2 == run position running3 == start position(G:Var2) Timer(P:Local Time, seconds) + 0.65 or 12 running. (***** section to turn off/on FS battery buss **** )(G:Var1) 2 == if{ (A:Electrical master battery,bool) 0 == if{ (>K:TOGGLE_MASTER_BATTERY) } } els{ (A:Electrical master battery,bool) 1 == if{ (>K:TOGGLE_MASTER_BATTERY) } }(********* Start position, return to run 0.65 sec. delay *******)(G:Var1) 3 == if{ (P:Local Time, seconds) (G:Var2) > if{ 1 (>G:Var1) + (P:Local Time, seconds) 12 + (>G:Var2) } }(********* Run position, timer starts ( 12 secs. before running) *******)(G:Var1) 1 == if{ (P:Local Time, seconds) (G:Var2) > if{ 2 (>G:Var1) } }(********* Knob bitmaps *******)(G:Var1) s1 0 == l1 3 == || if{ l1 } els{ 1 }(********* Start or run, APU not running and L:Batt mode turned off *******)(G:Var1) s1 3 == l1 1 == || (L:Battery Mode,bool) 0 == & if{ 0 (>G:Var1) }(********* ON bitmap *******)(G:Var1) 2 ==APU Main Switch(G:Var1) 0 == if{ 3 (>G:Var1) + (P:Local Time, seconds) 0.65 + (>G:Var2) } els{ 0 (>G:Var1) }This one is different than the first reply. The 1st code is flawed because it was dependant on actual time not the difference in time. On major problem is if the APU is turned to start at 23:59:47 or later local time, or FS is paused, the gauge will get stuck. Still haven't found a way 'round this. Regards,RomanProject 737-400Note, the way it looks here on the forum is different since HTML has processed it. On paper the " < " would be " & l t ; " , the " > " would be " & g t ; " and the " & " would be " & a m p ; ". All without the quotes and remove spaces between characters.

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Hi,What an effort!!Unfortunately FS2002 crashes, when I use the gauge...Still puzzling.Is it possible, as a start, for you, to make a dummy and test it somehow?Say, a switch, only on and off, with as result a light going off and on with "the delay" build in?I,m curiousphjvh

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi Romas,As phjvh's APU is from my ARJ and BAe146 Panel, I would be also interested in a functionally Delay :-) Is it possible to post the result here? I need it for a new Gauge, not an update of the ARJ PanelBest RegardsMatthias

Hi,Mailed already a grateful thanks to Roman.It works very fine.And Matthias, also thanks for your work and solution for the APU problem in MSFS.I was able to incorporate it in the 767-300 overhead panel.Greetingsphjvh

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi phjvh,I'm happy that you find the Gauge useful. However I'm still interested in the delay. I hope someone could post it here in the forum.Best regardsMatthias

Hi,Please share the code :-)BrgdsEugen

Hi all,Here is Roman's code, with indication to my bitmaps.In the mean time I changed the code, to incorporate it in the main electrical gauge of the overhead panel, see pic.(***** section to turn off/on FS battery buss **** )(G:Var1) 2 == if{ (A:Electrical master battery,bool) 0 == if{ (>K:TOGGLE_MASTER_BATTERY) } } els{ (A:Electrical master battery,bool) 1 == if{ (>K:TOGGLE_MASTER_BATTERY) } }(********* Start position, return to run 0.65 sec. delay *******)(G:Var1) 3 == if{ (P:Local Time, seconds) (G:Var2) > if{ 1 (>G:Var1) + (P:Local Time, seconds) 12 + (>G:Var2) } }(********* Run position, timer starts ( 12 secs. before running) *******)(G:Var1) 1 == if{ (P:Local Time, seconds) (G:Var2) > if{ 2 (>G:Var1) } }(********* Knob bitmaps *******)(G:Var1) s1 0 == l1 3 == || if{ l1 } els{ 1 }(********* Start or run, APU not running and L:Batt mode turned off *******)(G:Var1) s1 3 == l1 1 == || (L:Battery Mode,bool) 0 == & if{ 0 (>G:Var1) }(********* ON bitmap *******)(G:Var1) 2 ==APU Main Switch(G:Var1) 0 == if{ 3 (>G:Var1) + (P:Local Time, seconds) 0.65 + (>G:Var2) } els{ 0 (>G:Var1) }phjvh

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi phjvh, Roman and Eugen,Great, thank you very much. The code is very useful.Best regardsMatthias

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.