Skip to content

Instantly share code, notes, and snippets.

@nikvoronin
Created November 17, 2020 07:36
Show Gist options
  • Save nikvoronin/44b46a0bb57a44cce4f83dfa4f3b6e20 to your computer and use it in GitHub Desktop.
Save nikvoronin/44b46a0bb57a44cce4f83dfa4f3b6e20 to your computer and use it in GitHub Desktop.
GoTwinCAT. Read Variable by Pointer Over ADS
while (!Console.KeyAvailable) {
var result = await client.ReadValueAsync<ushort>( "MAIN.pState^", CancellationToken.None );
ushort state = result.Succeeded
? result.Value
: (ushort) 0;
Console.Write( $"{(state == 100 ? "*" : "+")}" );
await Task.Delay( 50 );
}
Console.WriteLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment