LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview find ethernet device address for TCP/IP VISA communication

Hi,
is there a way to find out the address of a certain device in an Ethernet network using LabVIEW 7? What I want to do is to communicate with a device via TCP/IP using LabVIEWs VISA functions. This works great, but I have to know the device address and port number. If the device gets its address via DHCP, it would be very helpful to find out the device address using some kind of broadcast function. I know that the device sends a special answer on a *IDN? query. So, sending a "*IDN?" query over the network and getting back only those host names/addresses which return this special answer is what I would like to do. Does somebody know how to implement this in LabVIEW?
GabsSmiley Indifferent
0 Kudos
Message 1 of 39
(6,945 Views)
Hi,

are you able to send the *IDN? query from the command prompt?
Then you are able to use the "System Exec.vi"

Rainer
0 Kudos
Message 2 of 39
(6,894 Views)
Can you not assign a host name to the instrument? Then you don't care about the actual IP.
0 Kudos
Message 3 of 39
(6,894 Views)

Rainer,

I have read about the system exec.vi but I have no idea what it is and where to find it. I can send the ASCII command *IDN? over a normal terminal if the termination character is set to LineFeed, but I don't think this will work with the Win Command Line? Can you explain a little further how that would work and where I find this VI?

Dennis,

this is a good idea but it does not work for us, because when we deliver the controller it is not configured to have its own host name (all controller have the same firmware).

Thanks to both of you,

Best regards,

Gabs

0 Kudos
Message 4 of 39
(6,878 Views)
Hi Gabs,

you can find this vi here:
-> functions -> communication -> System Exec.vi

you can use this vi like the dos command prompt. (read the help! you have to add "command.com /c" before your command, if it's a DOS command.)

if you've got a terminal program, that you can start with your query from command line, you can start it this way.
You should get the result in the "standard output".

Regards,

Rainer
0 Kudos
Message 5 of 39
(6,871 Views)

Rainer,

I don't think the system exec will do any good. His problem is that he has a instrument with an unknow IP address. The *IDN? command is sent with a VISA Write and the VISA Resource Name requires either an IP address or host name. If there was a dos command that would list all available IP's, the system exec could be used for that but I don't think there is such a command.

Gabs,

Will the instrument at least be on the same subnet as the computer you want to run the program on? That would at least narrow it down. If it's not and you're going through some gateway, I don't know of any reasonable solution.

Message 6 of 39
(6,865 Views)
dennis,

i understand, but as far as i understood, Gabs is able to reach his device using a terminal program and receive the ip adress as result. Why shouldn't he use the "System Exec.vi" to do this?
then when he has the IP he can use VISA to connect to the device.

Regards,

Rainer

P.S.: I hope i can learn something 😉
0 Kudos
Message 7 of 39
(6,859 Views)
Dennis,
you are right. That is the problem Smiley Sad Yes, the device is on the same subnet. In C++, a colleague implemented an algorithm which opens a socket, makes a broadcast over UDP using 255.255.255.255 at the same port that our controller is bound to, looking at the answers returned and determining that way our instruments. But I have no idea how to implement something like that in LabVIEW....
Gabs (who is a "she" not "he" Smiley Wink)
0 Kudos
Message 8 of 39
(6,858 Views)

Rainer,

no, I am only able to reach to device with a terminal program when I already now the IP address - which I do not know. So it looks like System Exec.vi is not the solution Smiley Sad

Gabs
0 Kudos
Message 9 of 39
(6,856 Views)
oops, her device of course 🙂
0 Kudos
Message 10 of 39
(6,854 Views)