03-07-2019 04:38 PM - edited 03-07-2019 05:00 PM
Hi everyone,
I am quite new to LabVIEW (one week strong), and I am trying to simply read voltage from a data acquisition device (Agilent/Keysight 34970A). I am using an old coworker's VI where everything was previously set up and running. I had to download the appropriate drivers for communicating to the 34970A (NI-VISA and NI-DAQmx), I am connecting to the 34970 via USB to RS-232 converter, and have LabVIEW 2018. Running the Advanced Scan vi example that comes with the driver download, I am able to get a voltage value. However, when I go to run my main VI, I get an error on both LabVIEW and my 34970A device.
The LabVIEW error says "Timeout expired before operation completed" and hints that the error can be found in the VISA Read function inside of the "Serial_Command_VI" that I have attached. The baud rate is 9600, my flow control is XON / XOFF, and I have tried increasing the timeout value to 10000 but still no luck. Maybe there is something small that I am missing or not understanding? Here is a screenshot of my Serial_Command_VI:
The 34970A errors that appear on the display are 101 (Invalid Character) and 113 (Undefined Header or Empty Scan List). I read the error codes from the User's Manual and I am not understanding where these "command strings" are being input.
I have attached my Main VI and the two sub vi that reside within the main. Thanks for your time and I hope what I have said makes sense.
03-08-2019 02:05 AM
Try this driver instead.
Benoit
03-08-2019 10:09 AM
Hi bseguin,
Thank you for replying! I apologize for not being clear, but I do have the Agilent 34970A driver downloaded as well. That is how I was able to run the "Advanced Scan" example. I also have the Agilent 34970A driver installed, NI-VISA, and NI-DAQmx (DAQ Assistant).
I was looking through the forums earlier, and there was some mention of installing NI-Serial. Would you happen to know if there is any difference between NI-VISA and NI-Serial? Here is where I found this information:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019L3mSAE&l=en-US
They both say I can communicate with serial devices, but I installed the NI-VISA since that's what a majority of others were using.
03-08-2019 10:54 AM
@kentobeans wrote:
Would you happen to know if there is any difference between NI-VISA and NI-Serial?
NI Serial is just the driver for NI serial cards. NI VISA is a communication bus abstraction layer that uses whatever drivers is needed to communicate over the serial port, GPIB, or network adapter.
03-08-2019 01:12 PM
crossrulz
Thanks for the explanation! I will continue to use the NI-VISA since I do not have NI serial cards.
Is there any thing you recommend for getting rid of the timeout errors that I previously mentioned?
Thanks.
03-08-2019 04:32 PM
I'm still running LV2016, so I can't check out your Main.vi. But.. I have been using the total workhorse 39470A since 1998.
In the snip you posted, I don't see a delay between the Visa Write issuing the command, and the Read collecting the data. This instrument can be pretty slow, especially when using long integration times to get hi resolution readings.
I'm attaching an llb with a program we used to read temp using RTDs and correlate with resistances of thermistors to characterize them. Maybe you can get some ideas from, or modify it to suit your needs.
In there, we preconifgure a scan, set up a timed trigger using the 34970 internal clock, then loop querying for number of channel readings in memory. When the number of reading is => one scan, we execute a read to get the data. That way we don't have to set long serial timeout values.
Hope this is helpful.
BG
03-08-2019 04:53 PM
Your problem is flow control- if you're using flow control on your device, LabVIEW needs to know about it in Configure Serial Port:
Either enable XON/XOFF flow control in Configure Serial Port or disable it on your 34970A.
03-08-2019 06:03 PM
BertMcMahan
I have the serial port configuration set such that the Flow Control is XON / XOFF.
I did some troubleshooting and found out my serial port configuration inside of the cluster (main vi) was done incorrectly. With the new serial port configuration, I no longer get error 101 on the 34970A device but I still get error 113.
I wound up removing the section you have screenshot along with the "Relay State vi" and "Serial Command vi" because I am not sure why I would be reading from two serial configurations if I am only talking to one device. I am able to get readings with this approach but I am not sure if this is the correct way to go about it. Maybe you or someone else can shed some light as to why there would be two serial port configs with the same information?
Thanks to you and all the others who have replied to my post so far. I am much closer to figuring this out!