ethercat-linux/scripts/tc-build-activate.ps1

15 lines
643 B
PowerShell
Raw Permalink Normal View History

Set-Location -LiteralPath 'C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary'
$helper = 'C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Components\Base\TcSysManCmdHelper.exe'
$tsproj = 'C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary\TwinCAT_EL6695_Secondary.tsproj'
Write-Host "Build project..."
& $helper -v 4026.0 -o $tsproj -b 2>&1
Write-Host "Build exit: $LASTEXITCODE"
Start-Sleep -Seconds 2
Write-Host "Activate + Restart..."
$cmd = '{"commands":[{"method":"ActivateConfiguration"},{"method":"StartRestartTwinCAT"}]}'
& $helper -v 4026.0 -o $tsproj -c $cmd 2>&1
Write-Host "Activate exit: $LASTEXITCODE"