FB_GetHostByAddr

FB_GetHostByAddr 1:

This function block can determine the host name associated with a specified IP address.

INPUT

VAR_INPUT
   bStart        : BOOL;
   sIPAddr       : STRING(15);
   pHostName     : DWORD;
   cbMaxNameLen  : WORD;
END_VAR

bStart: the function block is activated by a rising edge at this input.

sIPAddr: a string containing the IP address of the host.

pHostName: contains the address of a string buffer into which the host name that has been found is written. It is the programmer who is responsible for dimensioning the buffer appropriately so that cbMaxNameLen bytes can be removed from it. The address can be determined with the ADR operator.

cbMaxNameLen: contains the length, in bytes, of the buffer into which the host name that has been found is to be written.

OUTPUT

VAR_OUTPUT
   bBusy     : BOOL;
   bError    : BOOL;
   iErrorId  : WORD;
END_VAR

bBusy: this output remains TRUE until the command execution is complete.

bError: this output is switched to TRUE if 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).

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v2.7.0 and above

BC9xxx (165) firmware version >=0xB6

TcIPUtilitiesBC.Lb6