beckhoff TE1000 — 6.58 Write-TcValue

TcXaeMgmt Version 7.X | Write-TcValue SessionIdSymbol Write-TcValue -SessionId [-Value ] [-Path] [-Encoding ] [- Timeout ] [-Force] [-ResetSymbols] [-Quiet] [-WhatIf] [-Confirm] [ ] InputObject Write-TcValue [-Value ] [-InputObject] [-Encoding ] [- Timeout ] [-Force] [-Quiet] [-WhatIf] [-Confirm] [ ] DESCRIPTION This Cmdlet writes values to TwinCAT Devices. The devices can be accessed via different ValueProviders. All sorts of ADS-addressing will be supported by this Cmdlet: Addressing by IndexGroup / IndexOffset (see IndexGroup, IndexOffset paramters) Addressing by Instance Path (see path parameter) Addressing by Symbol (see InputObject / Symbol parameter) IMPORTANT:

Writing values should be done with highest care because it could destabilize the TwinCAT System when the write operation is not addressed properly. While writing with available symbol information is not critical and should be preferred the size and position of symbol data is known within the process image), the access via Instance path is less secure. The size of the overwritten data is not known and therefore not checked by the Cmdlet. The highest attention should be taken with write IndexGroup / IndexOffset write operations because beneath the unknown data size even the position of the data is not checked. The data is written directly into the process image.

Please use the -WhatIf and -Confirm parameters whenever it is appropriate and inform about the $ConfirmPreference settings ( PS> get-help about_Preference_Variables) before usage of the Write-TcValue Cmdlet.

EXAMPLES Example 1 PS> $session = New-TcSession -NetId 1.2.3.4.5.6 -Port 851 PS> $projectNameSymbol = $session | Get-TcSymbol -path "*ProjectName" PS> $projectNameSymbol InstanceName DataType Size InstancePath ------------ -------- ---- ------------ ProjectName STRING(63) 64 TwinCAT_SystemInfoVarList._AppInfo.ProjectName PS> $projectNameSymbol | Read-TcValue OldProjectName PS> $projectNameSymbol | Write-TcValue -Value "NewProjectName" -force PS> $projectNameSymbol | ReadTcValue NewProjectName This example shows how to create a session, determining the Symbol 'ProjectName within the _AppInfo Struct on a running PLC project and reading its value.

After that, the Value will be overwritten with 'NewProjectName'. Example 2 Write-TcValue -session $session -IndexGroup 0x4040 -IndexOffset 0x1247A8 -Value "NewProjectName" Writes a string typed Value to the specified IndexGroup/IndexOffset Address. TE1000 232 Version: 1.5.0