How do you make printouts on different printers in WinCC flexible PC Runtime?
In WinCC flexible PC Runtime you cannot explicitly specify printers for printouts. All printouts from the WinCC flexible PC Runtime are always output on the default printer set in Windows.
To have printouts from WinCC flexible PC Runtime output on different printers, the printers concerned must be installed as default printers in Windows. You can do this manually before each printout using the Printer dialog in Windows (Start > Settings > Printers and Faxes > Define as default), but this is inconvenient. Alternatively the default printer can be changed with a VB script while WinCC flexible Runtime is running. You can link this script to a button, for example, which sets a specific printer as default printer in Windows and then starts the printout. The script is structured so that you can use it repeatedly and the printer to be activated is transferred to the script as a parameter.
Please proceed as follows to create the script.
Create a new script
Make the basic settings of the script
Create a new tag
Program the script
|5||Buttons for printer change|
Configure a separate button in a picture for each of the printers to be used. The figure shows a switch between the two printers "MA11193D" and "Adobe PDF".
The return value "RETVAL" of the "fSet_DefaultPrinter" function is shown in an IO field. Link the "RETVAL_fSet_DefaultPrinter" tag to the IO field.
Determine the printer name in Windows
Open this path in Windows: "Start" > "Settings" > "Printers and Faxes".
Script call with the buttons
Complete VB script
The complete script is in the PDF file below.
Output device, Switch, Redirect, Change, Default printer, DefaultPrinter