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.
Asked
Active
Viewed 2,345 times
3
-
1This question is essentially a duplicate of this one: https://stackoverflow.com/questions/48514797/labview-ok-button-doesnt-update-its-color-after-pressed/48529246#48529246 Different symptom, same root cause. The other question has a picture in this answer that may be useful to you. – srm Mar 23 '18 at 18:18
1 Answers
4
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.

nekomatic
- 5,988
- 1
- 20
- 27
-
Just want to make sure I was doing it right...I literally dragged that "Sample" box inside the event structure's "(1)Sample value change" and I tried to run it but it didn't work right...then I tried to link "Sample" to the "Wall" of the event structure but it still doesn't work...I am not sure I understood your instruction completely... – Errrneist Mar 24 '18 at 06:37
-
Yes, all you need to do is drag the `Sample` terminal inside the event structure. However it sounds as if your program structure isn't correct for what you're trying to do. Can you edit your question to explain what your program ought to accomplish - what data is it trying to read and where is the data supposed to end up? – nekomatic Mar 26 '18 at 08:18
-
After a bit of tweaking it worked for some magic reason after I went off work for a day. And it works exactly with the terminal dragged into the event structure. Thanks for your help! – Errrneist Mar 27 '18 at 15:35