SV 7 Printing ENU

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Printing

SV 9.0 ©Copyright 2009 - Reproduction prohibited


Printing

About Printing
There are two distinct printing mechanisms within the Supervisor.

l Graphical. You can print the contents of a window or the entire screen on the Windows' default printer. This
mechanism is used when producing screen dumps from SCADA BASIC, using the built-in program "Hard-
copy", when printing a report and when printing from the Print command on the file menu.
l Text only. You can print information in text format on any printer configured in the operating system, either
locally or over a network. This mechanism is used when printing events through the Log Filters, Alarm and
Log Displays and when using the SCADA Basic instruction LPRINT.

A printer can only be used to print data from one source. If your project requires the use of both printing mech-
anisms you will need two printers. For example you could use a dot matrix printer connected to one of the PC's
serial ports to print alarms and events and a colour ink jet printer connected to the PC's parallel port to make
screen hard copies.
If a printer is connected to the same port as the protection dongle it must be switched on at all times or it
may not be possible for the Supervisor to read the dongle.

Printing graphics
About Printing Graphics
In general, graphical printing uses the default printer as set in the operating system. You cannot change print set-
tings from within the Supervisor. The only exception to this is when printing a window from the FILE – PRINT
menu. You can select and print to any printer configured under the operating system. You can also change the
printer properties, but the changes are temporary and are not remembered when the Supervisor is shutdown.
When using any of the screen printing methods under an operating system other than Windows NT the Acti-
veX animations (Trend, Alarm, Log and Grid displays) may not print correctly.

Printing from the File Menu


On the File menu you will find command buttons for Print set-up, Print preview and Print. These provide the same
functionality you find in most applications (word processor, spreadsheet etc) running under Windows 95 or Win-
dows NT.

Using the print set-up command


The Print set-up command displays a standard Windows Print set-up dialog that allows you to select which printer
to use and change its properties. Note that any change in printer properties are temporary and do not affect the
configuration of the operating system.

Using the print preview command


The print preview command displays a preview of what will actually be printed. The following command buttons
are available.

l Print - Prints what you see in the print preview.


l Next page - Displays the next page (if there is more than 1).
l Prev page - Displays the previous page (If there is more than 1).
l Zoom in - Makes the image larger.
l Zoom out - Makes the image smaller.
l Close - Closes the print preview box.

Using the Print command


