Discussion:
Retrieving data from Spectrum Analyzer using LabVIEW 8
(too old to reply)
BerkO
2008-02-18 19:40:10 UTC
Permalink
Hello Basyarie,
 
Welcome to the NI discussion forum.  In the future, please create a new thread for a new question so that we can keep track of things better.
As for your question, you can find information on how to use instrument drivers <a href="http://zone.ni.com/devzone/cda/tut/p/id/2804" target="_blank">here</a>.
All of our certified drivers contain examples which demonstrate the basic operation of the instruments. You can refer to the examples and easily modify them to acquire the desired measurement.
&nbsp;
Both of the drivers that you need&nbsp;only support GPIB.&nbsp;If the instrument that you have has serial interface you would have to modify the Initialize VI to set the VISA serial settings to match the settings of your instrument.&nbsp; I would recommend using GPIB over serial since VISA takes care of GPIB communcation completely without you needing to change settings.
&nbsp;I hope it helps. Please post any furter questions under a new thread. Thank you! Good luck.
BerkO
2008-02-21 16:10:13 UTC
Permalink
Hi Basyarie,
I looked at your&nbsp;screenshot for E4403B&nbsp;and tested the same input with the instrument that I have here (E4404B) and the code seems to run fine without any problems.&nbsp; Did you do any modifications to the sub VIs?&nbsp; Also what version firmware is the instrument running? (You can check this by running the Revision Query VI.&nbsp; It will tell you what firmware you are running in the "Instrument Firmware Revision" indicator.)&nbsp; I would recommend upgrading to the latest firmware.
Another question i have is, what USB to GPIB converter are you using? Is it an NI product or a different companies product?&nbsp; It is always best to go ahead and run the latest driver cd to update the system software components such as VISA and drivers.
Let me know if these don't help, then we can try and figure out which exact command is causing the error.
As for the Anritsu MS2663B driver, I don't have the instrument with me and the driver wasn't developed here so I'm not familiar with it.&nbsp; However the error code you are getting translates to
"VISA:&nbsp; (Hex 0xBFFF0038) Bus error occurred during transfer."&nbsp; So there might be a problem with the GPIB interface you have.
&nbsp;
Let me know what you find out.
&nbsp;
basyarie
2008-02-26 05:40:09 UTC
Permalink
the attachments that I would like to upload.


Configure Sweep Coupling.gif:
http://forums.ni.com/attachments/ni/140/28340/1/Configure Sweep Coupling.gif


GPIB-USB-HS.gif:
Loading Image...


Revision Query.gif:
http://forums.ni.com/attachments/ni/140/28340/3/Revision Query.gif
basyarie
2008-02-27 03:40:07 UTC
Permalink
Dear Mr. Berk,

I knew that firmware A.14.04 is the latest version, but I didn't
installed it since I need to upgrade my analyzer (because no option B72
-enhanced memory-). Then I installed firmware A.07.06 since it didn't
need option B72, unfortunately I couldn't execute all VIs examples well
in particular for Configure VI files.

If I instal A.14.04 I need to upgrade my current analyzer memory into
32 MB DRAM SIMM. To perform this, it takes more time from purchasing
till installing with some procedures into analyzer system.

Hence, I would like to ask you, is there any option test that I can do
with LabVIEW 8.2 to communicate and save data (e.g. into MS Excel file)
using my current analyzer? Let me know.

I've been modifying some sub VIs files, some of them are working well,
others are not OK, in particular Configure sub VIs files. They are some
error message which generated during execution.

Could you help me?

Thanks a lot,
regards,
basyarie
BerkO
2008-02-27 15:40:13 UTC
Permalink
Other screenshots...


MAX.JPG:
Loading Image...


Commands.JPG:
Loading Image...


