10-15-2019 07:20 AM
Hi,
following situation. I want to log one temp sensor and one voltage sensor
Every one is creating data in a separate producer while loop and sending it with queue to a common consumer loop.
What is the reason that the shown graph of voltage is slow as the temp sensor?
Thanks
10-15-2019 07:27 AM
Turn on highlight execution and learn!
Are your two producer loops running at different rates? Your voltage one is running at about 50 Hz (1 sample every iteration of 50 Hz sample rate). The temperature one is rather undefined. It is running as fast as it again which means it is basically the default acquisition rate of that DAQ module.
So if one is running faster than the other, it is queuing up data faster in that loop. But when you go to remove the data via the queue, you are only grabbing 1 at a time from each. That consumer loop can only run once each queue as acquired an element. So they are dequeued at the same rate, and the faster producer it proceeding to fill up its queue until eventually you run out of memory.
Change your architecture. Consider using a notifier, or even just a local variable for the slower acquisition.
10-15-2019 07:45 AM
Do you really need the voltage read at a different rate than the temperature? Could you put both on the same DAQ board and therefore make a single task for reading both the temperature and the temperature.
10-15-2019 09:15 AM
Hi,
the voltage is in future a pressure sensor with 100ms. It´s needed. The temperature sensor is fixed by hardware with 4 sample / second
10-15-2019 09:48 AM
@Hulk1978 wrote:
The temperature sensor is fixed by hardware with 4 sample / second
By what hardware? You are just using a DAQmx task. So I don't see why you couldn't just go ahead and sample the temperature at the 10Hz (100ms) along with the pressure sensor. 1 task = simpler life.
10-15-2019 09:57 AM - edited 10-15-2019 09:58 AM
I'm getting Buffer Error, at the try for higher Sample rate.
Error -200279
This was the reason for the Producer loops. I Don t have so much experience. Time by time i try to improve my small measurement vi.
Actually i'm Testing queues and notifiers .
Hardware is a USB 6008or 9 and a tc01
10-15-2019 10:02 AM - edited 10-15-2019 10:03 AM
That's because you are trying to only read 1 sample of the higher speed device at a slower rate.
Trying reading N samples or all available samples (-1) of the higher speed device. You'll get an array of multiple samples you can then process.
10-15-2019 10:16 AM
Do you have an example?
I will Check tomorrow.
Thx
10-15-2019 10:28 AM - edited 10-15-2019 10:29 AM
@Hulk1978 wrote:
Do you have an example?
10-16-2019 11:55 PM - edited 10-16-2019 11:58 PM
Good morning,
with this version i´m getting error -201426 at sample clock. vi. At least one device does not support tasks with multiple devices.
I think, it´s the temp sensor