02-20-2020 07:24 AM
Hi,
i´m trying to read from a channel with two tasks.
Unfortunately i´m not able to get attributes correctly from waveforms.
Can me someone explain my failure?
Solved! Go to Solution.
02-20-2020 07:46 AM
Hi Hulk,
@Hulk1978 wrote:
i´m trying to read from a channel with two tasks.
Unfortunately i´m not able to get attributes correctly from waveforms.
There is only one DAQmx task defined in your VI, containing two channels.
Which "attributes" are you missing?
Do you get any samples from your task?
Do you get any errors from DAQmxRead (or earlier)?
02-20-2020 07:51 AM
@Hulk1978 wrote:
i´m trying to read from a channel with two tasks.
Your terms are backwards. You have 2 channels inside of a task. Your DAQmx Read performs a task read and gives you an array of waveforms, each element from a channel in your task.
@Hulk1978 wrote:
Unfortunately i´m not able to get attributes correctly from waveforms.
You have doing Continuous Samples with 1 sample per channel in the buffer. That makes 0 sense. Just delete the 1 and let the buffer be whatever defaults DAQmx uses. Your next issue is your DAQmx Read. You are telling it to read, by default, whatever samples are currently available. If your loop is running fast enough (which it is), it will return 0 samples because there is no data in the buffer. Since you are reading a sample every 100ms, I would change the DAQmx Read to use the N Channels, 1 Sample, 1D Waveform instance (use the polymorphic selector). Then your DAQmx Read will wait for the 1 sample to come in. Incidentally, this will also limit your loop rate to approximately match that of your sample rate.
02-21-2020 03:23 AM
Yeah.
Thanks to all.
Now my array is filling with data.
It´s a little bit difficult to understand the differences at reading.
BTW...yes i have one task with two channels, not different tasks.
Have a nice weekend