How to detect flags on startup as well as getting objects to change depending on the result

Hello Everyone

Ok, so I'm trying to create a program that can detect whether if it is running in a mobile platform or a desktop. I found a link that uses the flags that ignition collects to see if it a mobile device.

https://docs.inductiveautomation.com/display/DOC80/system.util.getSystemFlags

In that link it suggests that by using the following code you can detect if a device is mobile by looking at the 7th position in the array which, if I understand it right, will hold an 1 or 0 to indicate if it's mobile or not.

systemFlagsList =
flags = system.util.getSystemFlags()
for i in range(7,-1,-1):
systemFlagsList.insert(0, flags >> i & 1)
if(systemFlagsList[7] == 0):
session.custom.IsMobileDevice = False
else:
session.custom.IsMobileDevice = True

This is our custom code to match our project. The custom property is linked to a button which will disappear and be disabled if it's not a mobile device. The code was also put in the Session event so that during the startup of the session it will query for the information from the device, or at least that's the theory.

It didn't do that. When we were looking into why it's not doing that, we tried using the system tags to try and work around, but we found an article that says Perspective doesn't have access to those tags.

We also tried using the system.tag.readBlocking but it didn't work. link below

https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking

At this point we are out of ideas or links. I have no idea how to get it to work. Please advice.

System flags are Vision/Designer concept. You want the session properties, one of which indicates the type of session: mobile, browser, or workstation.

https://docs.inductiveautomation.com/display/DOC81/Session+Properties#SessionProperties-SessionPropertiesTable

1 Like

so the setting that I think you're talking about says what OS the system that opened the program is. In the Session properties, under device type it says, ios, android, designer, browser, workstation.

Since we are trying to determine if this is a device that can be used to scan a barcode or needs a separate scanner for it then we need something that will determine if the device the system is running on is a mobile one.

I could just make a procedure that will allow the feature if the device was android or ios, but we are using windows tablets because of our security. Which makes this a bit more complicated. Unless when we use perspective on a windows tablet it shows up as workstation, then it makes it very simple and I can work with that.

The device type will show up as workstation...if you're using Perspective Workstation:
https://docs.inductiveautomation.com/display/DOC81/Perspective+Workstation

This is an installable launcher for desktop OSes, similar in concept to the Vision Client Launcher and Designer Launcher, but specialized to launching Perspective sessions.

1 Like