キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/7
9,002件の閲覧回数
Hi Maryam,

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

Regards

Jon B
Applications Engineer
NIUK & Ireland
0 件の賞賛
メッセージ2/7
8,975件の閲覧回数
Sorry, I forgot to attach the code.
0 件の賞賛
メッセージ3/7
8,952件の閲覧回数
Sorry, I forgot attaching the code.
すべてをダウンロード
0 件の賞賛
メッセージ4/7
8,953件の閲覧回数
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?

Regards

Jon B
Applications Engineer
NIUK and Ireland
0 件の賞賛
メッセージ5/7
8,926件の閲覧回数

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 件の賞賛
メッセージ6/7
8,827件の閲覧回数
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.
 
Regards,

Seamus
メッセージ7/7
8,704件の閲覧回数