11-26-2018 09:25 AM
@Yamaeda wrote:
Then you should only enque once. 🙂 You're limiting the wrong end of the process.
/Y
Exactly. One of the points of the Producer/Consumer is to allow the processing go as fast as it can as long as there is data in the queue. No data in the queue, then the consumer sleeps. So if you only want to insert data once every X amount of time, then handle it on the producer side. With the waits in the consumer, you are putting old data in the database and using up a bunch of memory as the queue continues to get more data in it.
11-27-2018 12:30 AM - edited 11-27-2018 12:33 AM
I attached my vi, on this vi i'm using indicator on both consumer side and producer side. Producer side i'm executing for 1 sec interval and consumer side i'm executing for 5 sec interval. It seems to be working fine.
Basic need of me is i'm doing various operations like
1. DAQ via modbus tcp for 1 sec time interval and Transfer modbus data via mqtt at 1 sec interval.
2. I'm taking Min Max Average of Modbus data for 5mins of time interval.
3. Inject live data of modbus and average value into database at 5 min time interval.
4. I'm creating modbus server and send the live data to third party application for another important function.
These are my needs to be done using LabVIEW, and also i created logic for all these operations, all are working fine if they run in common time interval, i'm struck here how to use two varieties of time interval. Producer consumer concept is not my need, based on suggestions only i went for this concept.Please give me suitable idea to do these.
Thanks in advance
11-27-2018 06:31 AM
@praveenrajk wrote:
Producer side i'm executing for 1 sec interval and consumer side i'm executing for 5 sec interval. It seems to be working fine.
No it is not. Your queue is getting 5 elements for every dequeue. So you are processing data at least 5 seconds old. After 7 iterations, you are already processing data from 30 seconds ago. If this is the setup you actually want, then Producer/Consumer is not what you really want. You should really have a Master/Slave, which is pretty much the same thing but uses a Notifier instead. Notifiers only hold the latest message, so you will lose any data you did not process between messages.
11-30-2018 03:55 AM - edited 11-30-2018 04:00 AM
Thank you for your idea, i'm now working the same concept on master slave pattern but still, i'm not succeed, i don't know where i'm making mistake, help me to solve the problem.
I attached my master slave concept vi on this for your reference.
11-30-2018 07:08 AM
What exactly is not working? You need to be a lot more specific.
11-30-2018 11:51 PM
Sorry for that incomplete information, SQL injection is not processing other than that, all of them working perfectly.