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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparator realisation: input signal - waveform, threshold - double constant

Solved!
Go to solution

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.

 

0 Kudos
Message 21 of 24
(984 Views)
Solution
Accepted by topic author Pavel_47

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 22 of 24
(975 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 23 of 24
(970 Views)

Ok, I see.

Now it's clear.

Thanks a lot.

Pavel.

0 Kudos
Message 24 of 24
(964 Views)