LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lockin amplifier

I am trying to bulid a VI for 7265 DSP lockin amplifier. I want that as I do the frequency sweep I should also be able to read the voltage readings at channel A for every swept frequency. I am finding it difficult to send the volatage and frequency readings to an array. I would appreciate if sombody tell me how to build an array from a continously changing scalar control which in this case is swept frequnecy.
0 Kudos
Message 1 of 3
(2,707 Views)
Hello,

I'm not sure that I completely understood your problem.
Do you have your code inside a loop? If so, just wire the scalar the wall of the loop, enable indexing, and when the loop is over you'll have an array.
Do you need your array inside the loop? You can use the build array function, but this is not very good because every iteration LabVIEW will have to reallocate memory for the new member of the array, so if you know the size of the array in advance, create it before the loop with build array, and then use a shift register and in each iteration use replace array element.
If this is not helpful, please be a little more specific about your problem and if possible attach some code to demonstrate it.

Hope this helps,
Paulo
0 Kudos
Message 2 of 3
(2,705 Views)
Hello,

Post the form of your data and I think I'll be able to help you do this very quickly! There are two cases which come to mind immediately IF you are getting the information in the form of "scalar strings" from an instrument ; I'll state them below and how to handle them:

1. You get the data point by point from a function in a loop.

In this case you can do as suggested above and simply perform any conversion to numeric type necessary (likely string to numeric; see the String/Numeric conversion palette - a subpalette of the String palette for help with this), and then use auto-indexing at the output of the loop to build an array of those values.


2. You get the data as a large string of values, likely delimited by commas or tabs.

In this case, you simply need to perform some string parsing. If the data comes as noted here, then you can use the spreadsheet string to array function (again in the string palette) and specify the delimeter of your choice. This function will take the characters between the delimeters, ignore white space, convert them to numeric type (ex. the string "1.23" -> the double float 1.23), and stick the corresponding numerics into an array. Note that if the string has end-of-line characters (such as linefeeds or carriage returns) then new rows will be formed and the result will be a two dimensional array. Here are quick examples: (note: let \n = linefeed below)

string input = "1.23, 3.45, 14.67, 8.655" will become an array with 4 values in it: 1.23 3.45 14.67 8.655

string input = "1.23, 3.45, 14.67, 8.655 \n 1.0, 2.0, 3.0, 4.0" will become a 2D array with the first row having 1.23 3.45 14.67 8.655 and the second row having 1.0 2.0 3.0 4.0.

Ok, I hope this helps; repost if you have any other questions!

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 3 of 3
(2,675 Views)