MB_MasterParameter (STRUCT) ¶ TYPE MB_MasterParameter : STRUCT InOut: Name Type Initial Comment usiTransmission USINT RTU:=0, ASCII:=1 tResponseTimeout TIME Time, in which a Slave has to reply (max 65535ms) tTimeBetweenFrames TIME Delay between Modbus requests (max 65535ms) dwSerialLineNumber DWORD 0 Either 1 or 2
MB_SlaveParameter (STRUCT) ¶ TYPE MB_SlaveParameter : STRUCT InOut: Name Type Initial Comment usiSlaveAddress USINT 1 Slave address in the range between 1 and 247 tSlaveTimeout TIME TIME#1s0ms Time for this Slave to respond. Overrides the Master’s setting, (max 65535ms) dwInstance POINTER TO ModbusSerialSlaveBase Stores the instance pointer to this Slave iErrorCounter INT -1 Stores the number of subsequent errors. If Slave never got polled, it is -1
ModbusSerialSlaveBase (FB) ¶ FUNCTION_BLOCK ModbusSerialSlaveBase EXTENDS ModbusSlaveBase InOut: Scope Name Type Initial Comment Input xTrigger BOOL FALSE Triggers sending all configured Modbus channels on a rising edge xReset BOOL FALSE Restarts communication and resets “xError” and “byModbusError”. xAcknowledge BOOL FALSE Restarts communication but does not reset “xError” or “byModbusError” xDoInit BOOL TRUE If true then xReset also sends all reset init commands, false (old behaviour) Output xInitDone BOOL FALSE All init commands have been processed xBusy BOOL FALSE Is TRUE as long as a request is in progress xDone BOOL FALSE Is TRUE if a request finished successfully xError BOOL FALSE Is TRUE if any error occurred. Communication to this Slave is suspended. Properties: xOldTrigger xReqError Methods: GetNextInitValue Structure: GetNextInitValue (Method) xOldTrigger (Property) xReqError (Property)
ModbusSerialSlaveBase.GetNextInitValue (METH) ¶ METHOD GetNextInitValue : INT InOut: Scope Name Type Return GetNextInitValue INT Inout initValue MB_SlaveInitValue
ModbusSerialSlaveBase.xOldTrigger (PROP) ¶ PROPERTY xOldTrigger : BOOL {attribute ‘hide’}
ModbusSerialSlaveBase.xReqError (PROP) ¶ PROPERTY xReqError : BOOL {attribute ‘hide’}
MB_CommCode_M238 (ENUM) ¶ TYPE MB_CommCode_M238 : InOut: Name Initial Comment CommunicationOK 16#0 Exchange is correct TimedOut 16#1 Exchange stopped because timeout expired Canceled 16#2 Exchange stopped on user request (CANCEL) BadAddress 16#3 Address format is incorrect BadRemoteAddr 16#4 Remote address is incorrect BadMgtTable 16#5 Management table format is incorrect BadParameters 16#6 Specific parameters are incorrect ProblemSendingRq 16#7 Problem sending request to destination RecvBufferTooSmall 16#9 Reception buffer size is too small SendBufferTooSmall 16#A Transmission buffer size is too small SystemResourceMissing 16#B System resource is missing BadTransactionNb 16#C Transaction number is incorrect BadLength 16#E Length is incorrect ProtocolSpecificError 16#FE The operation error code contains protocol specific code Refused 16#FF Message has been refused
MB_OpCode_M238 (ENUM) ¶ TYPE MB_OpCode_M238 : InOut: Name Initial Comment OperationOK 16#0 Exchange is correct NotProcessed 16#1 Request has not been processed BadResponse 16#2 Received response is incorrect TargetResourceMissing 16#1 Target system resource is missing BadLength 16#5 Length is incorrect CommChannelErr 16#6 Communication channel is in error BadAddr 16#7 Address is incorrect SystemResourceMissing 16#B System resource is missing TargetCommInactive 16#C Target comm function is not active TargetMissing 16#D Target is absent ChannelNotConfigured 16#F Channel not configured
ModbusCommand (STRUCT) ¶ TYPE ModbusCommand : STRUCT InOut: Name Type Initial uiFunctionCode UINT 3 uiReadOffset UINT 0 uiReadLen UINT 1 uiWriteOffset UINT 0 uiWriteLen UINT 1
PARAM_ACCESS (ENUM) ¶ TYPE PARAM_ACCESS : InOut: Name READWRITE READ WRITE