From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-09-2016 05:53 AM
Ok 100kS/sec is banned for one sample at a time, but smaller values, i.e. less than 50kS/sec, can be used without problem, isn't it ?
For our task reading the one sample at time is the must, because this small example emulate problem from real testbend: once red value goes over certain threshold, something should start immediately.
I don't understand how to perform such task by reading a number of samples at once and than process the array.
Best Regards
Pavel.
02-09-2016 06:00 AM - edited 02-09-2016 06:04 AM
Hi Pavel,
less than 50kS/sec, can be used without problem, isn't it ?
The overhead to read just one sample is quite expensive. Please check your CPU usage when trying to keep up with 50kS/s in your AI loop!
Right now your maximum sample rate is limited by CPU power - and every little disturbance (aka jitter) will result in late processing of already acquired samples.
something should start immediately.
Please define "immediatly"!
My suggestion: read 100 samples at a sample rate of 100kS/s, this will be one data packet per millisecond. Considering the (not to underestimate!) jitter in a standard Windows application and the overhead in the DAQmx driver we surely can define this millisecond as "immediate reaction time"…
I think having a (more or less fixed) defined reaction of 1ms is better then to take the risk of processing "late" samples due to not being able to keep up processing with data acquisition!
When your timing has to more accurate you should think about using a RT target and maybe even the FPGA available in targets like cRIO/sbRIO!
I don't understand how to perform such task by reading a number of samples at once and than process the array.
We already suggested to use boolean array operations. Did you even try them?
02-09-2016 06:03 AM
Pavel_47 wrote: I don't understand how to perform such task by reading a number of samples at once and than process the array.
You just read a bunch of samples and see if any of them are above the threshold.
How much tolerance do you have for "immediately". If you can have a response in the 100ms or so, this should be no problem. If you need reactions within the 10ms or less, I would say you are in the wrong platform. Something like that needs a Real Time and/or FPGA approach.
02-09-2016 06:07 AM
Ok, I see.
Now it's clear.
Thanks a lot.
Pavel.