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 Nathanael,

 
Thanks for your hint, it helped me progress, in order to perform the "serial" step that you mentioned, I implemented a "Flat sequence structure"(see picture attached) with the 1st subdiagram taking care of inserting Y-axis value in 1st column of my excel file, and the 2nd subdiagram taking care of inserting X-axis values in the 2nd column of the same excel file. I just have a little bug with appending, basically my program appends data in "zigzag", in other words 1st set of Y_axis data in the 1st column, and 1st set of X-axis data in the 2nd column but starting at the row where Y-axis value end ( see excel file attach), I know that the problem is with the "Excel get last Row VI" which doesn't allow appending different sets of data in separate columns (work independently).
 
 
how can I resolve this issue ? 
 
Eric 
Download All
0 Kudos
Message 41 of 56
(6,415 Views)

Hi Eric, 

 

This is happening because you are calling the get last row twice. If you only call it once per loop iteration you should have all the data on the same rows. 

 

Also, instead of using a sequence structure, you can use the error wires (yellow/green and black) and reference wires (teal chain) to enforce dataflow. 

 

-Nathanael. 

National Instruments
Staff Certification Engineer
0 Kudos
Message 42 of 56
(6,411 Views)

Hi Nathanael,

 

Based on the hint you gave me last Friday, I was finally able to implement a loop with insertion and append in separates colummn (see attached picture). Basically the way it works is; I have a flat sequence structure in order to perform sequential insertion in different columns. I'm using a "select VI" on the "MS Office parameters " on the" Append Table to Report VI", to force initial insertions (at iteration i=0 ) on the beginning of the 1st column and 2nd column for X-values and Y-values. Therefore, subsequent iteration will use the "Excel Get Last row VI" to append at the appropriate place.
 
To come back on the issue I had addressed about setting columns with formulas that compute data inserted in the 1st or 2nd column, I tried the simple way of setting my 3rd column with a formula that applies on the entire or several rows of the 3rd column; however, it creates conflict with the append settings.
For example, once I apply a formula on the 3rd column (and applies it to 800 rows of the 3rd column) to manipulate data inserted in the 1st row, at the 1st iteration everything works fine, but at the next iteration, Y-values and X-values data are appended at the position that correspond to the 800th row, instead of appending at the row where last X and Y values data insertion occured. I think it is because the "Excel Get Last row VI" consider the 800th as last insertion since after the initial insertion the 3rd column formula compute on the entire 800th row, eventhough data available to be used on the formula were only inserted on the 400th row in the 1st column at the 1st iteration, and the remaining 400th row of the 3rd column will be by defaults set to 0.
 
So now I'm thinking about two possible alternative to try to address it, but I'll need your advice on it:
 
- 1st alternative: using several select that depending on the iteration number will predefine the place of next insertion. Question is can I have several wire coming form my selects all going to the same  "MS Office parameters " of the" Append Table to Report VI" ?
 
- 2nd alternative: performs all iteration with the loop, once the loop has terminated with all the data inserted in 1st and the 2nd column of the excell file, call a macro that will have the formula sets in the 3rd column, and run the macro on the excel file that has my data inserted in 1st and the 2nd column, in order to modify my excek file so it has the the 3rd column computed with the formula using data from the 1st column. Question is, how do I call the macro after my loop ends and applies the macro settings to my excel file that has the data.
 
As usual, waiting for you helpful advices
 
Eric
0 Kudos
Message 43 of 56
(6,401 Views)

Hi Eric, 

 

The MS office parameters is a cluster, you can access individual elements of this by using the bundle/unbundle or bundle by name/unbundle by name cluster functions. You shouldn't have to have multiple selects to insert data at regular intervals, especially if it is at a linear rate (e.g. insert 400 data points every iteration, 0-399, 400-799, etc) You should be able to just multiply the iteration terminal of the for loop by whatever constant to create that starting point (for this example it would be i*400). 

 

I'm not really clear on where you're inserting something in the 3rd column, but you are correct on the 'get last row' VI from the report gen toolkit. It will return the last row that there is -something- in. It does not distinguish between columns. 

 

I'm not familiar enough with Excel to know how to apply a macro, but it seems there is a run excel macro VI included in the report gen toolkit that may be helpful. http://zone.ni.com/reference/en-XX/help/372120A-01/lvoffice/excel_run_macro/

National Instruments
Staff Certification Engineer
Message 44 of 56
(6,394 Views)

 

Hi Nathanael,
 
