SR510 Lock-in Amplifier Repeated Data Output Command Problem
Hi,
I'm using LabVIEW version 7.1 with an SR510 lock-in amplifier connected through GPIB-488.2. I've gotten past most of the hurdles, the device appears in MAX and I can send and recieve data using the VISA test panel. My main goal is to be able to have a VI where I am continuously asking the SR510 to output a voltage number while the data recieved is then saved in a .txt document and graphed as a function (simple x-y). The issue I am having is that the SR510 will not take more than one "q" command to output data. I can clear the settings of the lock-in with a "z" command, and then give it a "q" command and it will output correct information but if I try to run it continuously I get an error. I've tried using variations of the same "q" command (e.g. adding a needed carriage return, \r, \n) but none of them produce any different results. I should also mention that this issue only occurs with the "q" or output data command. Other write/read commands can be issued multiple times in rapid succession without any issues. I would be greatful if anyone had any advice as to why this might be occurring. Also I apologize if some of my terminology is incorrect as I was only just introduced to LabVIEW a few days ago.
Thank you for your time,
Sal
If you are brand new to LabVIEW, I would recommend looking at the VISA/GPIB shipping example to familiarize yourself with the different functions and how they interact. Go to Help»Find Examples... to open the example finder. The GPIB example is located in Hardware Input and Output»VISA»GPIB-VISA.vi.
When you say " I can clear the settings of the lock-in with a "z" command, and then give it a "q" command and it will output correct information but if I try to run it continuously I get an error." do you mean that you try and continously give it a "q" command and then a "z" command and it errors, or you just give it a "q" command? It may be possible to alternate between a "q" and "z" command inside a while loop to continuously output and then clear the settings and output again. It may also be that this device is not capable of continous output. I would check the user manual to see if this kind of operation is possible, and if so how to accomplish it. Let me know how it goes and if you have any more questions.
Regards,
Chris L
Applications Engineer
National Instruments
Certified LabVIEW Associate Developer
Similar Messages
-
Connecting lock-in amplifier to USB-6009/6211
I am working on re-setting up a labview environment in the lab I work at. We are using a SR810 DSP lock-in amplifier and want to bring the data into labview. The labview code says that in the past we used a USB-6009 to read in data from the lock-in amplifier. The output ports on the lock-in are an RS232(DCE), a IEEE-488 port, and a preamp port. Is there someway to feed one of these outputs into the DAQ that we have. Thanks
An RS232 or GPIB connection directly to the computer would be best, but if you insist on using the 6009, run a line from the CH1 outut BNC on the front panel of the lockin into the DAQ device. Note that this is a -10 to 10 V output and that the mapping to the actual LIA voltage depends on the sensitivity setting of the lockin (see pgs 4-2 and 4-12 of the 810 manual).
-
Lock-In Amplifier and offline data processing
Hi everyone,
I've been successfully using the Lock-In Amplifier to do live data processing. The processed Lock-In outputs and the frequency values are then saved. Recently it has turned out that the real acquisition capabilities needed mean that online processing is not possibe. (As 4 channels are being simultaneously sampled each at 4Mhz and acquiring for several seconds.) I have built the Lock-In Amplifier into an offline processing VI where I strip out the arrays for Channel 0 (Signal) and Channel 1 (Reference) and send chunks of data to the Lock-In. I wanted to check that the Lock-In doesn't have any problems working offline? Are there any other things I need to know for offline processing?
Many thanksHi,
I've not personally had the change to use Lock In Amplifiers with our hardware yet, but from searching through the LabVIEW developer zone I came across this example VI, I hope it's some help to you: http://zone.ni.com/devzone/cda/epd/p/id/4532
All the best,
Applications Engineer -
How to input 1d waveform array into lock in amplifier
I have a LabView application that I need to modify to include a lock in amplifier. The application uses a DAQ card to repeatedly capture a 0.1s sample of two signals (one signal, one reference) during a laboratory test. Previously the measurement was being made by the basic RMS module to record the VRMS of the signal, and the reference ignored. However, the measurements I am now performing are at a much lower S:N and so I'd like to use a simple LIA from the NI kit.
I am happy (I think) with the setup of the LIA but I'm struggling to understand the input data requirement. It has to be a 2D array, with the reference signal identifited. However, the output from the part of the utility that captures the waveform is a 1D array of waveform. Could someone advise me on how to convert from the 1D array of waveform to a 2D array suitable for input to the LIA?
As you might have guessed I'm a newbie to LabView, I'm trying to modify an application designed and assembled by a former colleague, so I'd appreciate simple suggestions!
TIA.
Solved!
Go to Solution.I tried that but fell at the first hurdle. I've attached the error message that I got. It refers to the issue being due to connecting the type Waveform (DBL) to a 1D array of double. Apologies if I'm missing something simple here, software is not my strong point.
I'm a bit confused as to why the LIA (or its subVI's) require a 2D array. I would have thought, from experience with hardware LIA (5210's etc) that the VI's would want a waveform to process.
Each entry in the TDMS file is a 0.1s capture of an ~800Hz sine wave, along with the reference signal from the chopper that generated the modulation. I'm a bit confused as to how this data gets represented in a 2D array for the LIA. I assume that the waveform is broken into an array of amplitude versus time for each sample and that each sample is then indexed in the 2D array?
Anyway, all help greatly appreciated.
Thanks.
Message Edited by Ringding on 03-27-2009 12:25 PM
Attachments:
connection error.jpg 84 KB -
10g Grouping and Hide Repeating Data
I need to return a sales rep's accounts assigned to him. But, a customer can have several sub account records,
because a new transaction will create a new record in the subacct table. Here's the query but it returns
all of the rows for the customer assigned to the Salesperson and really not a great format.
All I want is the customer's last record. It would also be great to eliminate any repeating data in columns:ssn
sb.salesperonid, acctid. It's easier to view the data when there's just 1 ssn, 1 salespersonid,acctid but
multiple subaccbal balances.
SELECT sb.ssn,
sb.salespersonid,
sb.acctid,
sb.subacctbal
FROM subaccbal_current sb,
sysusr_salesperson1,
product p
WHERE sb.subacctbal > 1
AND sysusr_salesperson1.usrid = sb.salespersonid
AND sb.prodid = p.prodid (+)
AND sysusr_salesperson1.usrid = 2007
order BY sb.ssn,sb.subacctbal
sb.ssn sb.salespersonid acctid subaccbal
16x67 2007 8x41 3840.1447436467236765 southwestern burger
16x67 2007 8x41 3999.53760824202520962 chips and salsa
16x67 2007 8x41 4001.49146206932217968 chips
31x34 2007 8x47 3940.7899999999823942 chipotle meal
31x34 2007 8x47 4019.660000000200747 coke
31x34 2007 8x47 4110.8599999999692953 speakers
31x34 2007 8x47 8216.30999999995797296 phone
31x34 2007 8x47 8671.1099999999555424 table cloth
31x34 2007 8x47 8743.079704290217582865 pickles
32x76 2007 8x10 117756.91 juice
32x59 2007 1x004 52116.229999999969462937 fish n chip
32x59 2007 1x004 64675.1499999994542136 paper
32x59 2007 1x004 64959.1799999998650161 markerss
33x58 2007 8x37 44334.3858770048316717 paint
33x58 2007 8x37 45016.1826601808917375 beer
33x58 2007 8x37 71637.165562261602140981 fruit
Preferred report format:
Salesperson:2007
sb.ssn acctid subaccbal
16x67 8x41 4001.49146206932217968 chips
31x34 8x47 8743.079704290217582865 pickles
32x76 8x10 117756.91 juice
32x59 1x004 64959.1799999998650161 markerss
33x58 8x37 71637.165562261602140981 fruit
2nd report format:
sb.ssn sb.salespersonid acctid subaccbal
16x67 2007 8x41 3840.1447436467236765 southwestern burger
3999.53760824202520962 chips and salsa
4001.49146206932217968 chips
31x34 8x47 3940.7899999999823942 chipotle meal
4019.660000000200747 coke
4110.8599999999692953 speakers
8216.30999999995797296 phone
8671.1099999999555424 table cloth
8743.079704290217582865 pickles
32x76 8x10 117756.91 juice
52116.229999999969462937 fish n chip
32x59 64675.1499999994542136 paper
64959.1799999998650161 markerss
33x58 8x37 44334.3858770048316717 paint
45016.1826601808917375 beer
71637.165562261602140981 fruitthanks for any help.
Edited by: achtung on Jan 6, 2010 1:12 PMHi,
Your 'Preferred report format" is an example of a +Top-N Query+ , which you can do using the analytic ROW_NUMBER function:
{code}
WITH got_rnum AS
SELECT sb.ssn,
sb.salespersonid,
sb.acctid,
sb.subacctbal,
ROW_NUMBER () OVER ( PARTITION BY sb.ssn
ORDER BY sb.subacccbal DESC
) AS rnum
FROM subaccbal_current sb,
sysusr_salesperson1,
product p
WHERE sb.subacctbal > 1
AND sysusr_salesperson1.usrid = sb.salespersonid
AND sb.prodid = p.prodid (+)
AND sysusr_salesperson1.usrid = 2007
SELECT * -- or list all columns except rnum
FROM got_rnum
WHERE rnum = 1
ORDER BY ssn
{code}
This assumes that subaccbal_current.ssn is unique, and that the "last" row for any ssn is the one with the greatest subacctbal.
Notice that the sub-query got_rnum is just your original query, with one more column in the SELECT clause.
Output like your "2nd report format" is best done by your front-end tool. If SQL*Plus is your front end, you can use the BREAK command to suppress display of certain columns if the value is the same as the preceding row.
If you must do it in pure SQL, you can get the ROW_NUMBER like I did above. In the main query, you could use rnum in a CASE expressions to determine whether you show the value or NULL:
{code}
SELECT CASE
WHEN rnum = 1
THEN ssn
END AS ssn
{code}
Edited by: Frank Kulash on Jan 6, 2010 4:31 PM
Added example of "2nd report format" -
I've downloaded the NI Lock-in amplifier toolkit (llb file), and I have
a PXI-4472 board. The toolkit looks to be based on traditional DAQ, not
DAQmx. Did I miss the DAQmx version, or has no application engineer
posted one yet? Please let me know if there's a timesaver out there
before I just start to convert it on my own.
Thanks,
RobThanks. That version doesn't work with LabView 7.0, by the way. I had a tech support person email me with a version that would.
Here's an update from my end: I have it setup and running. Only, it seems to burp at the PLL sub-vi. I KNOW that have the correct data going into that sub-VI and that my DAQ board is working b/c I've put probes and indicators in the path and such. The problem is that it doesn't calculate the correct reference info. If I place a probe at the "reference info" output, it returns a constant output of fr=1 and phase =0. This is bizzare. I've changed every parameter I can think of (sampling rate, block size, offset parameter, column value, time constant, etc.) but it yields no positive result.
Any ideas or suggestions? I'm at wits end.
BTW, my board is the 4462, not the 4472 I mentioned previously. And, my refrence signal is a TTL square wave from 0-4 Volts, operated anywhere from 10Hz to 2KHz. That's working correctly as shown by my scope. But according to the PLL VI, it is always 1 Hz!
Thanks,
ROB M. -
Is there a way of repeating message output for Purchase Order for multiple POs. Any help is much apprecaited.
Thanksgoto t.code me22n..
click on message pushbutton on apllication toolbar...
specify the the output type that u want and u have pushbutton futher data inthat u go and
dispatch time as------send with application own transaction...
then goto me9f and process the t.code with transmission time-spot = '3'
u will get repeated o/p..... -
Bind repeating data to multiple fields
I am a livecycle numpty and I need some help! I am developing a readonly report. This report is using sample xml for databinding. Within the xml I have a repeating group - example:
<group>
<groupItem>
<addres>parp</address>
</groupItem>
<groupItem>
<addres>parp</address>
In my report I have two sections that need to reference this repeating data. One section works and the other doesn't. I've read that you can't bind repeating data to multiple fields. How do I get around around this? I can't seem to get the global binding to work (is this purely for user entered data???)
Please help!
Cheers,
Richone way to do this is, in the Initialize event of the field in second repeating section, assign the rawValue from the first repeating section..
For example..
initialize event of Field2..
Field2.rawValue = Field1.rawValue;
Other way is to read the XML tags and assign the value to the fields..
You need to loop thru the group element and read each group item value and assign the value to the field..
Field2.rawValue = xfa.resolveNode("$record.group.groupItem").value; //this command will only read the first occurance of the groupItem value.
Thanks
Srini -
XML data output file in a directory needs to be published as a pdf report
Hi,
I have already got an XML output file in a directory.
I want to display it using RTF template using a concurrent program or some sort of java api in a pdf format to be able to print it.
How do I do it? Do I have to write another file output command to read the xml data line by line and output to BI publisher first?Hi,
Hmm, one way is to just utl_file read the file and fnd_file.put_line(fnd_file.output) then close the file. Setup conc prog, rtf template, data definition and you're done.
But the main thing is that you get the XML file to $APPLCSF/$APPLOUT/oXXXXX.out where XXXXX is the request id. You could just setup host concurrent program and copy the file there!
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/
Message was edited by:
gareth.roberts
Message was edited by:
gareth.roberts -
Driver disturbs lock-in amplifier?
The LabVIEW driver for the Stanford Research Systems SR830 Lock-in Amplifier, downloaded from the NI web site, does not produce accurate readings of the measured voltages(Channel 1 or Channel 2). It appears the phase has been offset, but no offset was programmed into the device, and the values fluctuate. When the device is programmed either from its front panel, Visual Basic, or other languages under the same conditions it produces accurate results. Can you identify and correct the bug in this driver?
Hello-
Be sure the display and output and ratio settings for each channel are apropriate. If this doesn't help, would it be possible to list the values are being used for the SR830 Example.VI? It's probably easiest to enclose a screenshot? Also, please state the expected return values from the instrument (possibly a sample from what VB returned).
Randy Solomonson
Application Engineer
National Instruments -
Problems with LabVIEW 7.1 and lock-in amplifier Stanford SR530?
Does has anybody had problems with LabVIEW 7.1 and the instrument driver for the lock-in amplifier Stanford SR530?
With LabVIEW 6 there are no problems at all, but with LabVIEW 7.1 it is impossible to communicate with the instrument.amr_attia wrote: (Private message, no need to private message)
My problem is to get the data out from the divice x and y readings . Can you help me
Here is the code and snippet. I had it from before. It reads Channel 1 and Channel 2 from the SR530, that is whatever the display is for Channel 1 & 2. You set the display manually or programmatically, I let you figure that part out.
Cheers,
mcduff -
Set values for the Lock-In Amplifier's Digital Analog Converter Channel?
If I let my user have the freedom to select whatever values they want to select in order for it to show up as the output value for the Digital Analog Channel then I cannot understand why use ibwrt(...) and ibrd(...). Because ibwrt is going to write a specific voltage at the specified channel since the manual for the Amplifier states you must input the string for writing output voltage as DAC2 3000 (the 2 signifying the channel and 3000 - the millivolts). If this hard coding occurs by using ibwrt then how can I write my code so that the user has the capability to change the voltage value and the channel to the one they want? Thanks in advance.
Do I need a Fmt and ibwrt for both DOutput and VOutput? Because DOutput is indicative of the channels 1, 2, 3, 4 in the Lock in Amplifier and the VOutput is for the amount of volts the user can set (i.e. write to the instrument). Also I found this on the following NI website regarding filling in the value of the write buffer: Write Buffer Value. This website signifies that one must use \002 and end with 003\ which I am not sure I even need for this instance of initializing the writeBuffer[8]. Also I used [7] for the writeBuffer because I thought arrays went 0, 1, 2, 3...so on therefore writeBuffer[7] will give me space for 8 bytes? Is that an incorrect assumption? Lastly, here is my modified code according to the changes you mentioned and it still is giving me Non-Fatal Run Time Errors and not communicating. Is there anything else I am missing out on which I can't find. Seemed like I may be making this code much harder than it needs to be. Thank you for your time.
Sincerly,
Attachments:
SETDAC.c 2 KB
setdacwin.h 2 KB
setdacwin.uir 3 KB -
Lock-In amplifier capabilities
Hello,
I am using the Lock-In amplifier start-up kit. I generate an output waveform and get 2 inputs back - reference and measured signal.
I connected the output with a coax wire to the 2 input channels (using BNC-2120) in order to test the program and the results aren't good. When I increase the frequency of the waveform the results even get worse (up to 1000 Hz needed).
I am using PCI MIO-16E-1 (PCI 6070), max reading rate 1.25MSa/s, and I understand that the start-up kit was written to much lower rates. I have another DAQ card PCI-6143 which has A/D converter for each channel (I think) but do not have analog output. I thought about using this one as input only and the first one as output, but I don't know how to do it (need RTSI cable?)
I have 3 questions:
1. What is the best configuration for my purpose, 1 card or 2 different ones? (also available to me PCI-6154)
2. How do I synchronize 2 different cards?
3. How can I find the optimum input and output rates? What are the limitations (min/max requierments) of the Lock-In amplifier? Is it possible to see the censored parts?
I am using LabView8.0
thank you,
Noam.Hi Noam,
Without the PCI-6154, the best way to proceed will be to use a RTSI to synchronize the simultaneous sampling card with a card providing the analog output. The simultaneous sampling is essential for the lock-in amplifier. Additional reasons why this would be the best solution can be found in this article. There are examples in the Example Finder which show how to share the sample clock and a start trigger between the two cards. Instead of looking under Hardware Input and Output » DAQmx » Synchronization » Multi-Function, check under Hardware Input and Output » DAQmx » Synchronization » Multi-Device. There is also good information about synchronization and related topics such as signal routing across RTSI in this article.
The rates of both the analog output and input will be the same since you are sharing the sample clock. One thing to check is to make sure that the rate is at least twice as high as the highest frequency that you will be testing. It is not a bad idea of start off with a high rate to ensure that the sine wave that you are generating is smooth.
The error that you are seeing is a common overflow error. While you do not have to increase your buffer size to solve this error, you may have to read faster. The buffer size is different than the number of samples you acquire each time you call the DAQmx Read function. The number of samples to read each time can be changed by wiring a different value to the DAQmx Read function. If both of these values are set, then the way to make sure the buffer does not overflow is to call the DAQmx Read function more often. This will require making sure that there is nothing in the loop that is slowing it down. This may require moving all processing functions to a separate loop. There is more information on this error in this article.
Regards,
Kent
Applications Engineer
Digital Multimeter Home -
Hi All,
I have built a program that loads digital and analog signals onto three separate boards. The experiment only requires about 30 seconds worth of signaling but then should repeat over and over again until we have sufficient data gathered (the data will be gathered on a separate computer so no need to worry about that aspect). The ideal program would load the buffer, output the signals, once all the signals have been output, wait around 2 seconds for the components to return to the off state, and then repeat the output. I have tried using a sequence structure with identical frames running each frame for 32 seconds. I have also tried setting the sample generation to continuous samples, but neither of these solutions worked. Any suggestions would be greatly appreciated. I have attached my program which runs one iteration, then takes all the outputs to zero.maybe now
Attachments:
Analog program.vi 39 KB -
Lock-in amplifier VI to sideband
Hello,
I have a quesiton about modifying the lock-in VI shown here: <link no longer exists> I saw some threads that discussed a similar problem, but there were no clear answers.
We have a infrared signal that is modulated at 280KHz. This signal is interfered with an equal wavelength infrared beam that is modulated at 260 Hz, which then creates a sideband with a better signal to noise compared to just when locked-in to the 280 KHz signal. So, our signal is just one input, but our reference is ONE frequency, but comes from two mixed signals. Here are some pictures of the frequency spectrum showing where we want to lock-in and the setup of the experiment (see attachements). We actually want to lock-in at a sideband of the 3rd harmonic (3*280KHz+260Hz).
I imagine we can input the two references into a daq device, but how should we modify the Lock-in amplifier VI that NI provides ("lock-in amplifier example") to mix the two reference to make the harmonic sideband reference? Can I do this in Labview? We would greatly appreciate any help! The necessary hardware to do this operation cost $30k!!!! Thank you.
-Eric
Attachments:
simplified version of exp.png 16 KB
where in spectra to lock-in.png 17 KBEric,
I'll leave the math to you, but here is an idea, no idea whether it would work. (You can try the math in LabVIEW, without using a DAQ to see if you can get all three frequency components.)
The simplest mixer just multiplies two signals. Assume we have two sinusoidal signals at frequencies f1 and f2, when we multiply them the possible frequencies are f1 + f2 and f1 - f2; the sum and difference components. This is true if we have pure, ideal sine signals.
Now assume we have two square waves at frequencies f1 and f2. If you multiply them together, once again you get sum and difference components f1 + f2 and f1 - f2; however, the square waves contain all of the ODD harmonics, that is, 3f1, 5f1, 7f1, etc and 3f2, 5f2, 7f2, etc. So now you have sum and difference between all these possible combinations, including 3*f1 + f2. (In your earlier post you used the third harmonic, if you need the even harmonics then this will not work.)
Assume we have a function generator with 4 synchronous outputs, see if NI has one. In LabVIEW I can create the signals I want. For one ouput I put a square wave at f1, for another output I put a square wave at f2, for another output I put f1 times f2. That is I am doing all of the math for these signals. I can electronically filter bandpass the mixer ouput for the frequency I want, (hard to have that narrow of a filter) or I can use a math filter in LabVIEW before outputing to analog out for the frequency I want (probably easier). Now you can have phase synchronous signals at three frequencies. (Try the math in LabVIEW.)
Just saw what Lynn said, who is a lot smarter than me. I may be mistaken here, but the time constant on a lock-in amplifier sets the frequency discrimination; for example a 100ms time constant would give you a 10 Hz frequency discrimination. (Here I am referring to a stand-alone instrument, such as the SRS 844.)
Hope this helps.
Regards,
mcduff
Maybe you are looking for
-
Cannot open attachments in Mail
The only attachments I have tried to open are audio and video. I am using Firefox, and read about the plugins. They are up to date. Did not appear to be the problem. Unless I am missing something. I did clear the cache. Also, if this is related?
-
Is it possible to sort items by kind but always show folders first?
Hi, In column view, is it possible to sort items by kind but always show folders first? There's a hack explained here: http://www.bece.org/Home/tabid/36/EntryID/5/Default.aspx but by using this hack, in list view, the kind for folders is displayed as
-
Hi, Are there any inter-company experts out there? I have searched the forum but cannot find consistent, conclusive answers on this subject. We have 2 company codes linked, one buys from the other with inter company billing via idocs - this all works
-
Server and Presentation Variables and Displaying in Dashboard Report
Hello I am running into dead ends trying to get what seems a simple request implemented. The user would like to be prompted for a Date range and have the dates they select displayed in the Title of the report, they also would like the default data se
-
Massive Reduction in Broadband Speed
Hi, I am having woes with my BT Broadband Connection and am having absolutely zero joy in plotting a path through the indian call centre scripted process. It all began about 7 days ago when both my telephone stopped working and my broadband speed col