Command File Builder
In some cases PLC programs for several controllers may have to be updated. The Command File Builder supports this task. It generates an executable *.bat file which processes a *.ini instruction list. Apart from starting the *.bat file no further user intervention is required. The controllers are automatically selected in turn, the PLC program is reloaded, a boot project is generated, the runtime is set to Run mode, followed by logout.
Under the menu item Tools → Extensions... the Command File Builder can be called up in the selection dialog.
In the main dialog all controllers are listed that are valid for this process. That is, a controller with an AmsNetID and an application program with a linked *.tpy file. To add a controller to the update process it has to be selected. For a larger number of controllers the option Select All is available. This option selects or deselects all controllers.
When the Generate button is pressed the two files are saved in the selected folder.
query off ok
out open CommandFileBuilder.log
out clear
file open "TcBAFrameworkV2.20_Sample.pro"
delay 3000
chooseruntime 192.168.10.5.1.1:801
delay 2000
online login
delay 4000
createbootproject
delay 6000
online run
delay 1000
online logout
delay 1000
file close
out close
file quit
The content of the *.ini file which is processed once the *.bat file has been started is listed above.
First, the log file CommandFileBuilder.log is created to which all log entries from TwinCAT PLC Control are written. Then, the project file is opened, followed by login to the target system. The project is then loaded in the controller, a boot project is generated, and the runtime system is set to Run mode. After logout the project is closed again, output to the log file is stopped, and the command window for the *.bat file is terminated.
Further information on command line instructions in TwinCAT PLC
Control is available in the Beckhoff Information System under the
following path:
Beckhoff Information System → TwinCAT
→ TwinCAT PLC →
TwinCAT PLC Control → Annex → Command line instructions