LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Agilent 34970A Visa session randomly disconnecting

Solved!
Go to solution

I have an Agilent 34970A that I'm using the record temperature and voltage values.  The DAQ is connected through an NI GPIB-USB-HS.  I have downloaded NI Visa drivers and the Agilent 34970A instrument library.

 

I am able to run my program from ~1 min before an error occurs and the DAQ is completely unresponsive through Labview 2018 and Max.  Error -1073807342 occured at VISA Read in Agilent 34970.lvlib:EZ Voltage.vi.  Possible reason: VISA: (Hex 0xBFFF0012) Invalid resource reference specified. Parsing error.

 

I must unplug the device from the computer, replug the USB, and scan for the instrument through Max to reestabilish a connection.

 

I have replaced the GPIB adapter, the DAQ, checked all connections, so I can rule out a physical connection issue.  Something is happening to trip up the VISA address and I cannot figure out what it could be.

Download All
0 Kudos
Message 1 of 13
(3,417 Views)

Hi jhirschey,

 

It would be easier for all members who want to help you if you add your code to your post.

 

What I can see from your pictures.

You close the VISA connection in the first iteration of the loop, that makes no sense. You read temperature and pressure once, close VISA and then, of course, you can not acquire data from the device.

 

To improve your code,

you should place the VISA close VI after the while loop, so that is executed when you shut down the program.

To end the loop properly I would recommend to add a stop button to the loop condition.

 

Regards,

MOJO

0 Kudos
Message 2 of 13
(3,405 Views)

Make sure the Power Saving (and any other related) settings for the USB device are turned off.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 13
(3,386 Views)

MOJO,

 

I have updated my code to remove the Close vi (temporarily).  However, I still encounter this same error shortly after running the program.  The issue seems to be some error reading the VISA session.

Download All
0 Kudos
Message 4 of 13
(3,384 Views)

Ben,

 

I disabled the USB selective suspend setting.  Are there other settings that could be affecting the USB ports?

0 Kudos
Message 5 of 13
(3,376 Views)

Removing the Close vi only makes it worse.  Now you never dispose of the VISA session.  As MOJO said, place the Close after the loop (make sure the VISA ref is fed through the loop).

 

You may need to restart LabVIEW to clear that reference before it is used again.

0 Kudos
Message 6 of 13
(3,352 Views)

@jhirschey wrote:

Ben,

 

I disabled the USB selective suspend setting.  Are there other settings that could be affecting the USB ports?



Yes, the USB hub bbn itself defaults to shutting down.   Use the device manager to change the power options.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 13
(3,341 Views)

Not remove close but place after execution of while loop. Also the set measures is better you place outside (before) the loop. Use shift register for reference (not for this issue but a best practice. Try not wire the input terminal. Try to change time. Find out on the palette of this instruments the samples.

Hope this help you 

 

 

Nicola
LabVIEW DeveloperByteLABS.
0 Kudos
Message 8 of 13
(3,317 Views)

Yes.  I see now that removing the Close function seemed funny, but I did it because the error was not exiting the loop and the Close function was never called.  I fixed this by adding an Or function with the Stop button to terminate the while loop when an error occurs.

 

However, the VI still stops and the VISA connection seems to terminate ~30-60 seconds after I begin the VI.  The only fix is to physically unplug the hardware from the computer and reinitialize the connection through Max.

 

Any additional help will be greatly appreciated!

Download All
0 Kudos
Message 9 of 13
(3,293 Views)

Stop button and close after the loop looks much better.

And that you post your VI makes it much more easier to help you.

I found this http://www.ni.com/tutorial/4644/en/ on ni.com.

The examples seem to be good guidance.

 

Your 10V enum to Conf Voltage.vi is not correct. You set the range to -1.

Create a new enum constant and select 10V again. So that you adjust the correct manual range.

And wire the same range into the loop to EZ voltage.vi.

Check your serial configuration.

You can bundle the channels to N plot chart.

 

See the attached VI, hope it helps.

 

MOJO

0 Kudos
Message 10 of 13
(3,284 Views)