FB_GetHostByName
This function block can determine the IP address associated with a specified host name.
INPUT
VAR_INPUT
bStart : BOOL;
pHostName : DWORD;
END_VAR
bStart: The function block is activated by a rising edge at this input.
pHostName: Contains the address of a string variable with the host name. The address of a string variable can be determined with the ADR operator.
OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iErrorId : WORD;
sIPAddr : STRING(15);
END_VAR
bBusy: This output remains TRUE until execution of the command is complete.
bError: This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in iErrorId.
iErrorId: Contains the command-specific error code of the most recently executed command (see table).
sIPAddr: When successful, this variable contains the IP address of the host.
Development environment | Target platform | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10.0 and above | BX9000 (165) firmware version ≥1.12 BC9191 firmware version ≥3.1 | TcBaseBX9000.lbx |