LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pause function working with haptic joysticks.

I've come into an internship, and have been working on some code. What is being done is information is read from haptic joysticks for transferal to different cRIO setups. The next thing I would like to be able to do is pause the application with one button press on the joystick while still reading for the a different button press to continue the application. From what I can see there is no easy way to continue reading data from the joysticks while also pausing the application without rewriting larger portions. Am I just missing something or is there an easier way?

 

If anyone would like to look at the code, it is included. The test parts in question are in inner frame seven, as well as the bottom of the parent loop. The example in the bottom currently has a stop button for test purposes, but I would like to just have it be with one button press on the joystick.

0 Kudos
Message 1 of 2
(2,043 Views)

You are right, there is no easy way to get to where you want to go.

 

The first problem you will encounter is figuring out what the cde is actually doing -- and with the number of sequence structures you are using, that won't be easy. You also need to connect up your error clusters so you can tell if an error occurs.

 

You have a lot to learn about LV and should go through some of the online tutorials, but to do what you want the approach I would start with is to create a loop with an event structure in it that has a timeout event. In this event handler, put all the logic that you want to be able to start and stop. Next, create a shift-register to hold the timeout value -- this way to "pause" the VI you just pass a -1 to the timeout  to disable it.

 

So create two buttons called "Pause" and "Resume" and define separate value change events for them. In the Pause event handler, pass a -1 to the shift register. In the Resume event handler pass a number that is equal to the desired update interval (in msec). 

 

That's the barebones approach at least.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 2
(2,023 Views)