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.

Timer in XML gauge

Featured Replies

FSDS2.4 & fs9I want to use a timer function in an XML gauge to delay the apperance of bitmaps on the gauge.I have got the gauge working as I want using the 'spoilers' token variable and setting the time in the aircraft.cfg file.However inadvertant use of the / key upsets the sequencing.I note the 'TICK18' token variable in the fs9 SDK, used for "general purpose timing", but I have not been able to get it to work.Does anyone know the syntax to use TICK18 please?Regards Ted

  • Author

Hi Ted,I don't know about the TICK18 function, but here's how I do timing in all my gauges.Start timer:(P:ZULU Time,seconds) (>G:Var1)Test on timer elapse (example: 5.1 sec)(P:ZULU Time,seconds) (G:Var1) 5.1 + >if{ .........}The only disadvantage is, that this doesn't work on a date change when the timer is running (ZULU time becomes 0).(requires extra code to solve this).But for short timers, which are only occasionally running, the chance of this happening is not very big :-)Cheers, Rob

Thanks Rob -- The gauge is now working using your code.I am still curious about the TICK18 function though as it seems to be designed for the job.Regards Ted

TICK18 is a variable accessible only for C gauges.Rob, you might have a look at "ABSOLUTE TIME". If I recall that right it doesn't have a rollover (with unit "number", or "seconds"). As a C programmer I would use "ELAPSED_SECONDS", but I don't know if there is a XML equivalent.Arne Bartels

Gentlemen The routine works with ABSOLUTE TIME using units of seconds or number. I shall use the 'seconds option as I need all the remarks or notes I can to remind me two days later.Thank you both for the help. Regards Ted

  • Author

Hi Arne,I did try that, but I could never figure out how it worked.So I tried again ....%((P:ABSOLUTE TIME,number) )%!d! And this gave me a very large negative value, which increments by one every second.So I got my calculator.And it appears that AbsoluteTime in FS2004 is relative to:*** 14-July-2042, 01.04 AM GMT ***I tried several timesettings in between (by setting the date/time in FS2004 differently), loaded the same flight several times, even changed the date/time on my PC, but it always gave me the same date/time.Question: can you explain this funny date ?? Looks like a delayed millenium bug to me :-)Rob BarendregtPS: Apart from that: yes, it works OK for measuring time intervals.No date reset, no timezone change (like LOCAL TIME)..

You might have an integer overrun here with !%d!. Have you tried !%.0f! instead? I tried to get it from a C gauge with: execute_calculator_code("(P:ABSOLUTE TIME,number)",&val,NULL,NULL); and got something like 63221503248.0 which is 2003 years and a bit (one year 365.25*24*60*60 seconds, so Julian date, not Gregorian).Arne Bartels

  • Author

Hi Arne,You could very well be right about the overflow :-)Anyway, it's not really relevant if you just use ABSOLUTE TIME to do interval timing. Cheers, Rob

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.