Function blocks
TX1200
13
Version: 1.0
iErrorId
: supplies the command-specific error code (table) or the
bError output is set.
cbResponse
: the byte length of the response data actually returned in the response buffer.
Error Codes
Description
0x8300
Tx error. Timeout error.
0x8301
Tx error. Remote shutdown.
0x8302
Tx error. Internal error.
0x8303
Tx error. Resource error.
0x8305
Tx error. No remote connection.
0x8100
Rx error. Wrong transaction ID.
0x8101
Rx error. Wrong protocol ID.
0x8102
Rx error. Wrong length.
0x8103
Rx error. Exceeding length.
0x8104
Rx error. Wrong unit ID.
Sample of calling the function block in FBD:
PROGRAM MAIN
VAR
fbModbusRequest : FB_ModbusTcpRequest;
bExecute : BOOL;
bExecute : nConnectionPort;
SendBuffer : ARRAY[0..5] OF BYTE := 1,6,64,64,0,0;
ReceiveBuffer : ARRAY[0..255] OF BYTE;
bBusy : BOOL;
bError : BOOL;
nErrId : WORD;
cbReceived : WORD;
END_VAR
In this sample, a rising edge at the
bExecute
input causes a request to be sent to the remote partner with
network address '172.16.2.209'.
Requirements
Development environment
Target platform
PLC libraries to include
TwinCAT v2.7.0 and below
BC9xxx (165) firmware version >=
0xB6
TcModbusTCPBC.Lb6
Содержание TX1200
Страница 1: ...Manual EN TX1200 TwinCAT 2 PLC Library TcModbusTCPBC 2022 05 02 Version 1 0...
Страница 2: ......
Страница 4: ...Table of contents TX1200 4 Version 1 0...
Страница 15: ......