ConnectionStateExtension.SetAdsStateAsync Method
Sets an AdsState/AdsStateCommand to an AdsServer and waits until the StateChange finishes.
Namespace: TwinCAT.Ads.Extensions
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)
Version: 6.0.328+39e3229
Syntax
C#
public static Task<ResultWriteControl> SetAdsStateAsync(
this IAdsConnection connection,
AdsStateCommand requested,
TimeSpan pollingRate,
TimeSpan waitTimeout,
bool noReinit,
bool noWait,
CancellationToken cancel
)
Parameters
connection |
Type: TwinCAT.Ads.IAdsConnection |
requested |
Type: TwinCAT.Ads.AdsStateCommand |
pollingRate |
Type: System.TimeSpan |
waitTimeout |
Type: System.TimeSpan |
noReinit |
Type: System.Boolean |
noWait |
Type: System.Boolean |
cancel |
Type: System.Threading.CancellationToken |
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IAdsConnection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception |
Condition |
---|---|
Polling rate higher than connection timeout! | |
Cannot set '{address}' to '{requested}'. This would leave the target system unavailable for ADS! |