Function blocks
TX1200
11
Version: 1.0
iMyPortNo
: the port number associated with the connection is passed here as a parameter. The port
number is generated afresh (dynamically) each time the connection is established with the
function block.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iErrorId : WORD;
END_VAR
bBusy
: if the function block is activated, this output is set. It remains set until a feedback is received.
bError
: if an error should occur during the execution of the command, then this output is set, after the bBusy
output has been reset.
iErrorId
: supplies the command-specific error code (table) or the
bError output is set.
Error Codes
Description
0x8400
Connection is already closed.
0x8401
Connection close timeout.
0x8402
Connection close resource error.
Sample of calling the function block in FBD:
PROGRAM MAIN
VAR
fbModbusClose : FB_ModbusTcpClose;
bOpen : BOOL;
bBusy : BOOL;
bError : BOOL;
nErrId : WORD;
nConnectionPort: WORD;
END_VAR
In this sample, a rising edge at the
bClose
input causes a TCP/IP connection to the remote partner with
network address '172.16.2.209' to be closed.
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: ......