How to get System Type (64-bit or 32-bit) in Ignition?

Hi All,

Is there a way to get Client System Type (64-bit or 32-bit) in Ignition?

We tried with below sample code

[quote]import sys
import os

def machine():
try:
return os.uname()[-1]
except AttributeError:
if “PROCESSOR_ARCHITEW6432” in os.environ:
return os.environ.get(“PROCESSOR_ARCHITEW6432”, ‘’)
else:
return os.environ.get(‘PROCESSOR_ARCHITECTURE’, ‘’)

strOS = machine()
system.gui.errorBox("OS Details = " + str(strOS))[/quote]
However, facing NameError: global name ‘os’ is not defined error.

Thank you

os is out of scope. You have to import it in the function where you are using it.

This works:

[code]
import sys

def machine():
import os
try:
return os.uname()[-1]
except AttributeError:
if “PROCESSOR_ARCHITEW6432” in os.environ:
return os.environ.get(“PROCESSOR_ARCHITEW6432”, ‘’)
else:
return os.environ.get(‘PROCESSOR_ARCHITECTURE’, ‘’)

strOS = machine()
system.gui.errorBox("OS Details = " + str(strOS))[/code]

Thanks Johnson. I forgot the simple concept.