Symbolic Access

Because the symbolic information can be downloaded from the target (done by Get-TcSymbol), the Read-TcValue and Write-TcValue Cmdlets are able to use .NET objects type-safe and seamlessly. All data – if possible – is marshaled transparently via the network.

Reading a value using a symbol object

PS> $session = New-TcSession -NetId '1.2.3.4.5.6' -Port 851
PS> $symbol = $session | get-TcSymbol -Path 'TwinCAT_SystemInfoVarList._AppInfo.ProjectName'
PS> $symbol | Read-TcValue

ADS_DynSymbols

Create an ADS Session/Connection, determine the 'ProjectName' Symbol from the running PLC Project, read the current value of the symbol and print it to the console.