Waits until the system can contact the remote host.


icon

Inputs/Outputs

  • cstr.png hostname or URL in

    hostname or URL in specifies the remote host to contact. You can specify an IPv4 address, domain name, or URL that contains an IPv4 address or domain name.

  • ci32.png timeout in ms

    timeout in ms specifies the time, in milliseconds, that this VI waits to get a response from the remote host. The actual time to wait may be 1-2 seconds more or less than timeout in ms. If timeout in ms is -1, this VI chooses a value appropriate for the networking environment. If timeout in ms is 0, this VI queries the status for the remote host but does not wait to get a response if the remote host is unreachable. The default is -1.

    Refer to the Details section for more information about how this VI waits.

  • cbool.png must be directly reachable? (F)

    must be directly reachable? specifies whether this VI waits until the remote host is directly accessible on a local network, without the use of a network gateway. For instance, if you connect an IPv4-accessible device directly to the computer over Ethernet or USB, set must be directly reachable? to TRUE to ensure that this VI waits until the device is online. The default is FALSE.

    This VI ignores the value of must be directly reachable? under the following circumstances:

    • If hostname or URL in is a link-local or multicast address, this VI always waits until the remote host is directly reachable.
    • If hostname or URL in is unwired, the remote host is never directly reachable.
  • istr.png hostname or URL out

    hostname or URL out returns the name or URL of the remote host.

  • ienum.png network status for remote host

    network status for remote host returns the current status of the network to contact the remote host.

    0Indeterminate—This VI does not have enough information to determine the network status, whether due to invalid inputs or internal errors.
    1Configured—Network configuration can contact the remote host.
    2Unconfigured—Network configuration does not support connecting to the remote host.
  • The Wait for Configured Network VI may use heuristics to identify whether or not the system is sufficiently configured to contact the remote host. If these heuristics fail, the VI may wait the duration of timeout in ms or return immediately. To avoid incorrectly waiting, do not specify an excessively large timeout in ms value.

    Use the Wait for Configured Network VI before contacting a remote host when all of the following conditions apply:

    • Your application requires a TCP/IP network connection, which may not yet be configured typically due to system startup.
    • Your application has no other preferred mitigation process for connection failures. For example, if the application is interactive, using this VI may be inappropriate, because the timeout may delay user feedback, particularly if the remote host may be mistyped or otherwise incorrect. In this situation, you may want to report the connection failure immediately and allow the user to choose to retry the connection.
    • The connection attempt is not time-sensitive. This VI may take several hundred milliseconds to execute, even when not waiting. If you are making several connection attempts in sequence, only call this VI once, for the first connection.
    • (NI Linux Real-Time) Time-critical performance is not considered critical while this VI runs. On NI Linux Real-Time targets, this VI may perform system operations that affect determinism, even if the operations run at a lower priority. Consider running this VI before starting time-critical loops, or while time-critical performance is not a high priority during system startup.

    The Wait for Configured Network VI achieves the same result that retrying a connection request in a For Loop achieves, in addition to the following advantages:

    • This VI only queries the operating system and requires no network traffic.
    • You do not need to distinguish between network-failure errors and other errors inside the For Loop.
    • In a For Loop, you must choose the duration of the connection attempts by estimating system conditions that may evolve over time and across deployment to different targets. By default, the Wait for Configured Network VI sets a timeout considered appropriate for the vast majority of LabVIEW application deployments.