Thank you again for you relevant info, I was finally able to implement a macro, that basically calls the excel file where I have stored all my X and Y values, and manipulate the results with the macro. The macro takes data from the 1st and 2nd column and perform some calculation on those data and insert the results in the 3rd and 4th column, with header on each column.
 
 
I finally wanted to graph/plot the data in the front panel. I'm using the Build XY graph VI (see attached picture) but it doesn't seems to work properly. Whenever I run my program, I have no plot being display at each iteration, even though I notice that X values are being changed/updated at each iteration.
 
Would you have an idea of how I could plot my data in the front panel. Futhermore, I would also like the plot to update itself at each iteration, meaning:
 
1st iteration: plot the 400 Y values and 400 X values for X in the range of 0.1Hz to 1 Hz
2nd iteration: plot 800 Y values (400 from 1st itetation and 400 of 2nd iteration) and X values (400 from 1st itetation and 400 of 2nd iteration )
3rd iteration: same as previous and continues up to the 6th iteration where it plots the 2400 Y values and 2400 X values.
 
Thanks in advance for your help and hints.
 
Eric
 
 
0 Kudos
Message 45 of 56
(6,384 Views)

Hi Eric, 

 

To get the data to show with additional points each iteration, you'll have to store it every iteration. You can use a shift register to do this. Basically you want a shift register for both the X and Y values, and you want to append the array each iteration with the latest values. 

 

The reason nothing is showing up at the moment is probably because the Y-input to the X-Y graph is multidimensional, X-Y graphs are expecting an array of data for the X values and the same number of points for the Y values. Try indexing the data and turning it into a single dimension array. 

 

-Nathanael

National Instruments
Staff Certification Engineer
Message 46 of 56
(6,378 Views)

Hi Nathanael,

 

Thank you again for tips, it finally works. I had a question, I just made a small program that takes data from and excel file and plot them in front panel of labview, but somehow the graph in front panel doesn't plot. I have a blank graph after I run the program. Would you have hints to solve this issues? I attached the code of the small program I wrote.

 

Thanks

 

Eric

Download All
0 Kudos
Message 47 of 56
(6,324 Views)

Hi Eric, 

 

You're wiring an empty array into the top part of the graph. I think you meant to wire the 'data' output of the first Get Excel Data.vi and not the empty template array. 

 

When troubleshooting VIs remember than you can use highligh execution and probes to see values of wires in real-time as the program is running. This can be very helpful in diagnosing problems similar to this. 

 

Best Regards,

 

Nathanael Letchford | Certified LabVIEW Developer

Applications Engineer | National Instruments

1-866-275-6964

National Instruments
Staff Certification Engineer
0 Kudos
Message 48 of 56
(6,320 Views)

Hi Nathanael,

 

Thank you again for your tips, it helped. I'm working on another small bug on my program, if you look at the picture attached(front panel picture), you'll see that the plot has some jump between decades that still can't figure out how to resolve them.

Basically my program takes data from the DSA and passed it too the "Data Coord Trans data.vi", which in turns send it to a section of my code that has series of array size.vi, index array.vi, and transpose 2D array.vi, that feeds a 2 build array.vi who will create a bundle through the bundle.vi to be passed to my xy graph(see block diagram picture).

I'm performing thermal noise measurement on the DSA, for decades between10Hz and 100KHz. Now on the DSA itself, whenever a measurement is done over a decades, data are collected a bit more over the decade, what I mean is this:

- Let says I'm on the 10Khz to 100Khz decade, the DSA will collect data between 10Khz and 112.4Khz. That happends for all the decades, it is a setting of the DSA itself.

Which means, that I"ll have data overlap between decades, which is still manageable, but the jump between decades I can't figure, does it have to do with the XY graph settings, may be data binindg or scales menu of teh XY graph ?

 

As usual waiting for your great help

 

Eric 

Download All
0 Kudos
Message 49 of 56
(6,314 Views)
Solution
Accepted by topic author er_10_1999

Hi Eric, 

 

I think this new question deserves a new thread. I'm not very knowledgeable about DSA measurements, and this thread has gone beyond the usual use case for forum support. For other customers to be able to help (this thread is buried pages deep- -nobody will see it), as well as for easier searchability for future customers it would be best for you to create a new thread regarding this question. 

 

I doubt that what you're seeing is due to the xy graph settings, as it just displays the data you send to it. I would check with the DSA manufacturer to see if they could help with the jumps over each decade. 

 

-N

National Instruments
Staff Certification Engineer
Message 50 of 56
(6,308 Views)