Showing results for 
Search instead for 
Did you mean: 

Rotate a knob CW 4 times then stop motion, rotate CCW 4 times then stop.

Go to solution

Long story, working in a training environment where the core of the training is simulated, but the ancillary equipment is not.  Currently the students look at a picture of valves and say they want to open or close them.  Trying to put together a VI that I can use on a touch screen that will pull up a valve handwheel picture that they can turn 4 turns CW which then should stop and then I will make a tag that will say that it is closed.  4 turns CCW and a tag that it is open.  I started with a picture ring with 72 pictures turned and used the following code to get a smooth transition thru the crossover point.ValveHandwheelTestPic.JPG

Not sure if I can stop the rotation in one direction and then allow it to turn back in the other direction.  Once it is developed then I can overlay it across numerous backgrounds for the different valves.

Appreciate any help or thoughts on this.  Using Labview 2017. Thanks


0 Kudos
Message 1 of 6

The code looks vaguely familiar 😄 But it still would be more useful if you could attach your actual Vi instead of a blurry picture.


All the information about the number of rotations is contained in the code, so all you really need to do is limit to the desired stops if the entry exceeds the number of turns and display the relevant state tags. What exactly is giving you problems?



Message 2 of 6

Thanks for the response.

I found the code while looking for answers on how to do this in another discussion feed.  It rotates the image in both directions well and with only a 5 degree offset between the images it looks nice.  But I would like it to act more like a real valve for the students.  So I don't want the knob rotation to stop in only one rotation.  What I have been trying to find is after about 4 rotations then somehow inhibiting the rotation of the knob so it will not turn any more.  Yet still allow it to turn back the other direction 4 turns then stop.  I tried to attach the vi but having some problems on my end. 

I thought about giving the students more feed back of position like an indicator, but that wouldn't be what they see in the field so I am trying to stay away from that.

Thanks again. 

0 Kudos
Message 3 of 6

Just to give credit where credit is due.  I did find this piece of code from our Labview champion altenbach.  Spent many weeks going through the boards and this was by far the best one that got me close to where I am trying to get too.  Thanks for the code.

0 Kudos
Message 4 of 6
Accepted by durrtj

Coerce the current value to the valid range before updating the picture ring.

Message 5 of 6

That worked great.  Looks nice and will be a great addition for the students to learn from instead of just a picture.  

Just out of curiosity, can the property nodes of the knob be of use or are they just more of a problem?  Tried some of them but couldn't find any that seemed to work.  This coerce of the value made it all come together.

Thank you for the help and the code.

0 Kudos
Message 6 of 6