03-03-2013 05:36 PM
Hi everyone,
Letssaywehave3differentchannelsandwewanttologallthedatafromthosechannelsintoameasurementfile. Itsprettyeasy.(seeattachedvi)
now I want to add the possibility to my vi that gives the user an option to select which channel he/she wants to write in the measurement file. In this case we just want channel 1 and 3.
I add a Boolean to choose which channels I want but the problem is when it's a false case I need to assign something to the tunnel which means it writes "0" or "NaN" into my file. For just 3 channels its OK but if I have 100 channels then I want to get rid of those useless data.
After spending a lot of time I nearly come to believe what I've intended to do is almost impossible! (hope im wrong)
Thanks in advance
Solved! Go to Solution.
03-04-2013 12:35 AM
first let me correct my first line:
"Lets say we have 3 different channels and we want to log all the data from those channels into a measurement file. Its pretty easy.(see attached vi)"
guys I was thinking about an alternative, we can replace that "NaN" with empty("") in the *.tdms later. but im not sure how!
thanks
03-04-2013 10:11 PM
Hi,
I think the best solution will be to acquire the data just from channels 1 and 3 rather than reading all the channels. Or is there any specific reason why you need to read the 100 channels and then select which channels to save?
Richard,
03-05-2013 10:13 AM
well yes there is. its a huge project and I need to monitor all the channels to see whats going on but there is no need to save all of them.
is there any way to replace a specific value in Measurement files?
Regards
03-05-2013 08:32 PM
Are you working with several devices? Are you using the DAQmx VIs or the DAQ Assistant?
If you are retrieving most of the data from one device (let say the PCI-6255 that allow you to acquired 80 AI) you will be getting an array of waveforms of doubles that you can easily manipulate with the array functions (maybe Delete From Array) using an iterative algorithm and allowing the user to select which columns from the array will need to save (or delete) and then save the resultant array.
However, if you are using several DAQ Assistants that operation will be a little more complicated or you will need to add more logic to perform the task.
03-16-2013 02:34 AM
ok guys, its so funny. the answer is so simple. if you use a DAQMX then nothing will be written on the file but if you use a random number(like I did) its going to write either NaN or 0 in the file.
So funny!
Regards,
03-31-2013 09:29 PM
I come back with a new issue!
lets assume I need to get just 1 sample per second, since I can't put 1 in number of samples what should i do?
I setup my DAQ like this:
Acquisition mode= N sample
Samples to Read= 2
Rate=1
which reads 2 samples not one.
the other thing is if i use N sample the graph isn't continuous line. I want to draw a countinuos graph.
Thanks
04-01-2013 07:00 PM
ok just set your DAQ as follow:
Acquisition mode= continuous
Samples to Read= 1
Rate=whatever
and put controller for Samples to Read in your front panel and set it to 1.