Communicator.JPG:
Loading Image...
basyarie
2008-04-11 03:10:10 UTC
Permalink
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
NathanT
2008-04-11 14:10:11 UTC
Permalink
Hello Basyarie, &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; Please let us know which library is says is missing.&nbsp; 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.&nbsp; Which version of LabVIEW are you using?Thanks,NathanT
basyarie
2008-04-21 02:10:07 UTC
Permalink
Dear Nathan and Berk,

Sorry too late to reply. Last week, I did "repair" with our CD ROM as
you&nbsp; 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


Using Spreadsheet format vi.JPG:
http://forums.ni.com/attachments/ni/140/29328/1/Using Spreadsheet format vi.JPG


Using Spreadsheet format vi (front panel).JPG:
http://forums.ni.com/attachments/ni/140/29328/2/Using Spreadsheet format vi (front panel).JPG
NathanT
2008-04-21 14:10:16 UTC
Permalink
Hello basyarie, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Does your application continue to give the same error as it did before?&nbsp; I don't see anything on your block diagram that should cause problems.Thanks,NathanT
basyarie
2008-04-21 14:40:17 UTC
Permalink
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


blank VI.JPG:
http://forums.ni.com/attachments/ni/140/29343/1/blank VI.JPG
BerkO
2008-04-21 15:10:11 UTC
Permalink
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.&nbsp; 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&nbsp;tools -&gt;&nbsp;advanced -&gt; 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.
basyarie
2008-05-21 01:10:09 UTC
Permalink
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-1For 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


result (in MS excel).JPG:
http://forums.ni.com/attachments/ni/140/29911/1/result (in MS excel).JPG
Dennis Knutson
2008-05-21 01:40:12 UTC
Permalink
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 <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">training</a> available. You shouls alos always work with the Context Help turned on and refer to it often.
basyarie
2008-05-22 01:40:11 UTC
Permalink
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
Sputnikrent
2008-05-23 16:40:10 UTC
Permalink
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 &gt; Find Examples &gt; Fundamentals &gt; Graphs and Charts &gt; 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.
basyarie
2008-05-25 00:40:09 UTC
Permalink
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 &amp; 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
basyarie
2008-05-30 03:10:08 UTC
Permalink
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&nbsp; 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&nbsp; 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


text file result.JPG:
http://forums.ni.com/attachments/ni/140/30137/1/text file result.JPG


front panel.JPG:
http://forums.ni.com/attachments/ni/140/30137/2/front panel.JPG


block diagram.JPG:
http://forums.ni.com/attachments/ni/140/30137/3/block diagram.JPG
Sputnikrent
2008-06-02 15:10:21 UTC
Permalink
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!
basyarie
2008-06-04 03:10:11 UTC
Permalink
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


screenshot 3.JPG:
http://forums.ni.com/attachments/ni/140/30226/1/screenshot 3.JPG


screenshot 1.JPG:
http://forums.ni.com/attachments/ni/140/30226/2/screenshot 1.JPG


screenshot 2.JPG:
http://forums.ni.com/attachments/ni/140/30226/3/screenshot 2.JPG
Dennis Knutson
2008-06-04 14:10:12 UTC
Permalink
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 <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">http://www.ni.com/academic/lv_training/how_learn_lv.htm</a>&nbsp;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.
basyarie
2008-06-11 06:10:10 UTC
Permalink
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


my code.vi:
http://forums.ni.com/attachments/ni/140/30356/1/my code.vi
basyarie
2008-06-11 06:10:11 UTC
Permalink
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


my code1.vi:
http://forums.ni.com/attachments/ni/140/30357/1/my code1.vi
Sputnikrent
2008-06-18 17:10:18 UTC
Permalink
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!


my code1.vi:
http://forums.ni.com/attachments/ni/140/30471/1/my code1.vi

