ModRtuMast
(FB)
FUNCTION_BLOCK ModRtuMast EXTENDS ModRtuMastBase
Function Block serves to send Modbus RTU requests to a server and evaluate the response
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
Endian
CAA.ENDIANESS
CAA.ENDIANESS.BIG
Select the endianes / byte order of data formatted as WORD
ModRtuMastBase
Serv
BYTE
0
Address of the remote Modbus RTU Server device (0 = broadcast)
ModRtuMastBase
Fct
BYTE
0
Function Code as specified in Modbus Protocol Specification
ModRtuMastBase
Timeout
WORD
2000
Wait for server’s response up to Timeout milliseconds
ModRtuMastBase
Addr
WORD
0
Operand/Register address in remote Modbus RTU Server device
ModRtuMastBase
Nb
WORD
0
Amount of data units to be sent/received
ModRtuMastBase
Data
DWORD
0
Address of local buffer for data to be sent or received
ModRtuMastBase
Output
ErrorID
ERROR_ID.NO_ERROR
Code of error occured during executionNO_ERROR Execution successfully completedERR_INIT Modbus RTU not properly initialized / out of memoryERR_NOT_CONFIGURED Modbus RTU not configuredERR_FCT_NOT_SUPPORTED Function code not supportedERR_ENDIANESS_NOT_SUPPORTED Endianess / byte order not supportedERR_ILLEGAL_REGISTER_ADDRESS Illegal register addressERR_INVALID_ACCESS Invalid address of local storage of data to read/write, inputs DATA / NBERR_INTERNAL_ILLEGAL_ARGUMENT Stack reports illegal argument (internal error)ERR_INVALID_SERVER_ADDRESS Invalid server address, must be 1..247 (read) or 0,1..247 (write)ERR_DATA_SIZE Number of data to read/write exceeds capabilitiesERR_INVALID_INTERFACE Invalid COM portERR_INTERNAL_PORTING Porting layer error. Operating system signaled errorERR_INTERNAL_INVALID_HANDLE Illegal argument, unknown instance ‘pHandle’. Internal errorERR_UNEXPECTED_RESULT Unexpected result reported by stackERR_TIMEOUT Timeout expired. Server did not respond within specified timeERR_EXCEPT_01_ILLEGAL_FUNCTION Illegal function exception. Exception response by Server containing error code 01 / 16#01ERR_EXCEPT_02_ILLEGAL_DATA_ADDRESS Illegal data address. Exception response by Server containing error code 02 / 16#02ERR_EXCEPT_03_ILLEGAL_DATA_VALUE Illegal data value. Exception response by Server containing error code 03 / 16#03ERR_EXCEPT_04_SERVER_DEVICE_FAILURE Server device failure. Exception response by Server containing error code 04 / 16#04ERR_EXCEPT_05_SERVER_ACKNOWLEDGE Server acknowledge. Exception response by Server containing error code 05 / 16#05ERR_EXCEPT_06_SERVER_DEVICE_BUSY Server device busy. Exception response by Server containing error code 06 / 16#06ERR_EXCEPT_07_SERVER_NO_ACKNOWLEDGE Server no acknowledge. Exception response by Server containing error code 07 / 16#07ERR_EXCEPT_08_MEMORY_PARITY_ERROR Memory parity error. Exception response by Server containing error code 08 / 16#08ERR_EXCEPT_09_SERVER_PASSIVE Probably passive Server. Exception response by Server containing error code 09 / 16#09ERR_EXCEPT_0A_GATEWAY_PATH_UNAVAILABLE Gateway path unavailable. Exception response by Server containing error code 10 / 16#0AERR_EXCEPT_0B_GATEWAY_TARGET_DEVICE Gateway target device failed to respond. Exception response by Server containing error code 11 / 16#0BERR_INTERNAL_INVALID_STATE Invalid state, fatal internal errorERR_NO_MEMORY Not enough memoryBUSY Busy, call againERR_INTERNAL_IO Internal error in I/O layerERR_INTERNAL_ILLEGAL_STATE Protocol stack in illegal state. Fatal internal errorERR_INTERNAL_IO_RETRY Retry I/O operation. Operation not yet completed, function to be called againERR_INTERNAL_UNEXPECTED_STATE Unexpected state. Fatal internal errorERR_UNKNOWN Undefined errorModRtuMastBase
Input
Com
BYTE
1
Number of the assigned serial interface, 1..