FB_GetAxisAmsAddr
This block is needed to read the ADS address (NetId and Port) of the IO hardware linked with the axis.
VAR_INPUT
VAR_INPUT
sNetId : T_AmsNetId;
iAxisId : UINT;
bExecute : BOOL;
tTimeout : TIME;
END_VAR
sNetid : : It is possible here to provide the AmsNetId of the TwinCAT computer on which the address information of the axis is to be read. If it is to be run on the local computer, an empty string can be entered.
iAxisId: Axis ID.
bExecute: The command is triggered by a rising edge at this input.
tTimeout: ADS Timeout-Delay
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iErrId : UDINT;
AxisNetId : T_AmsNetId;
AxisPort : T_AmsPort;
AxisNetIdBytes : ARRAY[0..5] OF BYTE;
AxisChannel : BYTE;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until and acknowledgement is received.
bError: If an ADS error should occur during the execution of the command, then this output is set.
iErrId: Supplies the error number when the bError output is set.
AxisNetId: ADS NetId of the NC axis hardware.
AxisPort: ADS port number of the NC axis hardware.
AxisNetIdBytes: ADS-NetId as byte array.
AxisChannel: Chanel number of the NC axis hardware (multi channel devices)
Requirements
Development environment | Target System | PLC Libraries to include |
---|---|---|
TwinCAT v2.8 Build > 746 TwinCAT v2.9 Build > 947 | PC (i386) | TcNc.Lib |