03-09-2020 05:34 AM
I have written a program in Labview for storing in a text file all 4 data signals (Vx,Vy,Vr,Theta) which are displayed on the panel of my SR865A Lock-in Amplifier. The SR865A is connected to my PC via Keithley 488B GPIB cable.The snapshot of the block diagram of the program is attached below. But everytime I run the program, I get an ERR(6) from the GPIB READ command of my program. The available commands are OUTR?x, OUTP?x, SNAP?x,y,r and SNAPD?. The first three are used to give single data output i.e. data pertaining to a single parameter, but each shows the same error ERR(6). SNAPD? however shows only the x channel data while it should show a string containing data from all 4 panels at a single instant.
Can someone tell me why the error is showing and why SNAPD? is not working?
Solved! Go to Solution.
03-09-2020 09:02 AM
Why do you have a Request service in your code? You are not setting the SRQ bits in the snippet, nor are you clearing anything after the service request. Try something simple like this below, use the right address.
I suggest you use VISA functions instead of GPIB, it is more future proof.
Your code seems a bit Rube-Goldberg. Why are you updating the current in your loop, it never changes? Why aren't you using numbers for frequency? Use numbers and convert to string for your command, rather than start with a string and constantly convert to a number.
mcduff
03-09-2020 09:17 AM
The other reason you are only getting 1 value from SNAPD? is that you are converting the string to a SINGLE number.
Here's something quick, not posting the VI, by recreating it will help you learn. Remember to change the VISA address to the address of your instrument.
mcduff
03-10-2020 07:00 AM
Thanks a lot, mcduff. I changed the program as per your advice. Guess what it worked straight. The program is attached below, in case someone requires it.
03-10-2020 09:47 AM
Glad to help.
Attached is a "mock-up" of how you can improve your VI.
mcduff