我正在尝试编程一些东西,以从Labview ULx库中读取电压并将该电压添加到阵列中.在将布尔按钮的机械动作设置为按下时闩锁"时,我尝试使用事件结构来执行此操作.但是,按下时闩锁"选项似乎不起作用,程序会读取电压并将其正确添加到阵列中并冻结.
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.
前面板
框图:
推荐答案当您将Value Changed事件与锁存的布尔控件一起使用时,您需要在事件结构内读取控件的值以重置闩锁.
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.
只需将Sample控件的终端移动到事件结构内部,即可正常使用.
Just move the Sample control's terminal inside the event structure, then it should work as you expect.
提示:您可以随意使用Latch When Pressed操作,但是OS(Windows等)中的UI按钮的标准操作实际上是Latch When Released.您可以通过以下方式进行检查:单击按钮,将鼠标指针拖离按钮,然后再释放按钮-按钮不起作用.您可能想要确定哪种对您的应用程序更有意义.
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.
更多推荐
按下一次后Labview按钮冻结
发布评论