03-30-2016 03:35 PM
Hi,
Here is what I am working on
- If motor control is toggled ON, motor output should be true only if number 1 is less than number 2
- If motor control is toggled on, while number 1 is greater than number 2, a pop up shows on the screen and motor output should be false
- At anytime, if number 1 is greater than number 2, motor control should be off and motor output should be off also
Right now the third condition is not happening. Can someone help?
Thanks,
03-30-2016 03:55 PM
WHy do you need two loops? Put the numbre checing in the timout event and AND the output of the inverted condition with the value from the motor control to get the correct motor output.
03-30-2016 03:58 PM
I am sorry Altenbach, what is the inverted condition?
03-30-2016 04:01 PM - edited 03-30-2016 04:01 PM
negate the boolean or use "less than or equal" instead (and adjust the cases accordingly).
What are the two numbers? Are they values read from a device or controls changed by the operator?
03-30-2016 04:06 PM
Numbers 1 and 2 are acquired from a sensor. I still don't understand what you are saying about negating the boolean...
So I put the comparison in the timeout case, and when motor control and motor output are true and the comparison is true, those two should be false, and they are not.
Please see my updated VI.
03-30-2016 04:14 PM
Since you are polling the controls anyway, there is no need for any event structure. See if this works for you.
03-30-2016 04:18 PM
@TeamHalli wrote:Numbers 1 and 2 are acquired from a sensor. I still don't understand what you are saying about negating the boolean...
So I put the comparison in the timeout case, and when motor control and motor output are true and the comparison is true, those two should be false, and they are not.
Please see my updated VI.
Very confusing sentence you have there. Motor Output is an output, it isn't an input you can put a condition on.
What are you referring to when you say "those two should be false"?
03-30-2016 04:20 PM
Hi Altenbach.
Your example works great, but in my main code I am using user a user pop-up instead of a string indicator. So the event structure prevents the pop up from popping up all the time. Is there a way around your example using a user dialog box instead of a string indicator to inform the user why the motor control button is not working as expected?
Thank you,
03-30-2016 04:25 PM
Don't use popups, they are very annoying to most!
(If you really want one, create your own and just show/hide its front panel asynchronously.)
03-30-2016 04:26 PM
RavensFan,
It all goes back to my original email, condition 3 is not working in the latest VI I posted. Again, here are the conditions I am trying to meet:
- If motor control is toggled ON, motor output should be true only if number 1 is less than number 2
- If motor control is toggled on, while number 1 is greater than number 2, a pop up shows on the screen and motor output should be false
- At anytime, if number 1 is greater than number 2, motor control should be off and motor output should be off also
#3 is where the two cases are (motor control and motor output should be false as soon as number 1 is greater than number 2.
Thanks,