LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Closing VISA session causing a RS-232 framing error on Agilent E3631A

Using the driver available from NI's device driver site, I am causing the power supply to report a RS232 framing fault simply by closing the VISA session??

 

Any ideas?

0 Kudos
Message 1 of 10
(5,389 Views)

The download driver may not read all the buffer in RS-232. You may try to write your own driver. Try to copy from NI example GPIB code in LabVIEW, but change to RS-232. It works like a charm. 

0 Kudos
Message 2 of 10
(5,385 Views)

Is this happening with one of the E363X examples? Which one? If not, please post your code.

0 Kudos
Message 3 of 10
(5,381 Views)

Yes, I am using the GPIB driver available from NI Driver Net. However, I am seeing the exact same problem using the VISA Test Panel in MAX. Simply opening the panel and then closing it causes the power supply to report fault code 511, which is a RS-232 framing error.

 

This shows how I am currently configured, using the driver I downloaded from NI. If I use RS-232 it takes 15 seconds to execute this vi, and produces the error when the VISA session is closed. If I use GPIB, it executes in less than half of that time, and produces no errors. Also, the first time you execute this code after opening LabVIEW, it produces an error, which appears to be occurring because the driver is not identifying it as a serial device.

 

Error -1074000000 occurred at Agilent E363X Series.lvlib:Error Query.vi

Possible reason(s):

Instrument reports: -410,"Query INTERRUPTED" +0,"No error"

 

Complete call chain:      Agilent E363X Series.lvlib:Error Query.vi      Agilent E363X Series.lvlib:Reset.vi      Agilent E363X Series.lvlib:Initialize.vi      Agilent E3631A Power Supply Control.vi

 

Subsequent attempts execute without issue, with the exception of the error closed when the VISA session is closed

0 Kudos
Message 4 of 10
(5,238 Views)

Is there a particular reason you'd like to use RS-232 rather than GPIB? It sounds like the drivers are optimized for GPIB, which may explain the behavior you're seeing. Linked below is a forum that discusses framing errors a bit more. 

 

http://forums.ni.com/t5/LabVIEW/RS-232-Framing-Error-with-HP-34401A-Mulitmeter/td-p/128213

0 Kudos
Message 5 of 10
(5,069 Views)

I get a framing error on my 34401A in RS232 mode when using a laptop with a built in RS232 port. Same thing occurs when the com port it closed by the application using it. MAX F5 (refresh) and VISA test panel closure also cause it.  I think windows is shutting down the physical com port to save power and causes the RS232 lines to go to a state that looks like a com event to the DMMIf I use a USB to RS232 converter on the same laptop the problem goes away.

0 Kudos
Message 6 of 10
(4,772 Views)

I'll buy that explaination, this problem appears to be only occuring when I use a laptop. I have installed a 3rd party serial card in my in my computer, and the problem is not occuring anymore.

 

Thanks.

0 Kudos
Message 7 of 10
(4,765 Views)

Hi,

 

I got the same problem, and yes, with all the drivers provided by NI.

Thanks!

0 Kudos
Message 8 of 10
(3,761 Views)

Did you read the above solution and understand it?

 

Essentially you need to ensure that you set your Serial and USB port Power settings so that windows is not permitted to turn off the port to save power. This is where lots of these sorts of errors stem from.

 

Once you have done that in device manager, reconnect all your devices and that should sort you.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 9 of 10
(3,756 Views)

I tried the USB power trick, the issue is still there however.


I am reinstalling LabView and will try again with all 3 provided drivers and a simple from scratch vi.

 

Thank you!

0 Kudos
Message 10 of 10
(3,744 Views)