FB_AddRouteEntryEx
The function block can be used to add a new AMS router connection (remote route) to a TwinCAT system.
The function block supports the AmsNAT functionality with the virtual AmsNetId. This enables creation of routes to two or more controllers that have the same AmsNetId.
AMS router connection list Both communication partners of an AMS router connection have an AMS router connection list. These lists contain AMS router connections. An AMS router connection is functional when both communication partners have entered each other in their respective connection list. |
VAR_INPUT
VAR_INPUT
sNetID : T_AmsNetID;
stRoute : ST_AmsRouteEntryEx;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
sNetID: Here you can specify a string with the network address of the TwinCAT computer on which a new connection is to be added to the AMS router connection list (type: T_AmsNetID). If it is to be run on the local computer, an empty string can be entered.
stRoute: Structural element with parameters for the new connection (type: ST_AmsRouteEntryEx).
bExecute: The function block is activated by a positive edge at this input.
tTimeout: States the length of the timeout that may not be exceeded by execution of the ADS 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.
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 ADS error number when the bError output is set.
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.4024 | PC or CX (x86, x64, ARM) | Tc2_Utilities (system) |