BerkO
2008-02-27 15:40:13 UTC
Permalink
Hello again Basyarie,
&nbsp;
I didn't realize you had didn't have the memory module installed, sorry for the previous confusion.&nbsp; I have a better understanding now.&nbsp; I took another look at the revision history of the firmware and it seems that they have made a lot of improvements (specifically for the sweeping) in A 8.2 and A 9.0 firmware upgrades.&nbsp; To work around the commands that you are having trouble with, what you need to do is figure out exactly which commands are causing the errors and either resolve the condition that causes them to be rejected (due to a bug in the instrument) or take them out completely (because they might be missing in your particular firmware version).
&nbsp;
I will use the VI we were previously using, "Configure Sweep Coupling.vi" to demonstrate what I believe is the best way to figure it out. So here it goes:
&nbsp;
1) Set a breakpoint (right click on the block and select "Set Breakpoint")&nbsp;on VISA&nbsp;Write block&nbsp;in the Configure Sweep Coupling VI block diagram. &lt;a&nbsp;href="Loading Image..."&gt;Here&lt;/a&gt; is the screenshot.

2) Create a probe (right click on the&nbsp;wire and select Probe)&nbsp;at the string line going into the VISA Write "write buffer" terminal.&nbsp; It will create a small new window which will give you the realtime value of the wire while the VI is running. &lt;a&nbsp;href="Loading Image..."&gt;Here&lt;/a&gt; is the screenshot.
3) Configure the VI on the front panel (put in the visa resource, the values you want, etc.)
4) Run the VI.&nbsp; It will stop at the VISA Write and blink on the block.&nbsp; Also notice that your probe window is now filled with the commands that were going to be sent to the instrument. &lt;a&nbsp;href="Loading Image..."&gt;Here&lt;/a&gt; is the screenshot.
5)&nbsp;Copy the commands to notepad.&nbsp; Arrange it so that you have one command per line. (Each command is terminated by a ";", therefore you can simply press enter after every semi-colon) &lt;a&nbsp;href="http://forums.ni.com/attachments/ni/140/28372/2/Commands.JPG"&gt;Here&lt;/a&gt; is the screenshot.
6) Launch Measurement &amp; Automation Explorer (MAX), find your instrument (most probably under the Devices Interfaces -&gt; GPIB tab) and select it. &lt;a&nbsp;href="http://forums.ni.com/attachments/ni/140/28372/1/MAX.JPG"&gt;Here&lt;/a&gt; is the screenshot.
7) Click on "Communicate with Instrument", it will open a new window to send commands to the instrument. &lt;a&nbsp;href="http://forums.ni.com/attachments/ni/140/28372/3/Communicator.JPG"&gt;Here&lt;/a&gt; is the screenshot.
8) Open the "Error Query" VI from the instrument driver (under Utilities palette).&nbsp; Configure the VISA resource.
9) Send&nbsp;a&nbsp;command through the communicator by pasting it into the "Send String" field and then pressing "Write"
10) Run "Error Query" to see if that command causes an error. (Specifically the one that you have seen before)
11) Repeat for every command that you pasted on notepad and take a note of the ones that are causing the error.
12) Remove the parts that use or modify the erronous commands so that the VI's will run without a problem.
After doing this, the VI's will work since you took out all error causing commands but you will have to configure the features that are taken out manually if the instrument supports them in your firmware version.
After getting everything to work, you can use the "Read Trace" VI to acquire a trace onto your computer.&nbsp; Then you can use the LabVIEW "File I/O" palette to write the data to a spreadsheet or however you want to store it.
Let me know if you have any questions.Message Edited by BerkO on 02-27-2008 09:38 AM


Run.JPG:
http://forums.ni.com/attachments/ni/140/28371/1/Run.JPG


