LabVIEW: OK Button doesn't update its color after pressed

删除回忆录丶 提交于 2020-01-03 17:13:39

问题


Hi I have a simple VI to press a button to turn on the led. My code works just fine except I would like to have the button to be back to normal color after pressing. I tried all the mechanical actions, but none of them does what I want it to do.

The procedure is as follows:

  1. Say before user presses the button it appears like this
  2. After user presses the button it becomes
  3. Then the led turns on
  4. Once it executes the event the button goes back to

The block diagram is shown below:

I am puzzled and could someone please help me ?


回答1:


The reason the Latch mechanical action isn't working for you is that a Value Change Event on a Latched Boolean will not trigger its mechanical action. In order to trigger the mechanical action, you have to read directly off the Boolean terminal on the block diagram. This is explained in the LabVIEW Help under "Using Events with Latched Boolean Controls".

If you want the boolean to latch, make sure its set to the Latching mechanical action, and then use the actual terminals value to turn the boolean indicator on/off rather than a constant. I've also added a Case Structure to the OK Button to ensure the boolean indicator is only updated when the "OK Button" is enabled.

Here's a VI Snippet showing the latch in action.



来源:https://stackoverflow.com/questions/48514797/labview-ok-button-doesnt-update-its-color-after-pressed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!