LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two while loops in parallel

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

0 Kudos
Message 11 of 26
(2,859 Views)

@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.


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 12 of 26
(2,859 Views)

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.

Download All
0 Kudos
Message 13 of 26
(2,769 Views)

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.


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
Message 14 of 26
(2,762 Views)

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.

 

 

 

0 Kudos
Message 15 of 26
(2,754 Views)

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.


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 16 of 26
(2,751 Views)

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.

Download All
0 Kudos
Message 17 of 26
(2,745 Views)

Why should you limit it? The insert return after it is done and is ready for the next one.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 26
(2,736 Views)

 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

0 Kudos
Message 19 of 26
(2,733 Views)

Then you should only enque once. 🙂 You're limiting the wrong end of the process.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 20 of 26
(2,723 Views)