LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to sum the numeric numberic samples generated by DAQMX each time?

Hello,
 
I'm using Analog input in DAQMX, I know that the DAQMX will output a singal, using array I can convert the singal to numberic results. As you can see, in the following diagram, I would like to sum the numberic samples and show the teacher how many singals it generate in a certain period. Is it possible to do so?
0 Kudos
Message 1 of 4
(2,540 Views)

Hello,

Your code will sum the values of all elements in the array. To get the number of elements in the array you could instead use an array size function.

Pelle S
Account Manager
National Instruments Sweden
0 Kudos
Message 2 of 4
(2,532 Views)
Thanks for the quick reply, but how could I set teh array size function? Is it set in the array or is it a new vi?

One problem I'm facing is in the DAQmx, I used N samples and set the no. of samples to read to 200. Then after the Array shows the sum of the first 200 samples, all samples are cleaned and for the rest of the time it just shows me the value of any 200 samples, it couldn't take the previous samples into account.


0 Kudos
Message 3 of 4
(2,506 Views)

all samples are cleaned and for the rest of the time it just shows me the value of any 200 samples, it couldn't take the previous samples into account.

What previous samples are you referring to if you are reading N Samples? Are you setting your VI to run continuously? If so, this is the incorrect way of doing things? From the above statement, it sounds like you want to acquire continuously. This requires a while loop. You can continually update the Sum by using shift registers to add the old Sum value to the sum of the newly acquired data.


show the teacher how many singals it generate in a certain period


Do you mean how many samples in a given period? How many DAQmx read operations? Could you please clarify on this. I attached an example image that may give you a good start on ideas of where to go next. Thanks

0 Kudos
Message 4 of 4
(2,478 Views)