Get TCP Listen and/or TCP Wait on Listener VI's to return an IP address

Updated Dec 22, 2017

Reported In

Software

  • LabVIEW Full
  • LabVIEW Professional

Issue Details

How do I get TCP VI's to return an IP address instead of a machine name to the remote address output of TCP Listen.vi and/or the TCP Wait on Listener function?

Solution

LabVIEW 8.2 and Later
  • The TCP Wait on Listener function and the TCP Listen.vi (located on the block diagram in the functions palette at All Functions » Data Communication » Protocols » TCP) both have an input called resolve remote address. When this input is set to true, it causes the function to return the machine name in the remote address output. When the resolve remote address input is set to false, the function will return the IP address.
Earlier Versions of LabVIEW
To have TCP Listen.vi always return an IP address to its remote address output do the following:
  1. Drop TCP Listen.vi on the block diagram of a blank VI.
  2. Double click the TCP Listen.vi icon now on the block diagram to open its front panel.
  3. Open TCP Listen.vi's block diagram (use the menu Window » Show Block Diagram).
  4. On the TCP Listen.vi's block diagram drop a constant boolean false and wire it into the resolve remote address input of the TCP Wait on Listener function
  5. Save TCP Listen.vi (select File » Save).
To have programmatic control over whether the IP address or machine name is returned to the remote address output of TCP Listen.vi do the following:
  1. Drop TCP Listen.vi on the block diagram of a blank VI.
  2. Double click the TCP Listen.vi icon now on the block diagram to open its front panel.
  3. Open TCP Listen.vi's block diagram (use the menu Window » Show Block Diagram).
  4. Place a boolean control on the front panel of TCP Listen.vi.
  5. On the TCP Listen.vi's block diagram wire the boolean control icon corresponding to control created in step 4 above into the TCP Wait on Listener function's resolve remote address input.
  6. Switch back to the front panel of TCP Listen.vi.
  7. Right click on the icon in the upper right corner of the block diagram and select Show Connector.
  8. With the wiring tool, left click on an open (white) input terminal in the connector which has now replaced the icon in the front panel's upper right corner; it will now become colored.
  9. Without clicking anywhere, move the mouse directly over the boolean control you created in step 4 on the front panel.
  10. Now left click (while the mouse is directly over the boolean control as specified in the previous step); you have now associated the terminal you selected in step 8 with the boolean control you created in step 4.
  11. Move to hover your mouse over the connector in the upper right corner of the front panel, right click, and select Show Icon.
  12. Save TCP Listen.vi (select File » Save).

Additional Information


Earlier Versions of LabVIEW​
  • The TCP Wait on Listener function (located on the block diagram in the functions palette at All Functions » Communication »  TCP) has an input called resolve remote address. When this input is set to true, it causes the function to return the machine name in the remote address output. When the resolve remote address input is set to false, the function will return the IP address.
  • TCP Listen.vi (located on the block diagram in the functions palette at All Functions »  Communication »  TCP) uses the TCP Wait on Listener function (open the TCP Listen.vi block diagram to see this), however, it uses the default value of true for the resolve remote address input. More specifically, TCP Listen.vi does not include an input terminal for the resolve remote address input by default.

WAS THIS ARTICLE HELPFUL?

Not Helpful