09-28-2017 02:59 AM
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.
09-29-2017
12:13 PM
- last edited on
11-07-2024
05:58 PM
by
Content Cleaner
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
https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...
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
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8jASAS&l=en-US
Sine Waveform VI
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/analysis/1siggen-llb/sine-wave-vi.h...
Hope this helps.
09-29-2017 12:46 PM
Thanks Sir, I will look into it