Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

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.

Size of integers

Featured Replies

Posted

Sorry - I'm sure this is answered somewhere but I've spent 15 minutes searching without finding so I gave up and posted what could be a dumb question.

 

What size are the integers in ISY?  I'm assuming 32bit?  unsigned?  signed?  

 

I ask because I'm trying to set a variable to time/date stamp when another variable or program has been changed.  Any 'simple' representation of this (311216 for instance for 31st of December, 2016) will be a large integer - especially if I try to time stamp it turning it for, say, 13:57 - it could be 3112161357 - which will just fit into an unsigned 32bit space.  I could drop the 16 to 6 to make it work for 32bit signed.  I *could* break it into two variables - one for date and one for time - but I'd rather not.

 

Of course, if there's a better way to time/date stamp I'd appreciate the input.

 

 

Thanks,

 

mark

Edited by MarkJames

Your best bet is to use the sort-of-normal "seconds-since-epoch" for date-time stamps.  That way simple math can easily be used to figure out time deltas - plus it's pretty much just the standard way it's done.  Regarding the integer size -- I've had no difficulties storing an epoch-style value in a variable, so I think it's at least 32 bits -- but I'll defer to others who may have more definitive information on integer size on the ISY.

Variables are 32 bit signed values.

 

v5 also have a decimal precision parameter to indicate where the fixed decimal falls.

 

I use MMDDhhmmss for some time stanps. With v5 seconds since midnite is a built in ISY parameter.

 

 

Here I just used the seconds parameter from v5 ISY.

http://forum.universal-devices.com/topic/17366-v5-tracking-fan-cycle-runtime/

Edited by larryllix

  • Author

Thanks very much.  That helps a lot.

 

I'm actually going to be doing the math in Homeseer and storing the result in ISY variables.  Part of what I'm after is knowing when sprinkler zones turned on or off and how long they ran for.  This is all reported in the homeseer hspi that mcsSprinklers runs in but I want to display the data on my personal web server and it's easier to grab that from the ISY than from the homeseer where I'd have to use Ajax.

 

Looks like I could just use the javascript getTime() function to get seconds since epoch (or now() for milliseconds)  for start and stop times then

 

 

mark

Edited by MarkJames

Guest
This topic is now closed to further replies.

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.