The print command prints the contents of the window that currently has focus (the one that was clicked in last.

Printing Graphics from a Program


Printing Using the Integrated Hardcopy Program
The Supervisor contains an integrated hardcopy program. This is called in the same way as SCADA basic program
using the Run program animation. It contains two functions, Screen and Window. The Screen function will print the
whole of the screen whereas the Window function will just print the window in which the animation resides.
The Hardcopy program is only available under Windows NT.

Printing Graphics using SCADA BASIC


You can make a print of a window under program control using the SCADA Basic instruction WINDOW. There are
two modes which may be used, Print and Hardcopy. For further information see the section on SCADA Basic.

Printing Text
About Printing Text
The Supervisor supports printing on up to 12 devices from a single station. You can print to any of the printers con-
figured in the host operating system, either on the local PC or over a network. For each printer that you configure
the Supervisor creates a print spooler which manages the information being sent to the printer. You can also print
to an ASCII file. Text printing is always in portrait format and is not affected by changing the printer properties in
the operating system.
If you print to a printer used by the Supervisor from another application you may cause the Supervisor's
print spooler to stop. Printing can then only be resumed by User intervention.

Configuring a Printer
Printers are configured using the Printer command Station menu.

How to configure a print device that prints to a printer

1. Select the printer number from the list box. This number is used as a reference when selecting a printer else-
where in the Supervisor.
2. Select the In-service tick box to enable the printer.
3. Select print to printing spooler. Show picture

4. If you are using a printer server, enter its name in the Print Server field and click the Refresh button.
5. Select the printer to use. The ellipsis button displays a list of printers available on the host PC.
6. Enter the path for the spooler directory. This is used for the temporary files that the spooler creates whilst
printing.
7. Select validate to confirm the configuration.

Other tab options when using a printer

l ASCII – Convert data to be printed to ASCII format.


l ANSI – Convert data to be printed to ANSI format.
l None – Make no data conversion.
l TrueType font option. Select the option appropriate to the printer you are using. If the printer doesn't support
TrueType fonts then leave this property at its default setting.
l Station - A station list containing the names of the stations on which the printer will be active. Only used on
multi-station applications.
l Open warning boxes – If selected the standard Windows' printing warning boxes will be displayed in error
conditions allowing the user to cancel or retry printing.
l Verbose – If selected all printer transactions will be reported in the print spooler message area.
l Spooler timeout - The period, in milliseconds, at which the spooler checks to see if it has anything to print.
The default period is 3000 milliseconds.
l Printer timeout - The maximum period, in seconds, for which continuous messages will be sent to a printer.
After this period messages will be saved until the next spooler timeout. For example, if the spooler timeout
was set to 3 seconds, and the printer timeout set to 2 seconds, messages will be sent to the printer for a max-
imum of 2 seconds in any 3. In some cases it may be necessary to change this period to avoid overloading
the printer buffer.
l Retry timeout - The period, in seconds, at which the spooler will retry a failed printer (out of paper etc.). The
default period is 900 seconds.
l Enable packet printing – If selected the spooler and printer timeout periods are ignored and the messages
are buffered and printed in packets. The number of messages (lines) per packet is configurable using the
Lines per packet property.
l Add FormFeed - If selected a form feed character will be appended to each packet that is printed.

How to configure a print device that prints to a file.

1. Select the printer number from the list box. This number is used as a reference when printing.
2. Select the In-service tick box to enable the printer.
3. Select print to file. Show picture

4. Enter the name of the file in which to print. Note that there is no automatic mechanism for purging the file, it
will grow indefinitely unless manually emptied.

Formatting the Printed Output


Whilst the Supervisor's printing is essentially text only, it is possible to change certain printing aspects, such as the
font or print colour by sending the printer control sequences. These control sequences are specific to the model and
make of the printer used. Messages sent to the printer from within the Supervisor may be prefixed with these con-
trol sequences to enhance the printing. For example, an alarm might be printed in red.
The control sequences are defined in an ASCII file named PRINTER.DAT which may be created with a text editor
such as Notepad. PRINTER.DAT must be located in the C directory of the project.

PRINTER.DAT Syntax
The file PRINTER.DAT may contain up to 32 different escape sequences followed by the definition of where they are
to be used.
The lines defining the escape sequences have the following syntax.
COL, 0, "sequence_0"
COL, id_1, "sequence_1"
. .
. .
COL, id_x, "sequence_x"
Each line starts with the text COL followed by a sequence identifier (0 to 31) and the escape sequence in quotation
marks. The ESC (27) character is automatically added to the start of each sequence and must not be included
between the quotation marks. Each sequence may contain up to 32 characters.
The sequence 0 defines the normal operation of the printer and is obligatory.

Selecting the sequence used for alarm transitions


The lines defining the escape sequence used on an alarm transition have the following syntax.
ALA, Type, Pri, Id
Each line start with the text ALA followed by the alarm type, the alarm priority and the identifier of the escape
sequence which is to be used.
The alarm type is an integer from 0 to 4 representing the alarm states as follows.
0 Off
1 On and not acknowledged
2 Off and not acknowledged
3 On and acknowledged
4 Invalid

Bit Transitions
The lines defining the escape sequence used on a bit transition have the following syntax.
BIT, Type, Id
Each line start with the text BIT followed by the transition type and the identifier of the escape sequence which is to
be used.
The transition type is an integer from 0 to 2 representing the following states.
0 Transition to 0
1 Transition to 1
2 Transition to invalid

Example of PRINTER.DAT for an HP DeskJet 500


The character Es represents ESCAPE(27). Note that the first ESCAPE is automatically prefixed.
COL, 0, "(s0BEs(s0S" 'Default style
COL, 1, "(s7BEs(s1S" 'Bold and italic
ALA,1,0,1

Example of PRINTER.DAT for an HP PaintJet


COL, 0, "&v0S" ' Default style, in this case black
COL, 1, "&v1S" ' Red
COL, 2, "&v2S" ' Green
COL, 3, "&v3S" ' Yellow
COL, 4, "&v4S" ' Blue
COL, 5, "&v5S" ' Magenta
COL, 6, "&v6S" ' Cyan
COL, 7, "&v7S" ' Invisible
ALA, 1, 0, 1 ' Priority 0, on -not ack, red
ALA, 2, 0, 3 ' Priority 0, off, yellow
ALA, 0, 11, 4 ' Priority 11, off - not ack, blue
BIT, 0, 6 ' Transition to 0, cyan
BIT, 1, 5 ' Transition to 1, magenta
BIT, 2, 2 ' Transition to invalid, green
Note that in the above examples the text to the right of the single quotation mark is a comment and is not part of
the file.

The Supervisor's Print Spooler


The Supervisor creates a print spooler for each printer configured. The print spooler is started with its interface
window minimised. To restore the Print Spooler window click on its icon in the Windows' task bar. Each print
spooler is identified by displaying the associated printer number in its title bar.
Show picture

In the print spooler is an event list displaying the spooler activity and a number of fields displaying the spooler
properties.
Command Buttons

l Stop – Temporarily suspends printing. The Supervisor continues to send messages to the temporary spooler
files which will grow in size until the spooler Start button is clicked. The printer status variable in the data-
base is set to 0.
l Start – Printing is resumed. The spooler prints the contents of the temporary spooler files until they become
empty. The printer status variable in the database is set to 1.
l Cancel – Minimises the print spooler window.

If you close a print spooler all printing associated with that printer will stop until the Supervisor is
restarted.

Using the Start and Stop buttons in the print spooler does not have the same effect as using the Start and
Stop mode of the Printer instruction in the program language. If you stop the printer from the spooler you
must start it again from the spooler. If you stop the printer from the program language you must start it
again from the program language.

Changing Printer Properties


To permanently change a printer's properties you must use the operating system tools.
To change a printer's properties

1. Display the list of configured printers by selecting the Settings – Printers option from the Start menu.
2. Double click on the printer to change to display its status.
3. To change the general printer properties select the Properties command on the Printer menu strip.
4. To select the printer as default select the Default command on the Printer menu strip.
5. To select paper defaults (size, portrait, landscape etc.) select the Document Defaults command.

Changes you make here will affect the printing of graphics with the Supervisor immediately, text printing is not
affected by printer properties.

Disabling The Windows' Print Spooler


Some operating systems have their own integral spoolers associated with each printer. Whilst the Supervisor will
print satisfactorily with the print spoolers enabled, the spoolers delay the detection of printing problems as they
only notify problems once they are full.
To disable the Windows' print spooler display the printer properties by clicking with the right mouse button on the
printer icon in the printer dialog box. (Displayed from the settings menu on the Start button.) Select the option to
print directly to printer.
Show picture

You might also like