From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Stepper Motor From an Event Structure

Solved!
Go to solution

Version: Labview 2012

 

I have an event structure within a state machine. I want to use the state to choose to either drive a stepper motor by defined parameters, "ok button" state or via the signal given from a potentiometer "pour input" state, there is also a time out state.

 

The time out and OK button states work correctly, the pour input state does not. I have attached a copy of my full code, although it may not be easy to follow and also images of the states.

 

I took the initial code from an example. In the example the pour input state was driven by a dial, i have changed this to be driven by the pour input value. I think that the reason the motor does not move is because the pour input state does not execute (using probe) but i can't work out how to make it execute. When using a dial i think that the use of the dial somehow executed the state. I may be wrong in my assumption that getting the state to execute is the problem.

 

Any help or advice on how to get this working would be appreciated.

 

 

 

Download All
0 Kudos
Message 1 of 4
(2,278 Views)

@Carlr wrote:

Version: Labview 2012

 

I have an event structure within a state machine. I want to use the state to choose to either drive a stepper motor by defined parameters, "ok button" state or via the signal given from a potentiometer "pour input" state, there is also a time out state.

 

The time out and OK button states work correctly, the pour input state does not. I have attached a copy of my full code, although it may not be easy to follow and also images of the states.

 

I took the initial code from an example. In the example the pour input state was driven by a dial, i have changed this to be driven by the pour input value. I think that the reason the motor does not move is because the pour input state does not execute (using probe) but i can't work out how to make it execute. When using a dial i think that the use of the dial somehow executed the state. I may be wrong in my assumption that getting the state to execute is the problem.

 

Any help or advice on how to get this working would be appreciated.

 

 


 Please explain the subtraction between new and old value, if it is a pot as you say...new value(2K)-old value(1K)= input 1K?

0 Kudos
Message 2 of 4
(2,271 Views)
Solution
Accepted by topic author Carlr

Pour Input is an indicator, it will not trigger a value change event. Instead of connecting the new value to the indicator connect it to a property node set to "value(signaling)", this will trigger the value change event.

 

Ben64

 

ScreenShot052.png

0 Kudos
Message 3 of 4
(2,224 Views)

Using the value signaling node and removing the subtraction from inside the event has got my code working , thankyou. The subtraction was legacy from the code i modified, it think the dial required this, but using an analoug input does not as due to the loop cycling at high frequency the value changes are negligable between each reading giving input values of ~0.

 

0 Kudos
Message 4 of 4
(2,202 Views)