LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Activities generated by 'wait for front panel activity'

Hi,

     I have a question about 'wait for front panel activity'. I have multiple controls (push buttons and numerical controls). When I push the 'push button', the 'wait for front panel activity' will cease waiting and run designated code once. However, if I change the value of the numerical controls, the 'wait for front panel activity' will run the designated code multiple times. Please see the attached sample VI. In the sample VI, I have two controls, one is on/off switch of the motor, another is the speed of the motor. The 'Loop Executed Num' counts the number of times the code runs.

     My question is, how do I change the setting so that when I change the 'Motor speed setting', the 'wait for front panel activity' generate one event.

 

Thank you,

 

Ryan

0 Kudos
Message 1 of 7
(3,000 Views)

Ryan,

 

i am not sure why the behaviour is exactly like seen in your attached VI (i'd expect 3 increments if Motor Speed Setting is incremented/decremented).

Nevertheless i'd suggest you to switch to the User Interface Event Handler design pattern provided in the template browser (File >> New).

 

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(2,995 Views)

Norbert,

     Thanks for your help.

     I am using LabVIEW 8.6 base version. I can't find the 'User Interface Event Handler' template. Is this function available in base version?

Thanks,

 

Ryan

0 Kudos
Message 3 of 7
(2,986 Views)

RyanWu wrote:

     I am using LabVIEW 8.6 base version. I can't find the 'User Interface Event Handler' template. Is this function available in base version?


I am afraid that the event structure is not part of the base package. Therefore i'd say the that this template is not provided.

So it seems that you have to stick to the "Wait for Front Panel Activity" including the multiple activity detection or upgrade to at least LabVIEW Full Developement System.....

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(2,983 Views)

Norbert,

    Do you have any sample code of the multiple activity detection?

 

Thanks,

 

Ryan

0 Kudos
Message 5 of 7
(2,981 Views)

Ryan,

  

i found out why the loop executes during editing the numeric control: The blinking of the cursor is considered to be front panel activity.

So it seems to me that front panel activity is defined to be: redrawn (at least a part) of the front panel. This i would call "multiple activity detection" since you changed the numeric value, but receive multiple front panel activities in return...

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(2,975 Views)

Norbert,

     That is a interesting finding. I noticed that without changing the value of the control, just use the mouse cursor drag and select the value will cause the program run multiple times. But I failed to link this with the blinking of the mouse cursor. I have to think about how to solve this issue. Currently what I am doing is disabling the change of speed when the motor was runing, i.e., the motor speed setting can only be changed when the motor is not runing. Thus I can avoid sending too much command to the motor while it is running. If you have any suggestions, please feel free to advise.

 

Thanks,

 

Ryan

0 Kudos
Message 7 of 7
(2,961 Views)