sudo pip install multiio
or
sudo pip3 install multiio
sudo pip install multiio -U
or
sudo pip3 install multiio -U
$ python
Python 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiio.SMmultiio as m
>>> multiio = m()
>>>
Bases: object
Python class to control the Multiio Card for Raspberry Pi.
- Parameters:
- stack (int) – Stack level/device number.
- i2c (int) – i2c bus number
Calibrate 4-20mA input channel. Calibration must be done in 2 points at min 10mA apart.
- Parameters:
- channel (int) – Channel number
- value (float) – Real(measured) amperage value
Calibrate 4-20mA output channel. Calibration must be done in 2 points at min 10mA apart.
- Parameters:
- channel (int) – Channel number
- value (float) – Real(measured) amperage value
Calibrate rtd resistance.
- Parameters:
- channel (int) – RTD channel number to calibrate
- value (float) – Real(measured) resistance in ohm
Calibrate 0-10V input channel. Calibration must be done in 2 points at min 5V apart.
- Parameters:
- channel (int) – Channel number
- value (int) – Voltage value
Calibrate 0-10V output channel. Calibration must be done in 2 points at min 5V apart.
- Parameters:
- channel (int) – Channel number
- value (float) – Real(measured) voltage value
Get current calibration status of device.
- Returns: (int) Calib status
Get all leds state as bitmask.
- Returns: (int) Leds state bitmask
Get all optocoupled input status as a bitmask.
- Returns: (int) Optocoupled bitmask
Get all relays state as bitmask.
- Returns: (int) Relays state bitmask
Get button status.
- Returns: (bool) status : True(ON)/False(OFF)
Get button latch status.
- Returns: (bool) status : True(ON)/False(OFF)
Get 4-20mA input channel value in mA.
- Parameters: channel (int) – Channel number
- Returns: (float) 4-20mA input channel value in mA
Get 4-20mA output channel value in mA.
- Parameters: channel (int) – Channel number
- Returns: (float) 4-20mA output value in mA
Get led state.
- Parameters: led (int) – Led number
- Returns: 0(OFF) or 1(ON)
Get motor speed value in %.
- Returns: (float) Motor speed value in %
Get optocoupled input status.
- Parameters: channel (int) – Channel number
- Returns: (bool) Channel status
Get optocoupled inputs edges counter for one channel.
- Parameters: channel (int) – Channel number
- Returns: (int) opto counter
Get optocoupled channel counting edges status.
- Parameters: channel (int) – Channel number
- Returns: (int) Counting edge status : 0(none)/1(rising)/2(falling)/3(both)
Get optocoupled encoder counter for one channel.
- Parameters: channel (int) – Channel number
- Returns: (int) Opto encoder counter
Get optocoupled quadrature encoder state.
- Parameters: channel (int) – Encoded channel number
- Returns: (int) state 0(disabled)/1(enabled)
Get relay state.
- Parameters: relay (int) – Relay number
- Returns: (int) Relay state
Get rtc time.
- Returns: (tuple) date(year, month, day, hour, minute, second)
Get RTD resistance in ohm.
- Parameters: channel (int) – RTD channel number
- Returns: (float) RTD resistance value
Get RTD temperature in Celsius.
- Parameters: channel (int) – RTD channel number
- Returns: (float) RTD Celsius value
Get servo position value in %.
- Parameters: channel (int) – Channel number
- Returns: (float) Servo position value in % for specified channel.
Get 0-10V input channel value in volts.
- Parameters: channel (int) – Channel number
- Returns: (float) Input value in volts
Get 0-10V output channel value in volts.
- Parameters: channel (int) – Channel number
- Returns: (float) 0-10V output value
Get firmware version.
Returns: (int) Firmware version number
Reset optocoupled inputs edges counter.
- Parameters: channel (int) – Channel number
Reset optocoupled encoder counter for one channel.
- Parameters: channel (int) – Channel number
Set all leds states as bitmask.
- Parameters: val (int) – Led bitmask
Set all relays states as bitmask.
- Parameters: val (int) – Relay bitmask
Set 4-20mA output channel value in mA.
- Parameters:
- channel (int) – Channel number
- value (float) – Amperage value in mA
Set led state.
- Parameters:
- led (int) – Led number
- val – 0(OFF) or 1(ON)
Set motor speed value in %.
- Parameters: value (float) – Speed value in %
Set optocoupled channel counting edges status.
- Parameters:
- channel (int) – Channel number
- value (int) – Counting edge status 0(none)/1(rising)/2(falling)/3(both)
Set optocoupled quadrature encoder state.
- Parameters:
- channel (int) – Encoded channel number
- state (int) – 0(disabled)/1(enabled)
Set relay state.
- Parameters:
- relay (int) – Relay number
- val – 0(OFF) or 1(ON)
Set rtc time.
- Parameters:
- year (int) – current year
- month (int) – current month
- day (int) – current day
- hour (int) – current hour
- minute (int) – current minute
- second (int) – current second
Set servo position value in %.
- Parameters:
- channel (int) – Channel number
- value (float) – Servo position value in %
Set 0-10V output channel value in volts.
- Parameters:
- channel (int) – Channel number
- value (float) – Voltage value
Clear watchdog counter.
Get watchdog initial period.
- Returns: (int) Initial watchdog period in seconds
Get watchdog off period in seconds.
- Returns: (int) Watchfog off period in seconds.
Get watchdog period in seconds.
- Returns: (int) Watchdog period in seconds
Get watchdog reset count.
- Returns: (int) Watchdog reset count
Reload watchdog.
Set watchdog initial period.
- Parameters: period (int) – Initial period in second
Set off period in seconds
- Parameters: period (int) – Off period in seconds
Set watchdog period.
- Parameters: period (int) – Channel number