LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about event structure

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,

 

0 Kudos
Message 1 of 11
(4,117 Views)

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.

0 Kudos
Message 2 of 11
(4,106 Views)

I am sorry Altenbach, what is the inverted condition?

0 Kudos
Message 3 of 11
(4,103 Views)

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?

0 Kudos
Message 4 of 11
(4,098 Views)

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.

0 Kudos
Message 5 of 11
(4,090 Views)

Since you are polling the controls anyway, there is no need for any event structure. See if this works for you.

 

 

0 Kudos
Message 6 of 11
(4,082 Views)

@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"?

 

0 Kudos
Message 7 of 11
(4,077 Views)

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,

0 Kudos
Message 8 of 11
(4,068 Views)

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.)

0 Kudos
Message 9 of 11
(4,062 Views)

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,

 

 

 

0 Kudos
Message 10 of 11
(4,057 Views)