Topic: DMD0344 DNSLOOKUP - Name to IP Address |
|
The Name to IP Address (DNSLOOKUP) instruction is used to find the IP Address assigned to the named device using the Domain Name System protocol (DNS). This instruction uses the on-board Ethernet port and requires that the TCP/IP network be setup so the CPU has a functional connection to a DNS Server.
The Name needs to consist only of the server name, not a fully qualified URL. For example, the Name field should contain only the text "mail.google.com", not "https://mail.google.com". The timeout value (including retries) for the DNS Lookup operation is fixed in the DNS client at 126 seconds.
If the DNS Lookup operation is successful, the IP address will be stored in a DWord location. Use the "IP Address" format in a Data View to see the returned IP Address in the traditional dot-decimal notation (000.000.000.000).
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Device - selects which of the Ethernet Devices to use, currently this instruction can only use @IntEthernet which is the on-board Ethernet port on the Do-more CPU. If the only entry in the list is no devices available this indicates that there are no Devices that can execute this instruction, most likely cause is the CPU does not have an on-board Ethernet port.
Preferred DNS Server - the TCP/IP Address of the first DNS server to contact for resolving the Name to an IP Address. The default value is 8.8.8.8 (decimal 34744072) which is Google's public DNS Server.
Click the Get PC's DNS Server Settings button to retrieve the Preferred DNS Server and the Alternate DNS Server IP Addresses from the network configuration of the PC running Do-more Designer and use those IP Addresses in this instruction.
Alternate
DNS Server - the TCP/IP Address of an alternate DNS server to contact
if the preferred DNS server cannot resolve the Name to an IP Address.
The default value is the Secondary DNS Server IP address from the network
setup on the computer that is running Do-more Designer.
Name - specifies the name to resolve to an IP Address. This can be a string literal (text within double quotes), or any system-defined Short Strings, or system-defined Long Strings, or user-defined Strings. The Name is not a fully qualified URL like "https://mail.google.com"; use only the "mail.google.com" portion of the URL.
IP Address Result - designates a location to store the IP Address if a DNS server can successfully resolve the Name. This can be any writable numeric location.
The On Success and On Error parameters specify what action to perform when this instruction completes. You do not have to use the same type of selection for both On Success and On Error.
If the Set Bit selection is used for either On Success or On Error, the specified BIT location will be SET OFF when the instruction is first enabled and will remain OFF until the instruction completes. Once complete, the appropriate Success or Error bit location ON. The specified Bit location is enabled with a SET (Latch) operation meaning that it will remain ON even if the input logic for the instruction goes OFF.
If the JMP to Stage selection is used for either On Success or On Error the target Stage must be in the same Program code-block as this instruction, you cannot specify a target Stage that exists in a different Program code-block. When the operation finishes, the target Stage will be enabled the same way as a standalone Jump to Stage (JMP) instruction would do it. The JMP to Stage option will only be available if this instruction is placed in a Program code-block.
On Success selects which of the following actions to perform if the operation is successful:
On Error selects which of
the following actions to perform if the operation is unsuccessful:
If either the On Success or On Error selections are set to JMP to Stage, Automatically create the SG box for any NEW stage number will be enabled which will automatically create any target stage that does not already exist.
|
|
Status Display:
The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.
The gray triangle at the right end of the input leg indicates the input is edge-triggered, meaning this instruction will execute each time the input logic transitions from OFF to ON.
|
|
See Also:DNSLOOKUP - Name to IP Address
|
|
Related Topics
|
|
Example Using Stages:
|
|
Rung Example:
|