3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

get_modbus_inputs()

Definition

get_modbus_inputs(iobus_list)

Features

This function reads multiple signals from the Modbus Slave unit.

Parameters

Parameter Name

Data Type

Default Value

Description

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

Value

Description

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

Exception

Description

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

Python
# 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)

Keyword

get_ / modbus / get_modbus / modbus_inputs