LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Data to a file/Multiple Analogue Inputs

Hi

I want to write the x,y data of a spectrum graph to a file in the C drive as x vs y( as frequency data column and the respective amplitude data column). The following programme only write the y axis data. Also I need to record y axis data which exceed a certain threshold rather than all the y axis data. For example greater than 5. The ascii file can be opened by any text editor.Any idea on how to tackle this. (The main vi is in this page. The next message page will give the sub vi. Open both)

Mal
0 Kudos
Message 1 of 7
(3,216 Views)
try this example. THis might help. could you put your x and y data into a two d array like in my example. This will create tab delimited columns. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 7
(3,200 Views)
Hi

Thank you for the advice. But do you know how I can build an array from the fo and df (DBL) data from the unbundle function in the programme. I would be greatfull if the modification can be done in the programme.

Mal
0 Kudos
Message 3 of 7
(3,189 Views)
Try this. I took your two values from the top and bottom and created arrays for each using autoindexing terminals. After I created both arrays I built them into a 2d array. Using the previous example I turned them into a tab delimited string and then simply by using the write chars to file vi you will have your output files. I think this is what you are asking for. I moved the file I/O outside the loop so you are not wasting cpu by opening and closing the file every time the loop iterates. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 4 of 7
(3,186 Views)
Hi

Thanks for the programme.It gives the array for the x axis. But it only gave two rows. ( It should have given 0 24.xxx 48.xxxx and so on ). I have appended the saved file. Also how can include the y axis data.
What I want is x data column and a y data column.

Thanks

Mal
0 Kudos
Message 5 of 7
(3,168 Views)
try this. Sorry. I wasn't thinking right. This should help.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 6 of 7
(3,164 Views)
Hi

Thanks for the help. I tried this but data doesn't get copied to a folder. When I checked the data flow with the highlight execution button it gives a 200279 daqmx read error. Can you please check it. Also how can I copy the yaxis data in the program ( the array data of the unbundle function).

Many thanks

Mal
0 Kudos
Message 7 of 7
(3,151 Views)