Jump to content

Property nodes can be used to programmatically generated a value change event?


Recommended Posts

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.

  • Like 1
Link to comment

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):

 

post-17453-0-17756200-1454234327.png

 

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

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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