LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI runs but inside code doesn't execute

Hello all ,

 

I have VI , which has 3 while loop inside and some CAN send recive code inside these while loop.

I am facing issue when I run the VI 1st time inside code doesn't execute and if I stop and re-run ,try like this for 2 ,3 times, VI executes properly.

Why is it behaves like this, please give me some inputs to improve my code ..

Thanks 

0 Kudos
Message 1 of 8
(1,789 Views)

Maybe you should include the code in the post.

0 Kudos
Message 2 of 8
(1,785 Views)

@AnilB953550 wrote:

I am facing issue when I run the VI 1st time inside code doesn't execute and if I stop and re-run ,try like this for 2 ,3 times, VI executes properly.


This typically points to a race condition and/or an error (hardware, file IO, etc).  Impossible to give any other advice without seeing your code.


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 3 of 8
(1,778 Views)

thanks for responding ,

 

attached my VI .

 

 

 

 

thank you .

0 Kudos
Message 4 of 8
(1,750 Views)

You have a TON of race conditions due to all of the local variables you have everywhere.  There are several things that do not need constantly done, so those should be moved to before the loops, such as reading the channel names from the configuration file.  Then work on removing every since local variable from your VI, most of which can be replaced with simple wires.  Wires ensure data flow.

 

For any more advice, I highly recommend you follow the getting started links at the top of the LabVIEW forum.


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 5 of 8
(1,731 Views)

To iterate what has been said, I agree that your program shows a glaring misunderstanding of LabVIEW and basic dataflow principles. LabVIEW does not execute left to right. Execution order is solely determined by dataflow and any disconnected code island can execute in parallel.

 

You need to start with the basic tutorials before diving into the deep end and making every possible mistake.

 

Race conditions and blatant overuse of local variables have been mentioned. Here's just the tip of the iceberg!

 

For example (right part of picture) parsing the U8 array according to the rules does NOT need anything pink! Code for that would probably fit on a postage stamp!

 

altenbach_0-1683654434169.png

 

Message 6 of 8
(1,695 Views)

@altenbach wrote:

For example (right part of picture) parsing the U8 array according to the rules does NOT need anything pink! Code for that would probably fit on a postage stamp!

 


This would basically do exactly the same. And if you would use an array or cluster indicator, one indicator terminal would replace all the green terminals.

 

altenbach_0-1683655337232.png

 

Message 7 of 8
(1,689 Views)

Thanks for your reply.

Surely i will more learn.

 

Thanks for the tips I'll update my code.

 

 

 

0 Kudos
Message 8 of 8
(1,646 Views)