ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Spectrum Analyzer

Hello again basyarie,

We are glad to be of help.  NathanT summarized what you basically need to do for writing the data onto a file.  From this point on it more of a trial and error than a single set way of doing it.

One thing that I want to clarify is that the data type you probed is an array.  Therefore it is the collection of all amplitude values in the graph.  When you are creating your columns, those values correspond to the "value dB" column only and nowhere else.

Since you need the frequency value that each amplitude value corresponds to, you will have to build the frequency array yourself, the driver doesn't provide that for you.

Now if you look at the screenshot you posted, you will see three transparent comments: x0, dx, Y.
As I mentioned above, Y is the array that has all the amplitude values.
x0 is the first frequency value. Therefore it is the frequency that corresponds to the first element in Y.
dx is the step that should be added to get the next frequency that will correspond to the next element in the Y array.

In mathematical form:

Frequency of Y(0) = x0
Frequency of Y(1) = Frequency of Y(0) + dx = x0 + dx 
Frequency of Y(2) = Frequency of Y(1) + dx = x0 + dx + dx + dx = x0 + 2(dx)
.
.

Frequency of Y(n) = Frequency of Y(n-1) + dx = x0 + n(dx)

You can use a simple while loop to build this array and then use the techniques Nathan mentioned to write them into a file.

I hope it helps.

Good Luck!!

Regards,
Berk
Instrument Drivers / IVI
Message 21 of 41
(3,100 Views)
Dear Mr.Berk and Nathan,

Thank you for your replies again, I am very glad to share my problem with you.
I hope you do not get boried with me. 😉

I've already tried many times to write the signal data of the analyzer to save in file or just displaying on the front panel in string data.
So, I hope I am able to grasp the data from the analyzer, yet copy the displayed string data to my Excel.

I've made some modification of "Read Trace.vi" as shown in figure (front panel add spreadsheet string and in the block diagram I just tried to write the "Y" data to display on the spreadsheet string of front panel).
Unfortunately, when I ran the program it generated error message (it was realized before, since the RUN button is in 'break position'). See figure in attacment.
I found that when VI 'Array to Spreadsheet String' and 'Write to Text File" include onto block diagram, RUN button will be in 'break position'.
I checked in error message as above mentioned (in Japanese) written that some of library are missing.

How can I know its library, please guide me.
Why error message is generated and how can I solve such problem.
I need your help again in hurry, because I should make some experiment to receive signal from satellite. 😞

That's all.

Thank you very much.
Looking forward to seeing your reply again.

regards,
basyarie





0 Kudos
Message 22 of 41
(3,074 Views)
0 Kudos
Message 23 of 41
(3,073 Views)
Hello Basyarie,
          Please let us know which library is says is missing.  I am my no means a LabVIEW expert, but I think that doing a "Repair" on LabVIEW might install the library that is missing if it is one of the core libraries.  Which version of LabVIEW are you using?

Thanks,

NathanT
0 Kudos
Message 24 of 41
(3,043 Views)
Dear Nathan and Berk,

Sorry too late to reply. Last week, I did "repair" with our CD ROM as you  adviced, since I didn't know what kinds of library that missing when I added 'Write to Text File' and 'Array to Spreadsheet String' to the block diagram. Everytime I did, I failed and it couldn't execute.
I used LabVIEW version 8.2 with the Japanese Edition (all menu in Japanese). When I installed first time, I tried to install with complete installing.

Again, I found one vi namely 'Using Spreadsheet Format' in library "sprdsht.llb" in folder C:\Program Files\National Instruments\LabVIEW 8.2\examples\file .
I ran it and it worked as shown in Figure (attachment).

What the problem with my previous block diagram? I did mistakes?

Thank you very much.

Regards,
basyarie

0 Kudos
Message 25 of 41
(2,958 Views)
Hello basyarie,
        Does your application continue to give the same error as it did before?  I don't see anything on your block diagram that should cause problems.

Thanks,

NathanT
0 Kudos
Message 26 of 41
(2,930 Views)
Dear Nathan,

Yea, the latter VI I did nothing error, but my previous block diagram still continue error with same message.
Again, I tried to make in blank VI with "Write to Text File palette" then it was error (broken arrow). in Figure.

Should I re-install LabVIEW?

Thank you,
regards,
basyarie
0 Kudos
Message 27 of 41
(2,915 Views)

Hey Basyarie,

Your last screenshot would automatically have the broken arrow because that "Write to Text File" VI requires at least one input in the text terminal.  If you don't wire anything to that terminal, you will always get broken arrows.

Please try to mass compile your application that is giving you the errors (go to tools -> advanced -> mass compile and do this action in the folder that your application is in)

If that doesn't resolve the issue, try to rebuild the application from scratch using everything from palettes without copy - paste type of actions.

Let us know how it goes.

Regards,
Berk
Instrument Drivers / IVI
0 Kudos
Message 28 of 41
(2,899 Views)
Dear Berk and Nathan,
Thanks for your advices previously.

Some experiment I did last time ago, so I couldn't send you again about my problem.

I could solve my last problem (last screenshot) namely to get the data from array Y(amplitude). It was nice working.
See attachment (MS Excel figure).
With the same way I thinnk I can obtain for frequency data x and increment of dx.

Here, I would like to ask about "parsing an array data".
I mean, when I got array Y, it was group of numeric data from 0 until n data.
I got that your application is taken in 401 data or n=401 from 0 to n-1
For instance, I want to parse data Y(n=200), is it possible? Then, this point value bring to spreadsheet string on the front panel, just to know the value for certain running time.
How to do it?

Let me know.

Sorry to long time do not contact you again.

Thank you very much.

regards,
basyarie

0 Kudos
Message 29 of 41
(2,739 Views)

If what you are asking is how to do this in LabVIEW, then you just have to use the Array Subset function. Provide a start index and a length.

Array manipulation like this in LabVIEW is very basic. If you are having problems with things like this, you should really look at the free training available. You shouls alos always work with the Context Help turned on and refer to it often.

0 Kudos
Message 30 of 41
(2,732 Views)