Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get data from dataloggers with VISA thru Serial - timeout error occurs all the time

I'm trying to read temperature from a datalogger with VISA from a serial port but a timeout error always occurs and a VISA READ always returns 0 byte read count.
0 Kudos
Message 1 of 11
(6,029 Views)
Have you tried any other software to make sure the serial port works? Also what does a VISA viWrite return? Does the VISA Interactive control give you the same errors? Does MAX?
I don't use the serial port much, but some of the other guys in my lab do. So this seems rather odd.
0 Kudos
Message 2 of 11
(6,029 Views)
Does the datalogger respond if you use Hyperterminal?

Get it working there before trying to code.

The timout from VISA read indicates the number of bytes you requested, did not arrive. Are you asking for correct amount?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 11
(6,029 Views)
Ben,
Thanx for the reply. I try communicating with a datalogger thru Comm1/2. I've started Labview just a few weeks ago and I have no idea what a hyperterminal is. A guy before me wrote a program with SerialVIs. I'm trying to do the same thing with VISA to make the whole thing more compact.
I'll try playing with the # of bytes I'm sending, see what happens then. Thank you.
0 Kudos
Message 4 of 11
(6,029 Views)
Saikey,
Thankx for the reply. Another guy wrote a program to communicate with dataloggers thru Comm1/2 by means of SerialVIs, and the program doesn't fit in to the screen. I'm trying to make the program more compact and re-write it with VISA VIs. As someone suggested I have to try to send a correct # of bytes. What I did was that I sent a request to read 100 bytes thinking that it will read whatever # of bytes it thinks necessary. However it reads much less, approx. 60 byteor so. I'll try fine tune the byte thing and see what happens then. Thank you.
0 Kudos
Message 5 of 11
(6,029 Views)
Hi Albor,
I am also trying to communicate with the dataloggers from labview. Have you had any success? In any case I would greatly appreciate if you could post your VI's for reference?
Specifically I am using the DT600 datalogger from DataTaker.

Regards,
Setu.
0 Kudos
Message 6 of 11
(6,029 Views)
AiBor,
Hi there, you seems to be doing the same thing I'm doing, I'm also trying to communicate with a datalogger thru serial com1, all seems fine, visa read and write, but I can only read successfully after the second try, what am I doing wrong?
0 Kudos
Message 7 of 11
(6,029 Views)
I'll answer my own question because I found the problem why my VISA application caused a time-out error every time I tried to run it.
1. I have a number of dataloggers which read temperature. I printed out a manual on the dataloggers. It says that there's two ways one can access data from them. One is to read every channel in a sequence, second is to read all channels at once.
2. Of course I thought to read all channels at once is much easier and faster. But no matter what I tried, my VISA VI would not work at all.
3. I tried to read one channel at a time - no problems, all channels together - time-out error!
4. Then it struck me, what if some modules do not anderstand the command to read all channels at once. I've checked each module individually, and as it
turned out 4 out of 6 modules did not understand the command.
5. Then could I only found out that I have different versions of the dataloggers! But the manual I've printed out was for the newest ones. Of course the older versions did not work because they did not understand what the hell I was trying to get from them.
6. When I made a loop to read one channel at a time in a module at a time - everything worked perfectly.

Conclusion: Make sure the instructions you send to the equipment are supported by that equipment. It is worth checking what versions you've got and exactly what instructions they're using. Good luck.
Message 8 of 11
(6,029 Views)
Here's a simple code to work with VISA, attached. Hope it helps someone. It only works with my dataloggers. It may be universal with some minor modifications. Good luck.
0 Kudos
Message 9 of 11
(6,029 Views)
Hi Albor,
I appreciate you posting your VI code. But the file "5ch VISA.vi" is missing.
I am fairly new to VISA but I have started creating the VI's for datalogger. Your code is a great reference. Thanks.
-Setu.
0 Kudos
Message 10 of 11
(6,029 Views)