Example

Example
MODBUS interface of the client COM1
Client writes to Server 1
Data

sData : COM_MOD_FCT23_TYPE

sData.pByDataWrite := ADR(awWriteWord)

sData.pByDataRead := ADR(awReadWord)

sData.wDataAddressRead := 4193

sData.wNumDataUnitsRead := 5

awWriteWord[0] := 1

awWriteWord[1] := 2

awWriteWord[2] := 3

Source address at client awWriteWord : ARRAY[0..2] OF WORD
Target address at client awReadWord : ARRAY[0..4] OF WORD
Target address at server %MW0.8193 : 2001HEX = 8193DEC
Source address at server %MW0.4193 : 1001HEX = 4193DEC
The values of the WORD variables awWriteWord[0]..awWriteWord[2] on the client are written to %MW0.8193..%MW0.8195 on the server, the values read from server’s . %MW0.4193..%MW0.4195 are written to the client’s variables awReadWord[0]..awReadWord[4]
Parameterization of the COM_MOD_MAST Function Block inputs
EN COM SLAVE FCT TIMEOUT ADDR Number of words DATA
FALSE -> TRUE 1 1 17 Applicationspecific 8193 3 ADR (sData)