LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't stop this loop

Solved!
Go to solution

I've received the following VI that I want to merge with mine by doing a user event to start and stop both VIs. The VI that I have received uses a lot of sequence events and while loops in order to 1) initialize communication, followed by 2) calculating the information from the bytes being received. 

 

I have been struggling to find a way to stop the VI while it's started to collect data. It has a "Reset" button which is linked to the STOP on the while loop but it does not do anything when running. 

I want to implement a case structure that when signaled by the user event, it should trigger this VI to stop.

Any ideas?

0 Kudos
Message 1 of 3
(2,629 Views)

What a mess.  It would probably be more work to clean it up than to just throw it out and start over.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 3
(2,612 Views)
Solution
Accepted by Joaquinh

When you do start over,

  1. Do not use Frame Sequences!!!!  Learn the principles of Data Flow!
  2. Do wire the Error Line to every function that allows it, and use it to sequentially order VIs "logically".
  3. Try to keep wires straight, parallel, and short.
  4. No Block Diagram should be larger than a normal screen (strive for 1280 x 1024 at most).
  5. To save valuable Block Diagram space, encapsulate "details" in sub-VIs.
  6. Strive to make sub-VIs simple, do "one thing".  Give them a sensible name and a recognizable icon.

Having a Block Diagram that is simple and "makes sense" has two advantages -- you are less likely to make a foolish logical error, and when you do (we all do), it will be easier to find it.

 

Bob Schor

Message 3 of 3
(2,598 Views)