From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save one section of the sine wave data into file with start and stop control

I am new to labview so my explanation and problem can be very amateur.

My assignment required me to make a VI that collect a sinewave function and store the X(time) and Y(amplitude) to a text file( the data needs to have comma between them so it can be studied in excel). Also the VI should enable user to start data collecting and stop data collecting using boolean, each section of the data needs to be complied into the same text file. And here is the problem I ran into

1.I believe Write to Spreadsheet file can help me collect data, but it require a 2D array which I was trying to build a 2D array with time and amplitude. But I failed to make a 2D array, and the time is obvious not correct which i want to know how to make correct time for the 2D array.

 

2. If the previous problem is solved, what structure and control approach do I need to use to enable the VI start and stop data collection with boolean, and store that section of data into the file with previous section of data.

 

Sorry there is a lot of question to ask, and my explanation can be bad. A side note is the sine wave is running constantly, and operator should be able to intersect any period of Y axis data and store it in the text file.

Download All
0 Kudos
Message 1 of 3
(2,390 Views)

Hi Nick_ZHU351,

 

A few thoughts:

1. You could use a simple state machine architecture to allow you to pause and restart with a Boolean control. Below is a tutorial on using state machines in case you are unfamiliar. 

Tutorial: State Machines
http://www.ni.com/tutorial/7595/en/ 

 

2. I would use the generate waveform VI to create a waveform graph, then write to measurement file to save the data. I have included links to these VIs for your reference. 

Using the Write to Measurement File Express VI
http://digital.ni.com/public.nsf/allkb/CB46BC11A488621E86256D19005A386E

Sine Waveform VI
http://zone.ni.com/reference/en-XX/help/371361H-01/lvwave/sine_waveform/

 

Hope this helps. 

Message 2 of 3
(2,348 Views)

Thanks Sir, I will look into it

0 Kudos
Message 3 of 3
(2,342 Views)