LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SR830 VERY unreliable data transfer

Please help!

I am using the Stanford Research SR830 Lockin Amplifier and I need to transfer the data from the instrument buffer to my computer. Usually this would just be a simple GPIB write/read sequence. I am using the SPTS? command to query the number of points in the buffer and the TRCL? command to write the data into the I/O buffer. The program sometimes runs successfully but in most of the cases it fails. It seems there always remains some garbage in the buffer or that the transfer is not ready when I want to read the data.
I looked-up the LabView help and fell on the concept of Service Requests. I subsequently modified the program to include SRQ. This should prevent that I read the data too early. So a typical command sequence would be *CLS;*SRE16;TRCL?1,0,{number of points}
So how does this work? *CLS; should clear the whole status register; *SRE16 enables status bit number 4 (2^4=16) which is the service request bit. The vi SRQ wait should continuously query when the SRQ status bit changes. All this should make the data query much more reliable. In practice what happens is that the VI waits in wain for SRQ until it times-out. I put the time-out value up to 60 seconds, this should definitely be enough to transfer 1000 data points. I don't understand what is wrong. I also tried the NI packet GPIB spy to monitor the traffic on the GPIB bus and everything seems to be normal. I attached the Labview library. Any ideas?
0 Kudos
Message 1 of 8
(4,051 Views)
Hi David,

I noticed you said you used GPIB spy.  I was wondering what version of the 488.2 and VISA drivers you had? 

Also, I was wondering if you had tried using the LabVIEW instrument driver for the SR830?  If you have a 488.2 instrument, you should be able to use this driver.  There are a few exaple vi's including a Data Storage Example that recovers data from the instrument's buffer.  It may be worth a look if you haven't already tried it.

Hope this helps!

Adam W
National Instruments
0 Kudos
Message 2 of 8
(4,017 Views)
Thanks for replying. I was using the official SR830 driver first but did not have any luck running it. It would not display anything meaningful. After that I started entering the GPIB commands manually. I am using Labview 7.1 and VISA version 3.2. Maybe I need to update the VISA driver?

David
0 Kudos
Message 3 of 8
(4,012 Views)
Hi David,

That's probably a good idea regardless.  You can find the current VISA drivers here.

Regards,

Adam W
0 Kudos
Message 4 of 8
(3,994 Views)
Thanks Adam,

updating the 488.2 and VISA driver solved ALL my problems. Now even the official SR830 driver works:-)
0 Kudos
Message 5 of 8
(3,980 Views)

Hello David,

  Glad to read that your problems were resolved, but, I have a question I suspect you know the answer, which I suspect will be embarrassingly simple:: How did you send string commands to the 830, and read the responses?  The vi i have created works well writnig and reading the usual suspects, but the "usual suspects" are those listed in the various 830 configuration and read vi's accompanying the instrument driver.  I need to query the sensitivity from time-to-time, and the string is, "SENS?"  I haven't learned how to send the string and read the result.  Any suggestions?

0 Kudos
Message 6 of 8
(3,342 Views)

You might want to take a look at this forum post as well:http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/GPIB-control-of-SR830-lock-in-read-write-prob...

 

Have you also look at sample examples for GPIB? Help>>Find Examples>>Hardware Input and Output>>GPIB.

National Instruments
Applications Engineer
0 Kudos
Message 7 of 8
(3,317 Views)

Thanks for the reply.  Actually, I figured it out once I removed the blinders imposed by thinking I should be able to write commands to the 830 from the instrument driver configuration pallete.  I was completely blinded by misconceptions.  I successfully acquired data using both VISA and instrument driver resources. Thanks again.

0 Kudos
Message 8 of 8
(3,297 Views)