Julia111111 Posted January 31, 2016 Report Share Posted January 31, 2016 The question is from the example clad. The answer is true. Can anyone explain a little bit for me? I attached the vi Why test# not increase after click? Thanks. property node.vi Quote Link to comment
ScottJordan Posted January 31, 2016 Report Share Posted January 31, 2016 Event structures are driven by user-interface events. A programmatic change to a control's value is not a user-interface event. But you can write to the "Value (signaling)" property instead; this mimics a user-interface event and will trigger your event structure. By the way, I suggest you put a delay in each of your loops. Otherwise they'll run as fast as they can, which will bring your computer to its knees. For the simple While loop, a Wait (ms) subVI will do; any non-zero value for the wait will keep your computer happy. For the loop containing your event structure, you can wire a non-zero positive value to the hourglass icon at the upper left corner to achieve the same thing. 1 Quote Link to comment
LogMAN Posted January 31, 2016 Report Share Posted January 31, 2016 By the way, I suggest you put a delay in each of your loops. Otherwise they'll run as fast as they can... This is only true for the loop without the Event structure. The Event structure will actually wait until either an event or the Timeout occurs. By default the Timeout is -1 causing the Event structure to wait indefinitely thus requiring zero CPU. You can change that by wiring a Timeout to the Event structure which allows you to execute code in the Timeout case on a regular basis. The loop without the Event structure on the other hand will always loop, even though as you correctly stated, the loop can be slowed down using the Wait for ms or Wait for next ms functions. The question is from the example clad. The answer is true. Can anyone explain a little bit for me? I attached the vi Why test# not increase after click? Thanks. Maybe the following VI snippet helps understanding what ScottJordan already explained (this is based on your VI, however I added another Click button to trigger the Value (Sgnl) property): Press the Click (no Event) button to update the value of Numeric (Test will not increase) Press the Click (Event) button to trigger the Event (Test will increase) Find attached the VI in LV2013 (snippet is for LV2015) Value vs. Value (Sgnl) LV2013.vi 1 Quote Link to comment
Julia111111 Posted January 31, 2016 Author Report Share Posted January 31, 2016 Thanks for the replies, They are really helpful. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.