IAdsSymbolLoader.DefaultNotificationSettings Property

Gets/Sets the default notification settings for this SymbolLoader

Namespace:  TwinCAT.Ads.TypeSystem
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 4.3.0.0

Syntax

C#

INotificationSettings DefaultNotificationSettings { get; set; }

VB

Property DefaultNotificationSettings As INotificationSettings
    Get
    Set

Property Value

Type: INotificationSettings
The default notification settings.

Remarks

The Default notification Settings can be set on the SymbolLoader and is used as default on the different Symbols. On the symbol itself the NotificationSettings can be overridden.

Examples

Setting the DefaultNotificationSettings on the IAdsSymbolLoader object:

Set DefaultNotificationSettings

// Create AdsClient object
using (TcAdsClient client = new TcAdsClient())
{
    // No automatic Synchronization (necessary for Console applications without message loop)
    client.Synchronize = false;

    // Connect to client
    client.Connect(address);

    // Usage of 'dynamic' type/symbol loader
    SymbolLoaderSettings settings = new SymbolLoaderSettings(SymbolsLoadMode.DynamicTree, ValueAccessMode.IndexGroupOffsetPreferred);
    IAdsSymbolLoader dynLoader = (IAdsSymbolLoader)SymbolLoaderFactory.Create(client, settings);

    // Set the DefaultNotification Properties
    dynLoader.DefaultNotificationSettings = new NotificationSettings(AdsTransMode.ClientOnChange, 200, 2000);

    // Determine the symbols
    dynamic dynamicSymbols = ((IDynamicSymbolLoader)dynLoader).SymbolsDynamic;

    // Task 1 Symbol (build in symbol)
    dynamic task1Symbol = dynamicSymbols.TwinCAT_SystemInfoVarList._TaskInfo[1];

    // CycleCount Symbol
    dynamic cycleCountSymbol = task1Symbol.CycleCount;

    // Override Notification Setting for Cycle Count Symbol
    cycleCountSymbol.NotificationSettings = new NotificationSettings(AdsTransMode.OnChange, 250, 0);

    // Register Dynamic Value Changed event.
    cycleCountSymbol.ValueChanged += new EventHandler<ValueChangedArgs>(cycleCount_ValueChanged);

Reference

IAdsSymbolLoader Interface

TwinCAT.Ads.TypeSystem Namespace