LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create use producer consumer architecture using typedef clusters?

Hii Yamaeda..,

 

I ran this program and got this error. I introduced the delay so that both the loops could be synchronised. Also, i have to run this code for 8 hours continously. So, I am looking for a most stable code for acquisition.

0 Kudos
Message 11 of 22
(1,280 Views)

And on providing no. of samples per channel in sample clock.vi which defines buffer size 1M , the program ran and then I got this error.

0 Kudos
Message 12 of 22
(1,276 Views)

Hi shivam,

 

I introduced the delay so that both the loops could be synchronised.

Which is wrong here!

Remove this delay. Your loops are "synchronized" by the queue…

 

got this error

Read the DAQmx data more often, the DAQmx-internal is full!

 

On your 2nd error: Use smaller data blocks when your device cannot handle 1M samples at a time…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 22
(1,276 Views)

 Hii Gerdw

I introduced the delay so that both the loops could be synchronised.

Which is wrong here!

Remove this delay. Your loops are "synchronized" by the queue…

Ok.

 

got this error

Read the DAQmx data more often, the DAQmx-internal is full!

 how??

On your 2nd error: Use smaller data blocks when your device cannot handle 1M samples at a time…

The device is meant for 1MS/sec rate. It was working perfectly fine earlier.

 

And now i am getting this error also.

0 Kudos
Message 14 of 22
(1,270 Views)

Hi shivam,

 

The device is meant for 1MS/sec rate. It was working perfectly fine earlier.

Allowing this sample rate doesn't mean to be able to handle several channels with 1M samples each in the DAQ board internally!

Example: when the board uses a 16bit ADC you need 1M samples * 2bytes/sample = 2MiB memory on the board internally - for each channel!

 

Why don't you stream blocks of 100k samples (or 0.1s of data)?

That's the "rule of thumb": set the block size to 1/10 of the sample rate…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 22
(1,260 Views)

@shivam_2 wrote:

Hii Yamaeda..,

 

I ran this program and got this error. I introduced the delay so that both the loops could be synchronised. Also, i have to run this code for 8 hours continously. So, I am looking for a most stable code for acquisition.


I changed the default path for the file as to be able to test it, check that you're not writing to somewhere strange.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 22
(1,253 Views)

No I changed the File paths and channels. Thats not the problem. I even changed the no. of samples to be read to 100k. But this onboard memory full error is showing up.

0 Kudos
Message 17 of 22
(1,247 Views)

Hi shivam,

 

remove the graph/charts from your DAQ loop. They also need (maybe a lot of) time to display your 100k/1M samples and so block the DAQ loop from iterating!

 

Two remarks:

- It's not useful to display 100k samples in a chart/graph which is maybe 300 pixels wide!

- Use the producer-consumer scheme to transport DAQ data to your TMDS loop. Use a 2nd producer-consumer scheme to transport data from TDMS loop to a display loop: maybe you can use a notifier here instead of a queue?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 22
(1,244 Views)

Since you are just logging to a TDMS file, I highly recommend to use the DAQmx Configure Logging VI to make DAQmx do all of the logging for you.  This will work a lot more efficiently than a producer/consumer and is a lot easier for you to write.

 

If you are still getting a buffer overflow error, then try a Master/Slave setup (just like a producer/consumer except it uses a Notifier) to move the graph updates to another loop.  Use the Notifier since you only care about showing the latest data.


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
0 Kudos
Message 19 of 22
(1,233 Views)

OK,. This has nothing to do with clusters or type defs. Time to start a new thread.

 

But, I'll chime in.  DAQmx acquire tasks are the penultimate producer-consumer NATIVELY.  Signals arrive,are converted and held in a buffer untill you read the buffer's contents.  What is not a "P-C Loop" here?  

 

All you need to do after starting an acquisition task is "Read" the buffer before it gets full! How hard can it be?  Samples to read multiplied by sample rate is how often you need to call the DAQmx Read.  Call it early and DAQmx waits for the samples to be acquired.  Call DAQnx Read too slowly the buffer fills up and, you get an error.

 

What is a type def going to help with here?


"Should be" isn't "Is" -Jay
0 Kudos
Message 20 of 22
(1,225 Views)