10-02-2018 03:25 PM - edited 10-02-2018 03:37 PM
I have a network device configured in NI-MAX. I manually added the network device using "manual entry of raw socket". I then gave my device a name (i.e. "Device1"). Device1 is shown in NI-MAX as "TCPIP0::192.168.100.10::1234:: SOCKET "Device1""
In LabVIEW when I open a TCP connection I don't want to pass it "192.168.100.10" as the IP address directly. I wanted to know if I can lookup the IP address based off the name "Device1" I gave so the IP address does not get hard coded in my LabVIEW code?
Thanks.
10-02-2018 05:21 PM
The name you've set in NI-MAX is a VISA connection alias, not a TCP connection. The direct TCP communications functions can't use it. The VISA read/write functions can, though. I have found that using VISA over a raw socket manual entry sends extra control characters that some devices don't parse, so it's not always an option.
"Not hardcoding" doesn't always mean "Using NI-MAX", you could also store the connection in an INI file, or look up the hostname instead of the IP (assuming it has a hostname, otherwise you'll have to set it using your hosts file in C:\Windows\System32\drivers\etc).
10-03-2018 02:22 AM
@Guy04 wrote:
I have a network device configured in NI-MAX. I manually added the network device using "manual entry of raw socket". I then gave my device a name (i.e. "Device1"). Device1 is shown in NI-MAX as "TCPIP0::192.168.100.10::1234:: SOCKET "Device1""
In LabVIEW when I open a TCP connection I don't want to pass it "192.168.100.10" as the IP address directly. I wanted to know if I can lookup the IP address based off the name "Device1" I gave so the IP address does not get hard coded in my LabVIEW code?
Thanks.
Install NI VISA driver from here http://www.ni.com/download/ni-visa-17.0/6646/en/, after that you'ld have this *?INSTR command in find resource as a input, it'll display all connected devices where you've connected in pc.