I have a state machine which includes some event structures. These event structures are used to control stepper motors using an Arduino Mega micro-controller. I am using labview 2012.
The input to one of the events is the "pour input" variable. I want to use this to control the motor speed and direction.
If I control the motor as shown in the attached image Working.jpg, then the motor functions correctly. If I attach the motor to the # steps variable then the motor moves at the defined speed in the appropriate direction according to whether the "Pour Input" is positive or negative.
However, I want to control the motor speed, not the number of steps, with the variable "Pour Input". I have checked that the values read by the INPUT_VALUE indicator in the image not working are in the same range as the values specified, which work, using the input "Set Speed". When I connect the Input value to the stepper speed pin of the Arduino (not_working.jpg) icon the motor turns, seemingly indefinitely at maximum speed. I do not understand why there is a difference in motor behaviour between the value supplied to the motor speed input by these two methods. I'm confused by this and don't know where to go from here.
Does the event structure somehow behave differently when taking a value from outside the structure to that given inside? or is there something going on with the initiation of the structure on its first loop through?
I have also attached my whole vi, although it may not be the easiest to follow and requires an arduino Mega to run.