LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Problem

Solved!
Go to solution

Here is it . In case you need the whole problem it's the second one 🙂 . Thank you for your help 

Download All
0 Kudos
Message 11 of 37
(3,014 Views)

yes I went throught the link .. and I read it but I didn't know how to applicate it in my case.. 

Have you read my problem? I want to excute everyting once the variable diresist is equal to 26 36 16 ... 

and this variable is changing via opc server ..  

I am sorry if I am slow to understand but I didnt get how I can execute the queue in my case other than what I made.. 

0 Kudos
Message 12 of 37
(3,012 Views)

-Create queue with string constant datatype.

-In first loop, inside true case enqueue the string True

-In second loop, keep your entire code inside inside one case structure.

-To the second loop case use the dequeue element as case selector and case as True which is where your entire code will be present.

Thanks
uday
0 Kudos
Message 13 of 37
(3,008 Views)

hey I made as you said. The program now is working even if the condition is false...I am getting the measurements.. 

Theprogram is also running without stopping.. The second boucle is running in an infinite iterations.. and if I click on stop I only can stop on the second iteration.. 

 

So we didnt resolve the problem actually.. Here is the program 

 

0 Kudos
Message 14 of 37
(3,004 Views)

Sorry i don't have LabVIEW, possible to post snippet?

-Select the code and in Edit Create VI snippet from selection and post.

-If need help follow:http://www.ni.com/tutorial/9330/en/ how to add snippet.

Thanks
uday
0 Kudos
Message 15 of 37
(3,001 Views)

s.png

0 Kudos
Message 16 of 37
(2,995 Views)
Solution
Accepted by topic author marwah1

-Just do clean up code using Ctrl+U, because of just one numeric indicator it became so huge and it's some where far far away.

-To stop both loops with single stop button you need to have single button not two buttons. Either use single button and local variable of that button to second loop while or use the error wire from the dequeue element as in http://www.ni.com/white-paper/3023/en/

-VISA Configure is inside while loop and you can move it outside and do configuring only once.

-Did you make sure the TRUE or True(See the case)? string is having appropriate case in second loop?

-Attach snippet of True case.

Thanks
uday
0 Kudos
Message 17 of 37
(2,985 Views)

After all corrections made:  

p.png

0 Kudos
Message 18 of 37
(2,966 Views)

Can you update the final worked code so that it can help others.

 

Only way to thank others is by giving kudoes!

 

Thanks
uday
0 Kudos
Message 19 of 37
(2,953 Views)

f.pngit's actually not the solution for my problem.. 

I mean it's working but it's the same as if I am using a while with a case loop.. the program doesnt stop after one iteration (as it's in a while loop and I only need one iteration)

and if I change the stop as shown in the picture.. if i run again the program, I will not have values as I cannot initialize the indicator of the for loop..  so it doesn't really answer to my problem

 

0 Kudos
Message 20 of 37
(2,947 Views)