FB_NLinkClose
This function block closes the network connection to the third-party system.
VAR_IN_OUT
VAR_IN_OUT
hLink : T_HNLINK;
END_VAR
hLink : Network connection handle ( Type:T_HNLINK). This is where the instance of the variable used for establishing the connection by the FB_NLinkOpen function block is transferred.
VAR_INPUT
VAR_INPUT
nOpt : DWORD := 0;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
nOpt: Reserved for future applications.
bExecute: The block is activated by a rising edge at this input.
tTimeout: Specifies the timeout that must not be exceeded on receipt of the command.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrID : UDINT;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until a feedback is received. While Busy = TRUE, no new command will be accepted at the inputs. Please note that it is not the command execution but the receipt of the command that is monitored.
bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.
nErrID: Supplies the error number when the bError output is set.
Example:
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.1.4016 or higher | PC oder CX (x86, x64, ARM) | Tc2_S5S7Com (Communication->TcpIp) |