Jump to content

Proprety Node to Detect Change?


Recommended Posts

Is there a Property Node that detects change of a button, similar to an Event?

 

Context:

I inherited a 5x7 square monitors code without any Sub-VIs and the detection of buttons is the following:

gallery_17307_121_1514.png

Note that the Loop is often Late.

 

 

I need to do an operation when  the buttons change state (from ON to OFF) and adding an event case or a Producer-Consumer would be too big of a change (wouldn't be accepted).

Is there a better way other than plugging the array into a shift-register and detecting a change in the array, such as an event equivalent property node?

 

Thanks

Link to comment

Is there a better way other than plugging the array into a shift-register and detecting a change in the array, such as an event equivalent property node?

You do know this is the exact reason why the event structure was invented right?  It meets all of your needs other than the one that states you can't use it.  This also would fix your loop being late issue since each event is handled in the order it was received and works like a queue.

 

But if you must insist there is a slightly easier method.  You can use the Data Changed subVI from OpenG.  Wire anything to it and it tells you if the data has changed since the last time it was called.  Still crappy, and you can still click the button twice quickly and not detect a change.

 

I don't know your situation, but when I was in similar circumstances I forced myself to do the right thing, and use the right tools, despite the pain involved.

Link to comment

 

But if you must insist there is a slightly easier method.  You can use the Data Changed subVI from OpenG.  Wire anything to it and it tells you if the data has changed since the last time it was called.  Still crappy, and you can still click the button twice quickly and not detect a change.

 

 

 

Just an FYI, there is a better version of this vi from MGI called Change Detector.vi.  It operates the same way, but has a drop down polymorphic selector that specifies whether the first call should return a TRUE for FALSE.  Brilliant solution to the indeterminate first call issue of the OpenG 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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.