LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer/Consumer for Analog Input/Output, consumer loop not running

Solved!
Go to solution

Hi,

 

I am trying to acquire data at around 50KHz and then output data at the same sampling rate (or lower). I'm using a Producer Consumer design as suggested by others on the forum. Previously, I was getting an issue with DAQmx Write because I did not initialize a buffer for my consumer loop. Now after adding the buffer, the consumer loop doesn't even run/initiate; the consumer loop iteration displays zero. What are some possible explanations for why the consumer loop is not running and how can I fix this?

 

I have attached the VI. I am using LabView 2015 with the NI USB-6212 BNC. 

 

Thanks

0 Kudos
Message 1 of 2
(2,837 Views)
Solution
Accepted by topic author WCSRI

Hi WCSRI,

 

What are some possible explanations for why the consumer loop is not running and how can I fix this?

Reason: you didn't implement proper DATAFLOW!

Solution: THINK DATAFLOW! 😄

 

Better explanation: you tried to reduce local variables by using wires. That's nice! Unfortunately you wired the "samples to read" wire from within the producer loop and then (try to) use this value to initiate the consumer loop. DATAFLOW says: this will only happen AFTER the producer loop has stopped…

(You should have seen this by using highlight execution to debug your VI!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,826 Views)