Skip to main content
Skip table of contents

get_modbus_inputs(iobus_list)

Features

This function reads multiple signals from the Modbus Slave unit.

Parameters

Parameter NameData TypeDefault ValueDescription

iobus_list

list(string)

-

Modbus input name list (set in the TP)

signal type can be used only in the following cases

  • DR_MODBUS_DIG_INPUT
  • DR_MODBUS_DIG_OUTPUT

Return

ValueDescription

int (>=0)

Multiple signals to be read at once

(the value of the combination of iobus_list where the first value is LSB and the last value is MSB)


Negative number

Failed

Exception

ExceptionDescription

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example

PY
# Modbus digital I/O input signal "di1" =OFF, "di2"=ON, and "di3" =ON
res = get_modbus_inputs(iobus_list=[ "di1", "di2", "di3"])
           #res expected value = 0b110 (binary number), 6 (decimal number), or 0x06 (hexadecimal number)             
 
# Modbus digital I I/O input signal "di4" OFF and "di5" ON
res = get_modbus_inputs(["di4", "di5"])
              #res expected value = 0b10 (binary number), 2 (decimal number), or 0x02 (hexadecimal number)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.