TcAdsClient.WriteAny Method (UInt32, UInt32, Object)
Writes an object synchronously to an ADS device.
Namespace: TwinCAT.Ads
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)
Version: 4.3.0.0
Syntax
C#
public void WriteAny(
uint indexGroup,
uint indexOffset,
Object value
)
VB
Public Sub WriteAny (
indexGroup As UInteger,
indexOffset As UInteger,
value As Object
)
Parameters
indexGroup |
Type: System.UInt32 |
indexOffset |
Type: System.UInt32 |
value |
Type: System.Object |
Examples
Usage of ReadAny/WriteAny
using (TcAdsClient client = new TcAdsClient())
{
UInt32 valueToRead = 0;
UInt32 valueToWrite = 42;
client.Connect(AmsNetId.Local, 851);
adsClient.WriteAny(0x4020, 0x0, valueToWrite);
valueToRead = (uint)adsClient.ReadAny(0x4020, 0x0, typeof(UInt32));
}