05-07-2013 08:38 AM
Well guys, I'm trying to start a task of 8 channels ( In the code I didn't put the channels because my daq isn't connected to PC) read the values, write it on a file and show it as a waveform graph.
I created a channel first with DAQmx create channel, after that I used DAQmx timing to put how much samples I need in a second, so I started a task, read it with DAQmx read and write with DAQmx Wirte.
Is that sequence correct?
Another question is, after I write, how can I show the data in a waveform graph? Because the output of DAQmx write is only the number of samples and the task.
Thanks
05-07-2013 08:51 AM - edited 05-07-2013 09:05 AM
@EduU wrote:
Well guys, I'm trying to start a task of 8 channels ( In the code I didn't put the channels because my daq isn't connected to PC) read the values, write it on a file and show it as a waveform graph.
Is that sequence correct?
Another question is, after I write, how can I show the data in a waveform graph? Because the output of DAQmx write is only the number of samples and the task.
Thanks
if you are writing to a file...then write to a file , not the a write daqmx function(that is used for AO purposes). use the file i/o pallette.(write to spreadsheet file)
again, to show the data waveform graph...use the file i/o(read from spreadsheet file) to extract the data and use it with the waveform graphing functions.
05-07-2013 08:54 AM
Have a look at this example that ships with LabVIEW
C:\Program Files\National Instruments\LabVIEW 2012\examples\DAQmx\Analog Input\Voltage - Continuous Input.vi
05-07-2013 08:56 AM
So I have to write to a text file? Or how can I wirte to a I16 file?
Because my data is a 2D I16, Can i save it as text and after read it as text and plot in a waveform graph?
05-07-2013 08:59 AM
I don't see why you are putting the date/time string to the channel name. That is really unnecessary.
If you are performing continuous samples, don't limit the buffer size. That is just asking for trouble. Leave the Number of Samples on the DAQmx Timing node unwired.
If you are doing an Analog Input task, you can't write to it. DAQmx Write is only used for outputs.
After you read that data with the DAQmx Read, you just wire the output to a chart.
Don't forget to stop and clear your task.
05-07-2013 09:01 AM
EduU wrote:
Because my data is a 2D I16, Can i save it as text and after read it as text and plot in a waveform graph?
Why is it a 2D array of I16? Don't use the raw data. That just makes things confusing. And you only have 1 channel. Use the Single Channel->Multiple Sampes configuration of the DAQmx Read.
05-07-2013 09:04 AM
Cross, I limit the buffer size because I need do it, I need have only 7200 samples per second, this can get me some problems?
I understand your code, but this is only to read and show in a graph, How can I save it in a file, and after when I want to see this file
I read it again?
Write to a TDMS? Text? Binary? Which format is better for my application? Because the data I'm aquiring is I16.
05-07-2013 09:05 AM
apok wrote:again, to show the data waveform graph...use the file i/o to extract the data and use it with the waveform graphing functions.
Why are you telling the OP to write the file and then read it again to graph? Just use the data straight from the DAQmx Read to graph the data!
05-07-2013 09:06 AM
This is only an example so I can understand it and made my own code, in my program I will need 8 channels this is why I have a 2D I16.
I didn't put the channels because my DAQ isn't connected to PC.
05-07-2013 09:10 AM - edited 05-07-2013 09:12 AM
@crossrulz wrote:
Why are you telling the OP to write the file and then read it again to graph? Just use the data straight from the DAQmx Read to graph the data!
do you want me to list every possible way he can do this? obviously to read a graph,"wire directly to it."....dooooh
i assumed to read it at a later time from the file data, i was not going to the assumed obvious
note to self: get a crystal ball