User manual
IEC61131 User and Reference Manual 
April 22, 2008     
318 
Inputs 
Type 
Description 
SlaveStn 
Integer 
Modbus station address of the slave station.  
Valid range is 0 to 255 if standard addressing is 
used, and 0 to 65534 if extended addressing is 
used. 
SAddress 
Integer 
Modbus slave register address. The first register 
where data will be read from or written to in the 
slave controller. 
MAddress 
Integer 
Modbus master register address. The first register 
where data will be written to or read from in this, the 
master controller. The register type does not have to 
match the type of the slave register address. It is 
possible to store input registers from a slave into 
output registers on the master and vice-versa. 
Length 
Integer 
The length input specifies how many registers are to 
be transferred. The maximum length for each 
function code is shown in the table below.  
TimeOut 
Integer 
Time-out is maximum time the function block waits 
for a valid response from the slave station, in tenths 
of seconds. Valid values are 0 to 65535. 
Outputs 
Type 
Description 
Done 
Boolean 
TRUE when the sendCmd input is TRUE and a valid 
response has been received from the slave. 
FALSE in all other cases. 
Error 
Boolean 
TRUE when the sendCmd input is TRUE and an 
error occurs. See the statusMasterCmd for a list of 
possible error codes. 
FALSE in all other cases. 
statusMasterCmd 
Integer 
The master command status code. See the Master 
Command Status Codes table below for description 
of each status code. 
Modbus Function Codes 
Function 
Code 
Purpose   
Description 
Maximum 
Registers 
01 
Read Coil Status 
Read digital output registers. 
2000 
02 
Read Input Status 
Read digital input registers. 
2000 
03 
Read Holding Register 
Read analog output registers. 
125* 
04 
Read Input Register 
Read analog input registers. 
125* 
05 
Write Single Coil 
Write digital output register. 
1 
06 
Write Single Holding 
Register 
Write analog output registers. 
1 
15 
Write Multiple Coils 
Write digital output registers. 
880 