Breakpoint.JPG:
ht
basyarie
2008-04-09 03:10:08 UTC
Permalink
Dear Mr.Berk, Long time I didn't ask you again, I am sorry.Last time, I was facing a confucing configuration to acquire the spectrum data onto the computer, but now I am gradually able to understand how the program is running by follow your instruction and advices.So far, I've already done what you suggested in the previous reply i.e to figure out the problem, we need to explore the block diagram pallete in more details.Okay, I tried to do it and the result (first I ran the program "ESA PSA Series Acquire Trace.vi") :- after figure out "Configure Sweep Coupling.vi" I found some error. and already revised and finally the error was not coming again.- but I have error on VI "Configure Acquisition.vi" and then tried to find where the error was generated. With the same method as you adiviced me previously (by launching MAX through communicator), I didn't find error. In this case, I am confucing now.However, although there are some error as above mentioned, I tried another VI namely "Read Trace.vi" (as you replied before) in the Data folder.As a result I got the data from the spectrum analyzer onto the computer (see the attachment).But, I don't know how to save the data into the spreadsheet like MSexcel etc, please teach me how to build it by File I/O facilities.I tried but failed. In array data I want to make like a column spread data which contents:| frequency [GHz] | value dB ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; -10.89&nbsp;&nbsp;&nbsp; ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; -20.87&nbsp;&nbsp;&nbsp; |Second, actually I want to grasp the real value of "Y" axis output from analyzer.How can I know it? I've already find it, but it didn't match the value on analyzer.For example, I read on analyzer at frequency 2.5 GHz the value of signal is -10.56 dB (in Logaritmic div), but on the block diagram is written -12.251. (see attachment) Why is it different? same case for Trace Array no. 1 which is twice value than no.0. How come? I really didn't understand.Those are my problem here want to share and need a solution.I am to be grateful if you give some advices again.Thank you very much.regards,basyariechiba, japan&nbsp;
NathanT
2008-04-09 14:10:14 UTC
Permalink
Hello Basyarie, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am happy to hear that you are getting data.&nbsp; It looks like the signal values are different because you are comparing the value at 2.5 GHz to the one at 0 GHz (element 0 in the array).&nbsp; I recommend that you look through the array and find the element that corresponds to the value at 2.5 GHz.&nbsp; It should match the data on your graph.&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; For writing data to an excel file, I recommend that you start out by using the <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/glang/write_to_spreadsheet_file/" target="_blank">Write To Spreadsheet File VI</a>.&nbsp; Once you are familiar with the use of that VI, then move on to adding the column labels that you would like.&nbsp; You can also control Excel through ActiveX and there are examples in LabVIEW that show how to do that. Cheers,NathanT
BerkO
2008-04-09 16:40:10 UTC
Permalink
Hello again basyarie,
We are glad to be of help.&nbsp; NathanT summarized what you basically need to do for writing the data onto a file.&nbsp; 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&nbsp;probed&nbsp;is an array.&nbsp; Therefore it is the collection of all amplitude values in the graph.&nbsp; 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&nbsp;array.
In mathematical form:
Frequency of Y(0) = x0Frequency of Y(1) = Frequency of Y(0) + dx = x0 + dx&nbsp;Frequency of Y(2)&nbsp;= 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!!
basyarie
2008-04-11 03:10:10 UTC
Permalink
Here the attachment.


Write to text file front panel.JPG:
http://forums.ni.com/attachments/ni/140/29130/1/Write to text file front panel.JPG


Write to text file block diag.JPG:
http://forums.ni.com/attachments/ni/140/29130/2/Write to text file block diag.JPG


Write to text file error message.JPG:
http://forums.ni.com/attachments/ni/140/29130/3/Write to text file error message.JPG
basyarie
2008-04-09 03:10:08 UTC
Permalink
Here, the attachment.


Trace1_trace array_value_different_logaritmic.JPG:
http://forums.ni.com/attachments/ni/140/29080/1/Trace1_trace array_value_different_logaritmic.JPG


Trace1_front panel_linear.JPG:
http://forums.ni.com/attachments/ni/140/29080/2/Trace1_front panel_linear.JPG


Trace1_front panel_logaritmic.JPG:
http://forums.ni.com/attachments/ni/140/29080/3/Trace1_front panel_logaritmic.JPG
Loading...