Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/31/2016 in all areas

  1. 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. 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 point
  2. 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 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.