11-16-2018 06:55 AM
No sir, in my code facing a problem like, Data aquistion part is running only once after that data acquistion stops but , last data is inserted into db, at random time sequence. I'm confused lot here to find where the problem
11-16-2018 07:19 AM
@praveenrajk wrote:
I tired this technique but it quite hard to me, i'm missing something on code, can you help to get out of this problem.
Then show what you actually tried instead of just posting the exact same VI you posted before.
11-26-2018 04:11 AM
Sorry for the late reply, in past vi i used only one loop for both data acquisition and data insertion but in this vi i updated the program based on producer consumer concept, but something is missing in my vi. I didn't get my actual requirement.
I attached snaps of both vi of previously submitted for your reference. Please help me to get out of this problem.
11-26-2018 05:08 AM
1. The consumer loop isn't even using the data you send it.
2. Consumer loops should almost never have a wait in it (I am sure there is some weird corner case). You are just limiting your processing speed when you do that. And one of the points of a Producer/Consumer is to allow the processing to run as fast as possible when there is data to be processed.
3. I have no clue why you are bringing a data wire out of the producer loop. Just use a constant to set the queue type.
11-26-2018 06:27 AM
Thank you for your advise, As per your guide i did producer consumer logic, it's working fine.
But after adding SQL db sub vi into consumer, consumer logic alone not working.
My sub vi working fine, while it run as separately. In my guess there is problem on creation of sub vi. I don't know what i'm missing. Can help me out of this problem.
11-26-2018 06:43 AM
You still have a wait in the consumer loop. REMOVE IT.
If you think something is wrong with your subVI, you really should be posting it as well. My thought is you have a database connection reference issue. But I cannot confirm that without the subVI.
11-26-2018 07:07 AM - edited 11-26-2018 07:09 AM
Actually I use timer in Consumer loop for limiting the execution of data insertion into data base ,if some other way available to limiting the insert into data base, please suggest me.
If i run my SQL sub vi separately it works fine, So i think it may not be connection issue.
I attached my sub vi here. Please tell me if anything i did wrong.
11-26-2018 07:53 AM
Why should you limit it? The insert return after it is done and is ready for the next one.
/Y
11-26-2018 08:01 AM
I'm doing daq for 1 sec once but I have to insert data into data base for 5 mins once, That's why i'm using time limit, if any other technique is possible to do it kindly suggest me.
Thanks in advance
11-26-2018 09:03 AM
Then you should only enque once. 🙂 You're limiting the wrong end of the process.
/Y