Showing results for 
Search instead for 
Did you mean: 

DSC Notification Functions

I have an application in LV & DSC 8.01. I want to read Data and Alarms of some shared variables bound to PLC items. Using "Value Change Notification" Functions, I want to update a display chart only if a shared variable value changes not polling the shared variables all the time. As I understand, these functions, "Enable Value Change Notification" and "Request Value Change Notification" with "Register for Event" Node, register a value change event for shared variables specified handling by an event structure.

But when I run the code it works in this way: at the first a number of events arise without any value change, and after that it waits for a value change on shared variables. With any value change more than one event arise.


I want to know what the problem is. I've attached a sample code.

0 Kudos
Message 1 of 7
Hi Maryam,

I don't think your attachment worked, could you repost with the code?


Jon B
Applications Engineer
NIUK & Ireland
0 Kudos
Message 2 of 7
Sorry, I forgot to attach the code.
0 Kudos
Message 3 of 7
Sorry, I forgot attaching the code.
Download All
0 Kudos
Message 4 of 7
Hi Maryam,

I looked at your code and I too get the 4-5 events generated when the change notification VI is run. I did however manage to get any subsequent value changes only generating one event by turning off buffering, enabling scalling (default 0-100) and setting deadband to 1%. How have you got your shared variables set up?


Jon B
Applications Engineer
NIUK and Ireland
0 Kudos
Message 5 of 7

Thanks Jon, my shared variables are Boolean type and there's no need to deadband. They are just configured to log data, alarm and events and there's no buffer for them.

What're these events arisen at first for? and my question still remain.

0 Kudos
Message 6 of 7
Hi Maryam,,
This behavior is both completely normal and expected.   Many events other than just value changes can be fired for Shared Variables. For instance, you'll get an event when Shared Variables are created or destroyed (the first time a variable is called, the variable manager must allocate memory for the variable and set other parameters that trigger events). You'll also get events if the Shared Variable quality changes.

You must filter out data change events in your application. See the DSC module examples for more information, specifically the DSC Event Structure Demo example, which deploys the library before enabling shared variable event notifications, thereby avoiding the multiple event firings seen upon initial deployment.

Message 7 of 7