01-27-2020 01:53 AM
Hi, everyone.
I'm a beginner level in Labview.
I want to measure and save data using Lock-in-amplifier SR830, pre-amplifier SR570, and Keithley sourcemeter 2600 series.
But, I have only one GPIB yet. so, Lock-in-amplifier is only connected with GPIB. (Other instruments set by analog control)
I used and modified SR830 examples provided by Labview to measure and save automatically data. This code worked well(data read and save).
However, The data results were quite different when running Labview program and when it is not. (data become very larger than analog control without labview --> it causes output overload error.)
(all setting values in Lock-in-amplifier were same.)
So, I have a question. If I have multiple instruments connect with each others and only one instrument is connected with GPIB, when run the labview program for GPIB connected instrument, can I have a issue in above case? or This issue is caused by just code problem?
I'm sorry for my poor English.
Please give me any comment or advisement.
Thank you
01-27-2020 05:06 AM
It's hard to tell from a picture, but I'd suggest using Shift Registers for your VISA resource. I suspect it might not matter, but I'm not certain about the behaviour of VISA references.
Beyond that, ideally you'd move your initialisation code outside of your loop rather than having it in a Case Structure with i=0.
There may be race conditions caused by the use of local variables, but I don't know that that would cause your issue.
What do you mean by "data become very larger" and "output overload error"? Where does the error occur?
01-31-2020 06:22 AM
Thanks you for answer.
I modified the code that I moved initialization part outside of loop and used shift registers.
and then, output overload error was solved.
when the labview code was not executed, X values (output) in channel 1 were between -1 to 0.5 uV. however, when the code was executed, output became -8 to 6 uV (or more). I don't know why there are difference between them. their setup was same. What am I missing in this code?
I attach the code(main VI is "main_~~~.vi"(korean))
Thank you
01-31-2020 07:17 AM
I think I understand.
When you carry out your experiment/test without LabVIEW (using only the controls physically located on the devices) you measure -1 to +0.5uV.
When you do the same test with LabVIEW controlling the SR830, you measure between -8 and +6uV.
Is this correct?
First, I'd check that all of the settings are the same.
In "Acquire Measurement - 1 Parameter" you can see that "Auto phase" is set to false and so is "Enable Sync Filter". Are these the same settings you have on the device without LabVIEW?
Are there some defaults that change when you connect to the device remotely?
Although I believe there are still some race conditions because of the way you're using Property Nodes and local variables to control the communication, these won't change the values you measure, so they're not important to the main part of your question.
I suspect that probably some setting on the SR830 is being changed in your code (inside the Stanford Research VIs) compared with when you carry out the experiment/test "by hand".
01-31-2020 07:18 AM
@tjdgjs15 wrote:
Thanks you for answer.
I modified the code that I moved initialization part outside of loop and used shift registers.
and then, output overload error was solved.
when the labview code was not executed, X values (output) in channel 1 were between -1 to 0.5 uV. however, when the code was executed, output became -8 to 6 uV (or more). I don't know why there are difference between them. their setup was same. What am I missing in this code?
I attach the code(main VI is "main_~~~.vi"(korean))
Thank you
Don't have LabVIEW here to examine your code, but what is the value of your Time Constant? Remember, the Time Constant is the "Low Pass Filter" value, so if you have a time constant of 100ms, it really takes 500ms for your value to be stable, (1- Exp[-5 tc]), at the minimum you should wait at least 3 time constants before take a measurement. I am wondering if when you start the program, the SR830 "resets", thus restarting the wait for the value to become stable.
Try putting a wait after your initialization and see what happens.
mcduff
01-31-2020 07:30 AM
This is I think probably what you're talking about with the delays.
At "A" there's some sort of setup being carried out via a single measurement, then at "C" there's what I assume is the data we're discussing being overly large.
Between the initialization and the beginning of measurements, there's a 10 second delay at "B".
(posting in case you see something in a picture since you don't have LabVIEW to hand).
01-31-2020 07:46 AM
Don't use your program.
Open MAX to communicate with your instrument. Use the SNAP? command with the appropriate parameter to read your X value, see if it is similar to what's on the display. This should let you know whether there is really a problem.I have used this lock-in in the past without any issues, so I think something is being set in your program.
mcduff