LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple example - Break FOR loop inside an event structure based on Front panel event change.

I'm afraid of your design (seems like you're making it way too complicated), but the following snapshot shows how to stop a FOR loop prematurely (or a WHILE loop) that is inside a consumer loop.  This should stop your loop based on a new event (all your events must generate a new queue element for this to work - INCLUDING the STOP button in this case because otherwise your consumer loop will never know that a user has clicked on the stop button.)

 

Please design carefully.

 

-DP

 

 

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 11 of 12
(439 Views)
  1. Yes the complexity of the program is increasing. But what other way can I use to run something like a stepper motor for N times.  The FOR loop (or While loop) is the easiest.

2. Producer/Consumer architecture took slighlty longer time than just doing it with event structure. Is there a reason for this or is it just because it is parallel loops architecture.

 

 

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 12 of 12
(428 Views)