Labview button freezes after pressed once

Deadly 提交于 2019-12-10 18:19:34

问题


I'm trying to program something to read voltage from the Labview ULx library and add the voltage into an array. I tried to do so using an event structure while setting a boolean button 's mechanical action to "Latch when pressed". However, the "Latch when pressed" option seems doesn't work and the program reads the voltage and adds it to the array correctly and it freezes.

front panel

Block diagram:


回答1:


When you use a Value Changed event with a latched Boolean control, you need to read the control's value inside the event structure in order to reset the latch.

Just move the Sample control's terminal inside the event structure, then it should work as you expect.

Tip: you are free to use the Latch When Pressed action if you want, but the standard action for UI buttons in the OS (Windows etc) is actually Latch When Released. You can check this by clicking on a button, dragging the mouse pointer off the button and then releasing it - the button shouldn't operate. You might want to decide which one makes more sense for your application.



来源:https://stackoverflow.com/questions/49442778/labview-button-freezes-after-pressed-once

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