10-14-2017 06:41 AM
Hi Everyone,
I have a problem. I wrote a program that reads sensor values from a device. The device has ethernet port. So I created VISA TCP/IP resource to communicate in NI MAX.
So far, there is no problem. I can get sensor values from device with my LabVIEW program.
But when I try the same procedure on another computer, my VISA Read function gives me timeout error. I tried to query in NI MAX, also there gives me the same error.
I will share a part of my code. Until VISA Read function, there is no problem. But as I said, when it comes to VISA Read function, it gives me timeout error.
Solved! Go to Solution.
10-14-2017 07:47 AM
Hi
maybe your problem with the ethernet may be that the device is on a different subnet.
Anyhow I saw 3 parallel openings to the same device and also 3 parallel write read sessions.
That seems a bit too much at one time.
It is allowed in LabVIEW but when talking to the same instrument in parallel you should have a reason to do that. Otherwise you are making your software more difficult to operate than necessary.
10-14-2017 08:15 AM
I am sorry, I gave wrong information.
When I send the commands from NI MAX, the device responds me. For example when I try to measure temperature, it responses me. There is no problem in NI MAX.
But on block diagram, when I write the command with VISA Write, I get timeout error from VISA Read. Actually there is no error until VISA Read function.
It seems that the device can not recognize my command when I send the command in block diagram. But why??
10-14-2017 09:06 AM
I would like to see one open visa and inside the while start with only one write read combination, not hree in parallel. You can make it too difficult for the device.
Remember that LabVIEW is running wires that are not connected in parallel. Often what you want but not in communicating during IO.
10-14-2017 10:01 AM
Sir, I tried what you said. I wrote a simple program. One VISA Open, one VISA write and one VISA Read. I send the temperature command. But the result did not change. I took the same timeout error in VISA Read.
I think the problem is not because of this. There is another thing that I miss.
In MAX, there is no problem. But in block diagram, I take error. Why???
10-14-2017 10:46 AM
10-14-2017 10:50 AM
According to the manual, I should add carriage return. So I add it. For example to measure temperature I send the command *SRTC\r with VISA Write function. But still I took the same error.
But in MAX, when I send this command, I get response
10-14-2017 03:36 PM
In LabVIEW to add a CR you have to add the special character not simply \r.
You can add \r if the display of your string shows
I added a snippet in LV15 to this mail.
You can add that to the block diagram of a new vi to use it and look at it.
You can also look at it in a picture viewer but best to insert it in a block diagram.
10-16-2017 12:48 PM
Sir, I tried today what you said. With one VISA Open and carriage return constant. I put Write and Read functions in stack sequence in while loop. Finally it works. I can read all values.
what I learnt from this problem is the usage of carriage return. 🙂
Thanks for everything