Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Spectrum Analyzer

Dear Berk, Nathan and Dennis,
Thank you Dennis,

I got it and it was working well.
How to combine with time, I mean I want to make a graph the previous value (e.g. Y(200)) vs time, and then show on the graph.
So, vertical-axis is Y(200) value and horizontal-axis is certain time.
Hot to do it?

Again, it is possible to combine labVIEW application with VB application.
How to link it? Because some data value from VB is needed to be acquired as input in labVIEW application.

What do you think?

Thank you for hearing from you again.

regards,
basyarie
0 Kudos
Message 31 of 41
(2,823 Views)
Hi Basyarie,


It sounds like what you would need to do is to send your Y(200) array and bundle it with x0 and dx, similar to what you had done previously.

There is a good waveform example that can be found in Help > Find Examples > Fundamentals > Graphs and Charts > Waveform Graph.vi. You might be able to find an example of what you are trying to do there.

Also, what sort of data is it that you need to pass from VB to LabVIEW? You could possibly have it save data as a file in VB, and have LabVIEW read that file.
Rasheel
0 Kudos
Message 32 of 41
(2,787 Views)
Thanks Rasheel,

However, I looked at the sub VI of PSA Fetch.vi, x0 and dx are initial value and increment for "frequency" not "time". Isn't it?
So, I am not sure I can use it. What do you think?
I was seeing some example of waveform VI as you recommended, but still I do not understand which is better to use in my case.
In fact, I want to display the value of Y(200) in time plot countinously during the long time as we want.

Again, because I am also using VB for another purpose (i.e. retrieving & parsing GPS sentences and also combining with D/A pc card for special purpose), I actulally want to get "direction value" on the VB application as horizontal-axis for Y(200) in vertical-axis graph.
Is it possible in real time? If not, last sentence of your advice is the option?

Look forward for hearing from you again.

regards,
basyarie

0 Kudos
Message 33 of 41
(2,768 Views)
Dear Berk, Nathan and Rasheel,

Again, I was very sorry with my last questions make you in inconvenience.

Anyway, I made modification of Berk's application for Agilent  PSA analyzer.
See the screenshot on the attachment.

I have problems again that I want to grasp briefly why it was happened.

1. 1-D array (namely Y(200)) from Y 1-D array, when I show on the chart it was worked, but when I put on the spreadsheed indicator (string indicator on the front panel) it just one value or even I made a "buld array" function with "elapsed time" function it just 2 column values change by the time, not generating a spreadsheet of Y(200) value during the elapsep time.
Can you help me to solve it?

2. I made "loop" function  and then "spreadsheet save" function with flat sequence structure. With this structure I input the history data from Y(200) into buffer, and when I push the "stop" button, I could save it to .txt file.
Unfortunately, the file is written like in the attachment (.txt file figure).
Why it was happened? Sometimes I got it well but now I got failed data.

3. I would like to know the speed of the VI application can be performed. I saw my result is about every 2.2 seconds a data from Analyzer could be obtained. Can I get it faster (for example 1 second)? I've tried to grasp the sub VI Fetch Trace which include in my application, but I didn't understand it, especially about how long the communication time between computer and analyzer?

Thank you very much.

Sorry making you in troubles.

I look forward to hearing you again.
regards,
basyarie
Download All
0 Kudos
Message 34 of 41
(2,714 Views)
Hi Basyarie,

1) The inputs for Array Subset are index and length. Index is the first element of the subarray that you want to extract. Length is the number of elements that you want in your subarray. In this case you have 200 as Array Index, and 1 as Length. This means that the array you have now is only 1 element, which is element 200 on the original array. If you want to capture the first 200 points of data, you can do this by choosing 0 as array Index, and 200 as Length.

2) I could not quite see what you were doing on the right side of the VI, so if you could post another screenshot of the right side of the VI where you are writing to file, I could help you out a bit more. Also, the above change might affect things, so please implement the above and see how things change.

3) What are the first 2 VIs that you have after VISA Resource Name, before Fetch Trace? Are these VIs used to configure the device? You should be able to cut down on the acquire time by configuring only once, and running the Fetch Trace VI in the while loop only. So, pull the VISA Resource Name, Error and Maximum Time controls, along with the 2 VIs, outside the while loop to its left.

Let me know if you have any more questions or need clarifications on the above. Good luck!
Rasheel
0 Kudos
Message 35 of 41
(2,662 Views)
Dear Rasheel,

Thanks for your excellent advices, I got it and it was worked well. I could retrieve the analyzer data faster than before (around 0.13 second/one y value).

But, in case of saving the text data file I had a problem with the dimension of array. As shown in the screenshot (in attachment) that when I tunneled the 1D array (from the y chart) to the outside of "while looping" it automatically became 2D array. Why it comes?

So, in my saved spreadsheet data result consists of 2D array data. I've already used "reshape array" but it became 1 data only could be saved.
How come? How to solve it, let me know again..

Look forward to hearing you again.

Thank you very much.

regards,
basyarie
Download All
0 Kudos
Message 36 of 41
(2,641 Views)

With each iteration of your while loop, you create a 1D array and the autoindexing feature will create a 1D array where each row is the result from a single iteration. Autoindexing is a basic feature of loops in LabVIEW. If you want to save the result from each iteration, then leave the 2D array as is. Your picture is a bit difficult to see (post the actual VI instead) but it appears you are discarding most of your results. If you are uncomfortable with a 2D array, you can just place your file write inside the while loop or use a shift register and a build array inside the loop.

There are some basic tutorials on LabVIEW at http://www.ni.com/academic/lv_training/how_learn_lv.htm and there are some shipping examples on basic array manipulation that you can look at. It might also be beneficial for you to create a couple of extra indicators so that you can see exactly what the contents of the arrays are before you write to a file.

Message 37 of 41
(2,615 Views)
Dear Dennis,

Thank you for your advises.
I tried to put the "write file" function inside the "while loop" and add shift register instead of tunnel, but unfortunately I had some problem and the data could not retieved well. Only one data I got.

I attach my VI to get your advise again.

Let me know from you.

regards,
basyarie
0 Kudos
Message 38 of 41
(2,557 Views)
Dear Dennis,

Thank you for your advises.
I tried to put the "write file" function inside the "while loop" and add shift register instead of tunnel, but unfortunately I had some problem and the data could not retieved well. Only one data I got.

I attach my VI to get your advise again.

Let me know from you.

regards,
basyarie
0 Kudos
Message 39 of 41
(2,556 Views)
Hi basyarie,

I took a look at your code and still don't really understand what your VI is trying to do. How many points of data does the Fetch Trace return? How many sets of 200 points of data do you want to return? You still have the Index Data = 200 and Length = 1, which means that you will only be returning 1 point of data. You should have Index Data = 0 and Length=200 to return 200 points of data.

I have updated your VI to do what I think you might want it to do. I still do not understand why you have the fetch trace in the while loop.

Let us know!
Rasheel
0 Kudos
Message 40 of 41
(2,483 Views)