EasyManua.ls Logo

Digi IX30

Digi IX30
1031 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Applications Develop Python applications
IX30 User Guide
659
1. Select a device in Remote Manager that is configured to allow shell access to the admin user,
and click Actions > Open Console. Alternatively, log into the IX30 local command line as a user
with shell access.
Depending on your device configuration, you may be presented with an Access selection
menu. Type shell to access the device shell.
2. At the shell prompt, use the python command with no parameters to enter an interactive
Python session:
# python
Python 3.10.1 (default, May 9 2021, 22:49:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Import the ain module and the Name class:
>>> from digidevice import ain
>>> from digidevice.ain import Name
>>>
The Name class uses the following naming:
n
Analog input port 1: Name.ain1
n
Analog input port 2: Name.ain2
n
Analog input port 3: Name.ain3
n
Analog input port 4: Name.ain4
4. To determine the current/voltage mode of an analog input port, use the get_mode function:
>>> ain.get_mode(Name.ain1)
<Mode.voltage: 'VOLTAGE'>
Returns either:
n
Mode.voltage: 'VOLTAGE': The mode is voltage.
n
Mode.current: 'CURRENT': The mode is current.
5. To determine the value of an analog input port, use the get_value function:
>>> ain.get_value(Name.ain1)
12
The return value will be in either:
n
mV, if the mode is voltage.
n
uA, if the mode is current.
6. Use Ctrl-D to exit the Python session. You can also exit the session using exit() or quit().
Help for the digidevice ain module
Get help for the digidevice ain module:
1. Select a device in Remote Manager that is configured to allow shell access to the admin user,
and click Actions > Open Console. Alternatively, log into the IX30 local command line as a user
with shell access.

Table of Contents

Related product manuals