This widget could not be displayed.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

automatic low frequency with labview 2010 and agilent 35670a

Solved!
Go to solution

Hi Eric, 

 

Is it set from a constant on the block diagram, or from a control on the front panel? If the latter, then the default value for the VI is probably set to 30000ms and you should reset the default value to 60000ms (right click ->data operations->make current value default). Or you could simply create a constant on the block diagram and set it to 60000ms. Make sure you save the file after applying changes. 

 

-N

National Instruments
Staff Certification Engineer
Message 21 of 56
(6,417 Views)

Hi Nathanael,

 

Thank you very, very much we finally fixed the delay problem, base on your info I had the "Actn Wait OPC.VI" set to a desired default value and it went fine. My final step now, is to be able to run my program for different decades that spans between 0.1HZ and 100Khz. In order to run the program so it performs measurement and save data at each decades, my idea was to put a for loop; however since I'm incremeting the "start frequceny" and "bandwith" value at each iteration, I was wondering how I set my loop so it increment "start frequceny" and "bandwith" at each iteration (on my block diagram "start frequceny" and "bandwith" are setting appearing on the "Conf Frequency FFT VI").

 

Furthermore, as of now I can save data with "Write to spreadshett file VI", and it also append data on the same file (txt file format) whenever I ran and another measurement, which is what I want, since I would like to have all the sets of measurement values in one file. Do you think there is a way, once all the measurements are done,with all the value ranging from 0.1Hz to 100Khz that are saved in the txt file,  to have them imported into an existing excel file in which I would have already set some columns with formulas to use the data imported. Because the link you gave me few weeks ago (http://www.ni.com/newsletter/51339/en/) doesn't seem to have a way of importing data from a text file to an excel file.

 

As usual waiting for helpful advice

 

Eric

0 Kudos
Message 22 of 56
(6,405 Views)

Hi Eric, 

 

Are you incrementing the 'Start Frequency' and 'Bandwidth' by a set amount every iteration? I.E. 1, 4, 8, 12? If so, you could multiply the iteration terminal of the loop by a constant to generate the desired value. If you have an arbritary value for each iteration of the loop, you could create an array with the values arranged such that each iteration of the loop autoindexes the correct value for the properties you are writing to. Eg. [1, 130, 84, 92, ...] and it would index the correct value each time. 

 

As for importing the data into an existing excel file, I am not familiar enough with excel to know if there is a way to do this or not. It may be possible through ActiveX controls, but there isn't much existing documentation on how to perform such an operation. It should be possible to perform your analysis in LabVIEW as well, which may be easier than trying to learn ActiveX to write it to an existing spreadsheet. 

 

-N

National Instruments
Staff Certification Engineer
0 Kudos
Message 23 of 56
(6,399 Views)

Hi Nathanael,

 

i'm basically incrementing the 'Start Frequency' and 'Bandwidth' with the same amount of 10, example below:

1st iteration: 'Start Frequency'= 0.1 and 'Bandwidth'=.9

2nd iteration: 'Start Frequency'= 1 and 'Bandwidth'= 9

3rd iteration: 'Start Frequency'= 10 and 'Bandwidth'=90

and so on up to 100Khz. 

I understand that I could multiply the iteration terminal of the loop by a constant, which in my case will be 10. now how do I make my 'Start Frequency' and 'Bandwidth' adjusted at each iteration with my constant value ? In addition to have my loop work, I guess I`ll to include the entire program I have developped ( the entire block diagram that I have so far)  inside the loop, am I right ? 

 

Eric

0 Kudos
Message 24 of 56
(6,396 Views)

Hi Eric, 

 

Yes, the entire program would have to be in the while loop. 

 

The iteration terminal is 0 indexed, so it looks like this: 0,1,2,3,4,...

 

You're not going to be multiplying by a strict value, you're multiplying by 10^n, so you would have to implement that math functionallity into your code. The easiest way I've found to do this is write out a table and figure out the math by hand and then implement it in LabVIEW.

 

National Instruments
Staff Certification Engineer
Message 25 of 56
(6,393 Views)

 

Hi Nathanael,

 

Just to give you a heads up of where I stand.Based on the information you provided me last friday, I was finally able to implement the loop, I basically inserted all my program in a "for loop", and using iteration index with "Power of 10" from the  "Elementary and Special function" palette and "multiply" from the "numeric" palette I was able to perform 10^n scaling for the the 'Start Frequency' and 'Bandwidth' at each iteration, and it works fine, I was able to run all range of frequency from 0.1Hz to 100Khz, with averaging at each decade and have all the data saved in text (.txt) file. As of now, the loop and delay work fine.

 

My current challenge as you know is still the excel feature. I downloaded the trial version of Report generation toolkit, and based on this example VI "2D array and Excel Append LV861.VI" (https://decibel.ni.com/content/docs/DOC-3404), I was able to save my Y-axis values (spectral density in V^2/Hz) in a pre-exsiting excel file, and even had the possibility to append new set of data at each measurement ( see the attach picture). I've tried to find a way by changing the settings of the "Append to table Report.VI", specifically the  "MS office parameters" to see if I could determine in which column my data will be inserted. I tried even some of the VI hierarchy and it still didn't work, for some reason, even changing "MS office parameters", for example "row=1, column =1" or "row=0, column =1", or "row=2, column =2" and using the "data operation" to set them as default values, it always results in my data always being saved and appended in the 1st column only, no matter the change of the settings in the "MS office parameters" of the "Append to table Report.VI".

 

 

Basically, what I want to achieve is to have my " frequency values"(X-axis value: 1D array double) and "power spectral density values"(Y-axis values 2D array double) that are coming out of the "Data Coord trans Data.VI" to be inserted and appended in two separate columns(colum 1: X-values, column2: Y-values) of a pre-existing excel file at each iteration. 

The current idea I have is, if I find a way to set the column entrance as desired to duplicate the code with the case structure that has excel(see attach picture) in order to have both X-values and Y-values calling the same excel file but on two seperate case structure (would this generate an error or not?)

 

Based on the VI from the "Report generation toolkit" woudl have a hint or idea of how I could proceed.

 

As usual, waiting for your valuable and helpful advices.

 

Eric 

0 Kudos
Message 26 of 56
(6,386 Views)

Hello er_10_1999

 

I'm not sure if these have been mentioned before but here are some links that might help with appending data to an existing Excel file.

 

http://digital.ni.com/public.nsf/allkb/EFCE1C25DCE7483E86256CAF00539451?OpenDocument

https://decibel.ni.com/content/docs/DOC-3404

 

Hope this helps!

Jonathan L.
Technical Support Senior Group Manager
National Instruments
0 Kudos
Message 27 of 56
(6,360 Views)

Hi Jonathan,

 

I went over the two link you provided, and the create two issues:

- 1st: the code at the following link (http://digital.ni.com/public.nsf/allkb/EFCE1C25DCE7483E86256CAF00539451?OpenDocument), allows insertion at a desired column, however what I want to achieve, is to perform insertion of 2 sets of data in separate column in one file. As you can see on picture attached, I have duplicated the code to see if I could write to the same excel file, but it generated error.

- 2nd: you can't have the same code to both perform insertion at desired column and appending.

 

As a summary what I want to achieve is this:

In the same excel file, on a the same worksheet, have two column: 1st column for my X-axis values and 2nd column for my Y-values, each iteration I want to be able to append my X-axis values in the 1st column and my Y-values in the second column.

 

Would you have any idea,

 

Thanks

 

Eric 

0 Kudos
Message 28 of 56
(6,351 Views)

Hello er_10_1999

 

Are you able to successfully append one of your columns? As in, are you sure that the method you are using will work if your application only needed to append data to one column? From looking at your code I'm not surprised you are getting an error (also what is the error; it's always a good idea to include that information). It looks like you are trying to open a document and append data....but then also trying to open same file again to append more data. You'll need to enforce data flow so that those two process' don't interfere with each other.

Jonathan L.
Technical Support Senior Group Manager
National Instruments
0 Kudos
Message 29 of 56
(6,338 Views)

Hi Jonathan,

 

Effectively the errort was that I was trying to open a document and append data in one column, and also trying to simultanously open the same excel document to append other set of data in another column.

To answer you question about being "succesful to append one column", yes that was possible with the code I used in my February 09th post, but this code allows only to append data in the 1st column only. Therefore I tried the other approach (see block diagram of my post from February 12th), since it allows the selection of which column you want to perform insertion. 

 

Unfortunately both code don't work to address my situation, basically here is my challenge:

 

"The Data Coord trans Data VI"(which is a Agilent 35670A drivers feature VI, see my block diagram from the Feburary 9th and 12th post), is one that collect the data from my Agilent 35670A DSA(Dynamic Signal Analyzer), as an output it produces 2D array of data for Y-axis values, and 1D array of data for X-axis value.

Therefore, what I'm trying to implement, is to use Generation toolkit feature or other VI, in order to have my 2D array of data for Y-axis values, and 1D array of data for X-axis value inserted and appended in separate columns of the same excel file. For example, when I ran my 1st iteration of measurement the "The Data Coord trans Data VI"  will output 400 data for Y-values and 400 data for X-values, and from there I want to save my 400 Y-values in say the 1st column of my excel worksheet and the 400 X-values in the 2nd column of  the same excel worksheet, and in the next iteration of measurement my next 400 Y-values will append on 1st column of my excel worksheet and the 400 X-values in the 2nd column of  the same excel worksheet, and so on until I finished all my iterations.

 

As of know, the code I have described don't seems to work together, and they have flaws, since one (block diagram of February 9th post) allows insertion and appending in only the 1st column, no other column of the same excel worksheet can be used to insert or append, and the other allows insertion at desired column, but can't perform simultaneuous insertion in two separate column.

 

In your reply you mentioned about "enforce data flow so that those two process' don't interfere with each other", do you mean that I have to cacsade somehow the data flow, for example I open the excel perform insertion on 1st column, close the excel file, and reopen the same excel file perform insertion in the 2nd column and close the excel file, before moving to the next iteration of measurement, or you were referring to something else ??

 

Thanks

 

Eric 

0 Kudos
Message 30 of 56
(6,331 Views)