Jump to content

Shared Variable Value Change Event Behaviour


Recommended Posts

I was wondering want people's thoughts are on the behaviour of the Shared Variable Value Change Event.

If this variable is written to on e.g. a RT target then it will cause a Value Change Event.

In this case, as the program loops it updates all variables, with the latest data.

In the video you will see that the value of the ALARM WORD does not change (stays as zero) however, an event is still fired.

The problem is that this was happening for a large number of variables (500-1000+) and seemed to be stressing out the Variable Engine (even causing it to crash).

Now the behaviour seems correct compared to doing the same thing with a e.g. ValSig node on a simple BD.

But for Network Comms I don't see the point in the Event occurring if the value has not updated but has just been written too with the same value.

Regardless, (assuming that there is not one already???) do you think there should be an option to filter this behaviour?

We ended up doing the filtering in the code on the RT side, but a configuration option would be cool.

Cheers

-JG

<object id="scPlayer" width="1168" height="711" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/d8bb4fe1-a57c-47c1-989c-b80b42238d3c/bootstrap.swf" > <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/d8bb4fe1-a57c-47c1-989c-b80b42238d3c/bootstrap.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/d8bb4fe1-a57c-47c1-989c-b80b42238d3c/FirstFrame.jpg&containerwidth=1168&containerheight=711&content=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/d8bb4fe1-a57c-47c1-989c-b80b42238d3c/LV_2010_-_DSC_-_Shared_Variable_Events_Issue.swf&blurover=false" /> <param name="allowFullScreen" value="true" /> <param name="scale" value="showall" /> <param name="allowScriptAccess" value="always" /> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/d8bb4fe1-a57c-47c1-989c-b80b42238d3c/" /> Unable to display content. Adobe Flash is required. </object>

Link to comment

I was wondering want people's thoughts are on the behaviour of the Shared Variable Value Change Event.

Well, there are times when we want to see an event when the variable has a new instance of the same value. A simple example immediately comes to mind:

Latched Boolean on View: The View sends a true value for this button each time the user clicks it. So, the user might click Start, do stuff, stop, and then click Start again. The Start shared variable has a value of True in both cases, but the controller needs to know the user clicked the button again. (There are other ways to do this but this is about the simplest we have found.)

Similarly, we might have the same situation when we send a setpoint. The controller may use an old or default setpoint until it receives a new value, which perhaps only occurs upon user demand. It is entirely plausible that the user could send the same setpoint after starting the controller on two successive runs.

We sometimes program publishers only to write certain data on first call or if the values have changed (it sounds like you did something similar). If you can only edit the subscribers, that won't help, of course, and you will have to do the filtering on the subscriber side, but currently that means after the event triggers. I think generally the given behavior of getting an event is correct, however.

EDIT: OK, I just looked at what sachsm suggested. That could be what you are seeking. I admit I've never paid any attention to that option. I definitely learned another new thing today! Thanks!

  • 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.