Installing PLC software from C++ on Windows

Hi,

I have a .zip package file containing my PLC program and a .pil file that is able to be run in the Runtime Utility Center. I was wondering if there is a way to call the .pil file from a C++ program running on Windows (connected to the PLC) to be able to install the PLC software programmatically? The .pil file has instructions to download and install the .zip package file on to the PLC.

Hi,

to execute a *.pil, you need Runtime Utility Center (RUC).
But RUC has a command line interface that can be called from external programs: so calling RUC with automatically executing the pil instructions would be possible, yes.

Please have a look here in the online help for the command line options.
For example calling RUC from the command line likeā€¦
PVITransfer.exe -silent -C:\Lists\Liste1.PIL
ā€¦ will start executing the pil instructions in silent mode (RUC GUI is not shown).

Best regards!

1 Like

I already use this interface to install RUC packages for automated testing.
The problem is that the installation sometimes fails. Does PVITransfer.exe have a CLI interface to get status information about the progress?

Hi,

for example when calling PVITransfer via command line interface using the automatic option, after the end of execution you get the failure error code as return code of the process.

Parsing the output log file of RUC could also be a possibility, but as I know this will only work after the RUC process has finished.
Unfortunately, as I understood the consoleOutput option could not be used (by now) for getting process information since it canā€™t be read back via stdout, details see here:

I donā€™t know any more CLI interface options to get some ā€œrunning process infoā€. But you could for example output some information on your own while the PIL execution is running, for example by calling a external batch file from your PIL list and setting some environment variables, or appending some info to a file, or similar.
And itā€™s possible to control the PIL execution behavior by using the ā€œOnErrorā€¦ā€ commands, to set an own return vaule after execution by using the ā€œSetReturnCodeā€ command.

Hope that information helps a bit,
best regards!

Thanks for your help. I also found we can use ā€œ-autocloseā€ to display the progress and possibly status of the installation. There is a GUI displayed for the progress.

2 Likes