11-15-2011 01:04 AM
I've been having several "interesting" problems with GPIB and RS232 communications in LabVIEW VIs. Some I'll mention at the end for curiosity, but right now I'm facing a rather big problem. I'm essentially self-taught at doing LabVIEW (using 8.5.1 right now), but by now I've had a lot of experience as their either has not been any drivers or pre-made VIs for the instruments I've needed or I've not been able to get the available drivers to work and had to write my own anyway (such as with the HP 3458A), but nothing seems to be working right now. I'm not at work, but we typically find forum sites blocked anyway (I can't even download the NI drivers at work since they house them on a ftp server, go figures) so I can't give the VI itself (it wouldn't be easy to get approval even if I could) so the best I can do right now is in words describe everything I've tried. I will be happy to post follow-ups of specific details if I can if they would be helpful.
I've been working on a routine to read data from an MKS 670 Signal Conditioner/Display with a MKS 274 Multiplexer with 3 connected MKS 690A Baratrons. Previously I've worked on programs using other older displays and the analog outputs which were being read by a DAQ card, but for a new project it was decided to try and just read the data directly. I first worked with a unit with just an RS232 Serial Port which I managed to get to work, but had so much problems with garbage readings and having to add checks and re-reads that by the end no matter what delays I added between each reading and how simplified the command routine down to just 2 sequences and the read that it took at least 10 seconds to get 1 reading from each channel.
Figuring maybe it was a limitation of the serial communications for these instruments I tried to re-work it for a unit with a GPIB port with which I'm actually much more familiar. The problem is that I cannot get anything at all from the unit through GPIB. Everything even the bare-bones built-in GPIB CLR function times out with no response from the instrument no matter how long I set the timeout limit and it also freezes the entire GPIB bus as well. It isn't a waiting issue as it freezes on the very first command. The GPIB initialization function seems to work (I typically find this to be unnecessary), but the instrument itself doesn't even respond with a status code. I've also tried just the basic GPIB write functions with even just passing the <cr> and <lf> characters as well. In Measurement and Automation Explorer most of the time the instrument won't even appear when doing search for instruments and when it does it shows as not responding to the *IDN? command (yes I've messed with the EOI, EOS, etc settings and I've even changed the GPIB address even though when it gets this far it confirms that I have the correct address) and even tried manually doing the *IDN?, *RST, and *CLR commands even with <cr> and <lf> characters which the manual for these units clearly states are compatible commands and NI SPY and everything show no response at all. I've tried 2 different GPIB units, 3 different computers including several that are not online and haven't been updated for a while, and using older LabVIEW versions, extensive re-booting and resetting of computers and devices and still nothing. I'm using an NI GPIB-USB-HS GPIB to USB adaptor which I've used extensively on other systems and even re-connected to those systems and everything worked fine. When I hooked up equipment that I knew was working, it would either freeze the entire GPIB bus until well past whatever timeout setting I set at which point all the instruments would appear, but none responding to *IDN? queries or nothing would appear at all, or if I manually turned it off when frozen the other instruments would work and most even respond to the *IDN? queries. The same goes for both of the GPIB instruments of this type that I tried and again for different versions of LabVIEW, difference computers (all Windows XP though), and every GPIB configuration setting I can find to mess with in every combination.
Any thoughts or suggestions would be greatly appreciated. I've had all sorts of weird problems with equipment and LabVIEW (you've got to love undocumented design features) that have frustrated me before, but I've never had an instrument never respond at all especially a GPIB one. Getting garbage yes, no response at all, no.
The side side issues I'm just mentioning as they may be related, but I'm really interested in the above as I have working solutions for these:
One I've had is with a Hart Scientific (prior to being bought by Fluke) 1560 Black Stack that would continually stop responding to GPIB commands when on a continual read function taking readings just every 4 seconds with 250ms between each GPIB read or write command but for up to hours in total and the times it stops responding are random as far as I can tell. I even started sending the *RST command before and after every read or write command and still it freezes. The only thing is to manually turn it off and then back on or manually go through the menus and manually trigger the GPIB reset routine at which point it immediately starts responding. However, when I got sick of having to babysit it and just decided to try the RS232 serial port (as that is all it has without the extended communications module) it works fine no problem and I can even get readings slightly faster from it. Using a Hart Scientific 1529 Chub-e it could give me data on all 4 channels every second without problems. I just find it a bit odd.
When I couldn't get any of the HP 3458A driver packs to work to even give a single measurement reading and just made my own using basic GPIB read/write commands using the programming manual I still have a few interesting problems in randomly when reading off the full possible 256 bytes on the bus and clearing the bus I often find garbage partial readings on the bus every now and then. I've added a few routines to do some basic checks, but it is annoying. What is really weird is when just doing basic DC Voltage reads the "-" sign will randomly be dropped from some readings (started as about 1 out of every 5, down now to about 1 out of every 10). Fortunately I'm taking several readings and averaging and taking the standard deviation with limits on the deviations and basically added a routine to say if there is even 1 negative number take the absolute value of all then make all negative, but again I find it weird.
Thanks.
-Leif
Leif King
Metrology Engineer
Oak Ridge Metrology Center
11-16-2011 11:55 AM
Greetings Leif,
I understand you have completed extensive troubleshooting techniques to pin-point the problem with the GPIB communication. To begin, I want to ask you a few questions to help me understand your set-up and the issue at hand.
1) Is the NI GPIB-USB-HS cable the one which cannot communicate with your instrument?
2) When using the GPIB-USB-HS, does the GPIB interface show up in MAX?
3) If yes, does the instrument appear in MAX after scanning for instruments (from what I understand in your issue, it does so in an intermittent manner..)?
4) What driver version of VISA do you have installed in your computer?
5) Are you able to communicate to the same instrument using another GPIB cable?
Thank you for trying out some of these steps again, but we want to make sure we rule out other aspects in the systems which might be affecting the GPIB communication.
As for your other issues, please post seperate threads for each so we can help you accordingly. Thanks!
Sincerely,
Aldo
11-22-2011 08:33 AM
Hi Leif,
I haven't heard back from you in several days. If you have made any progress or still have questions on your issue please let me know, otherwise this thread will be closed in 5 days. Thanks!
Regards,
Aldo A
11-22-2011 05:24 PM
@Aldo A wrote:
Hi Leif,
otherwise this thread will be closed in 5 days. Thanks!
You can't close threads. Only the poster can mark a thread with a solution. Otherwise the thread remains open for all time, or until the universe dies, whichever comes first.
11-05-2012 01:59 PM
Hi, Ado. I have very similar issue. When sending command through USB port, The port work for awhile and then it frozen. Is there any way to put a time out so that if the case occurs, it will jump after a certain time. I'm using Labview 2012 and Window Vista.
Buu
11-06-2012 12:28 PM
MQI,
I'm not sure if I fully understand the problem you are having. What sort of device are you trying to communicate with? What do you mean by "the port will work and then it is frozen"? Do you recieve any error messages?
Hopefully with a little more information we can begin to work on this further.
Regards,
Leah
11-06-2012 02:40 PM
I'm using RS232 to RS485 converter. This converter works fine for awhile (using VISA) and then it hangs. No response at all. I did get an error message 1073807298.
BC
11-06-2012 02:46 PM
-1073807298 is just a general IO error. This would point to a hardware issue with your converter.
11-07-2012 06:52 PM
What environment are you using when you receive this error (MAX Test Panels, LabVIEW, etc.)?
Can you provide a screenshot of the error?
11-08-2012 10:31 AM
Agelica. I found out that the installer that I create does not have VISA driver since I could not find the USB device on MAX. It shows in my development computer but not the stand alone one. By manual install the device driver (disk), it works. In the future, how do I include VISA into my installer without having manually install the device driver. Thanks.
BC