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. 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; (* Additional options (reserved) *)
bExecute : BOOL; (* Rising edge at this input starts command execution *)
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;(* Maximum time allowed for the execution of the command *)
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:
See examples.
Requirements
Development environment | Target platform | PLC libraries to be linked |
---|---|---|
TwinCAT v2.11.0 Build > 1536 | PC or CX (x86, ARM) | TcS5S7Comm.Lib |