IoDrvModbusTCPSlave Library Documentation ¶ Company 3S - Smart Software Solutions GmbH Title IoDrvModbusTCPSlave Version 4.3.0.0 Categories Intern|IoDrivers Namespace IoDrvModbusTCPSlaveLibrary Author 3S - Smart Software Solutions GmbH Placeholder IoDrvModbusTCPSlave Description 1 ¶ ModbusTCP Slave IO-driver written in IEC. Contents: ¶ DeviceStatusT (Struct) IoDrvModbusTCPSlave (FunctionBlock) Enable (Property) UpdateCommunicationSettings (Method) Library Information GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function) ModbusTCPDeviceDiag (FunctionBlock) UpdateCommunicationSettings (Method) Indices and tables ¶ 1 Based on IoDrvModbusTCPSlave.library, last modified 16.05.2023, 15:44:12. LibDoc 4.4.0.0-b.27 The content file IoDrvModbusTCPSlave.clean.json was generated with CODESYS V3.5 SP16 Patch 3 on 16.05.2023, 15:44:12.
IoDrvModbusTCPSlave (FB) ¶ FUNCTION_BLOCK IoDrvModbusTCPSlave EXTENDS IoDrvBase IMPLEMENTS ICmpIoDrvParameter This function block is generated for each Modbus TCP slave device in the device tree. InOut: Scope Name Type Initial Comment Input xEnable BOOL TRUE TRUE : start operation, open sockets Output xOnline BOOL TCP Port opened, ready for receiving request. xInternalError BOOL FALSE Unrecoverable internal error (e.g. if mem-alloc fails or no license) ErrorCode UDINT error code Port UINT Port Number uiClientConnections UINT number of currently established client connections (TCP/IP) xTimeout BOOL Timeout (if configured) expired. Holding Registers and Coils are set to zero. Properties: Enable Methods: UpdateCommunicationSettings Structure: Enable (Property) UpdateCommunicationSettings (Method)
DeviceStatusT (STRUCT) ¶ TYPE DeviceStatusT : STRUCT
IoDrvModbusTCPSlave.Enable (PROP) ¶ PROPERTY Enable : BOOL
IoDrvModbusTCPSlave.UpdateCommunicationSettings (METH) ¶ METHOD UpdateCommunicationSettings : DINT Change the TCP-Port number. Existing TCP Connection will be aborted InOut: Scope Name Type Initial Comment Return UpdateCommunicationSettings DINT Input uiPortNr UINT 502 TCP-Port Number used by Modbus Server
Library Information ¶ GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function)
GetLibVersion (FUN) ¶ FUNCTION GetLibVersion : VERSION This function has been automatically generated from the project information. InOut: Scope Name Type Return GetLibVersion VERSION
GetLibVersionNumber (FUN) ¶ FUNCTION GetLibVersionNumber : DWORD This function has been automatically generated from the project information. InOut: Scope Name Type Return GetLibVersionNumber DWORD
ClientRequestReadWriteMultipleRegistersWide (FB) ¶ FUNCTION_BLOCK ClientRequestReadWriteMultipleRegistersWide EXTENDS ModbusFB.ClientRequest ReadWriteMultipleRegister client request (FC23) for registers > 16bit. For details about client request see |ClientRequest| . For details about “wide registers” and endianess see ServerTCP_extended or ServerSerial_extended . Please note: The write operation is performed before the read. Please visit https://forge.codesys.com/prj/codesys-example/modbus/home to find examples. InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Starts defined operation FALSE : Resets the defined operation after ready condition was reached ETrigTo udiTimeOut UDINT Max. operating time for executing [µs], 0: No operating time limit ETrigTo Output xDone BOOL Ready condition reached ETrigTo xBusy BOOL Operation is running ETrigTo xError BOOL Error condition reached ETrigTo Inout rClient Client Reference to |Client| . ClientRequest Input uiUnitId UINT 0 Unit-Id to send the request to. ClientRequest udiReplyTimeout UDINT (50 * 1000) 50 ms ClientRequest uiMaxRetries UINT 0 Maximum number of request retries in case of “reply timeout”. ClientRequest Output eErrorID Error Error status ClientRequest eException ExceptionCodes Request exception code. ClientRequest uiRetryCnt UINT 0 Number of request retries in case of “reply timeout”. ClientRequest Input uiWriteStartItem UINT 0 First “data item” to write. uiWriteQuantity UINT 1 Number of “data items” to write. pWriteData POINTER TO BYTE 0 Pointer to write data. uiWriteDataItemSize UINT write “data item” size / register width (in bytes). The ClientRequest has to know about the “data item” size a-priori to provide memory for result data. In case the server unexpectedly does have a different “data item” size than assumed, the ClientRequest can not succeed. uiReadStartItem UINT 0 First “data item” to read. uiReadQuantity UINT 1 Number of “data items” to read. pReadData POINTER TO BYTE 0 Pointer to read data. uiReadDataItemSize UINT read “data item” size / register width (in bytes).
ClientRequestWriteMultipleRegistersWide (FB) ¶ FUNCTION_BLOCK ClientRequestWriteMultipleRegistersWide EXTENDS ModbusFB.ClientRequestWriteMultiple WriteMultipleRegisters client request (FC16) for registers > 16bit. For details about client request see |ClientRequest| . For details about “wide registers” and endianess see ServerTCP_extended or ServerSerial_extended . Please visit https://forge.codesys.com/prj/codesys-example/modbus/home to find examples. InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Starts defined operation FALSE : Resets the defined operation after ready condition was reached ETrigTo udiTimeOut UDINT Max. operating time for executing [µs], 0: No operating time limit ETrigTo Output xDone BOOL Ready condition reached ETrigTo xBusy BOOL Operation is running ETrigTo xError BOOL Error condition reached ETrigTo Inout rClient Client Reference to |Client| . ClientRequest Input uiUnitId UINT 0 Unit-Id to send the request to. ClientRequest udiReplyTimeout UDINT (50 * 1000) 50 ms ClientRequest uiMaxRetries UINT 0 Maximum number of request retries in case of “reply timeout”. ClientRequest Output eErrorID Error Error status ClientRequest eException ExceptionCodes Request exception code. ClientRequest uiRetryCnt UINT 0 Number of request retries in case of “reply timeout”. ClientRequest Input uiStartItem UINT 0 First “data item” to write. ClientRequestWriteMultiple uiQuantity UINT 1 Number of “data items” to write. ClientRequestWriteMultiple pData POINTER TO UINT 0 Pointer to data. uiDataItemSize UINT “data item” size / register width (in bytes).