Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pausing a VI in LabView

I'm running a fairly complex VI which interfaces with an LCR and a thermcouple. The main iterative loop sends a 'get measurement' command across to the LCR and thermocouple, parses the repsonse into a real number; and plots it on a graph.

 

There are also some extra features to make life easier; in seperate iterative loops. The main loop iterates every second, or slower depending on a control setting on the front panel; but I need to be able to 'pause' the main loop. In the VI I included a 'monitor' toggle switch, which is suppose to pause and resume the main loop. I can't seem to get it to pause properly.

 

I tried using the monitor switch to set the loop interval to a stupidly high value to 'pause' the loop, but the interval duration only changes after the present interval has passed. In other words if I set it to 3 hours and then to 1 second, I have to wait the full 3 hours before it will change to one second - a long pause.

 

I also tried playing around with using a local variable reading the boolean value of the monitor switch, when it is placed outside the main loop, to control the loop iteration condition; and the loop pauses successfully, but does not resume again.

 

Essentially, the main loop spams the LCR with 'get reading' commands; but the IV interface is also needed to run other commands to the LCR briefly; and I can't run another command on top of the get reading command.

 

The end result is to be a GUI for technicains to perform electronic tests, that can be run and configured purely from the interface; and requires no LabView knowledge.

 

The actual hardware inputs are not included, but are illustrated with a static number constant connected as if it were a dynamic number, and labels. This is just to ease interface scripting, especially since the machine that has the LCR and Thermocouple connected is in the Lab and doesn't have internet access.

 

Any ideas on how to pause it? I know its a simple thing, but it doesn't want to work with my VI.

 

 

0 Kudos
Message 1 of 5
(3,152 Views)

Hi

 

I have had a look at your VI and I'm not sure if I have understood exactly what you want. The easiest way to pause the main loop is to look at it a different way slightly. Instead of actually stopping the loop you just need to turn on and off the functionality of the loop. This can be done with a simple case structure as I have shown below. This will not give you an immediate response though - what sort of response time are you looking for as there may be other ways of doing it using event based programming if you need this response to be immediate.

 

get back to me if I have the wrong end of the stick here and can help further

 

best regards

Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 2 of 5
(3,137 Views)

I've used case structures elsewhere in the VI, but for some reason it never dawned on me to use it them there.

 

Thats exactly the kinda thing I wanted, and far more elegant a solution than I suggested. The response time is immaterial, and boils down to the patience of the user. Its just a simple on/off switch.

 

Thanks for your help.

0 Kudos
Message 3 of 5
(3,135 Views)

Another quick question, is there a module to control the screen position of a small graphic?

 

On the VI I inluded on the earlier post, there is a small arrow; it would be nice of the arrow could be dragged up and down during operation by the user, or the vertical position adjusted by a control of some sorts. Just so you can mark a certain temperature on the meter. At the moment, the arrow can be moved in editing mode, but not in operation.

0 Kudos
Message 4 of 5
(3,134 Views)

The arrow that you are using at the moment is a decoration. Decorations are front panel object that have no problematical tag. There are ways of moving them but these are complicated. An easier solution would be to take a vertical pointer slide control and place this directly onto of your thermometer control.

 

Then use the colour/paint brush tool from the tools palette to change all features of this control invisible other than the pointer itself. Select not to show scale or label and you are left with just a pointer that you can slide up and down during runtime.

 

It is then up to you how to programaticly control this if you wish.

 

I hope this helps - see attached VI.

 

Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 5 of 5
(3,110 Views)