FB_GetHostName
This functionality is supported only under Windows CE!
This function block reads the local host name of the TwinCAT computer.
VAR_INPUT
VAR_INPUT
sNetID : T_AmsNetId;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
sNetID: Here a string containing the TwinCAT network address of the TwinCAT computer can be given, whose local host name should be read. The string can also be empty for the local computer.
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 command.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrID : UDINT;
sHostName : T_MaxString;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until and acknowledgement 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.
nErrID: When the bError output is set, this variable supplies the ADS error code.
sHostName: Local host name as string.
Requirements
Development environment | Target system type | PLC libraries to include |
---|---|---|
TwinCAT v2.10.0 Build > 1307 | PC or CX (x86) | TcUtilities.Lib |