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

Technical Details of the PDMS Plot Service

The PDMS Plot Service (PPS) is normally initiated from within PDMS when a PDMS plot file or
files are generated. Under the control of Appware the PPS is automatically started and is sent
either complete plot jobs or individual plot files and the associated information required for
printing them. Once started, PPS will persist and is visible on the taskbar. It can span from one
PDMS module to another and from one PDMS session to another. Print settings will only need to
be set once as they are maintained within PPS.

The components of PPS are as follows:

PDMS Appware: Prepares job files or sends individual commands by running the
PlotServCmd program with command line arguments. The appware should wait for
PlotServCmd to complete.
PlotServCmd: Receives the command line and then searches for PlotServ and if it cannot
find it will use registry information and start it automatically.
When a PlotServ has been found it may be busy and some waiting may be required before
to commands can be sent to it. PlotServCmd completes when the message has been sent
to PlotServ.
PlotServ: When started by PlotServCmd it is run as a normal application program but is
minimized on the taskbar. It has a normal user interface in the style of a control.

The upper part of the user interface form is concerned with browsing for plotfiles and
selecting and previewing them prior to printing.

The lower part of the form contains a list of plotfiles, a black and white/Colour/Grayscale
selector and an Actual/Scaled size selector and PrintSetup/Preview/Clear List/Remove
/Print Selected/Print List buttons.

This user interface is available for general use but most of it is also available via the
commands set from PlotServCmd together with some specific functionality as well.

PlotServ uses functionality form the PlotViewer program, running it as a component


controlled via an ActiveX interface. PlotViewer performs the printing operations and
maintains settings but its process is hidden and does not appear on the taskbar.

PlotViewer: Functionality from PlotViewer is the basis for the printing service where it
is an ActiveX EXE that requires to be registered when it is installed, e.g. plotviewer
/regserver. At other times it can be used for its other purposes, as before.

Above is the block diagram of these components working together.


Summary of PlotServ Commands
Command Notes
Job <jobfile> Read all of the commands from <jobfile>
EndJob Stop reading from jobfile, does this at the end of the job file
automatically.
EndJobAndDelete This is the same as EndJob but additionally deletes the job file.
AddPlotfile <plotfile> Adds <plotfile> to the file list
ShowPrintSetup Displays the PrintSetup control and tests the result.
If it is run from a Job and the user does not press OK, the job
will skip to the EndJob command or the end of the file.
ShowPrintSetupNoSkip Displays the PrintSetup control.
This is the original ShowPrintSetup functionality.
ShowPrintSetupOnce Displays the PrintSetup control if the user has not already
pressed OK to a previous PrintSetup. If this is run from a Job
and the user does not press OK, the job will skip to the next
EndJob command or the end of the file.
ShowPrintSetupOnceNoSkip Displays the PrintSetup control if the user has not already
pressed OK to a previous PrintSetup.
This is the original ShowPrintSetupOnce
functionality.
ClearPrintList
PrintList
PrintListAndClear
Refresh
Preview Preview the selected items from the printing list. If none are
selected the last item is previewed.
SelectAll Selects all items in the printing list for Preview.
SelectLatest Selects the latest item in the printing list for
Preview.
SetBlackMode
SetColorMode
SetGrayMode
SetActualSize
SetScaleSize
SetListFilter <wildcard> E.g. “*.plt”
SetDirPath <directorypath>
WindowStateNormal Set PlotServ window to normal
WindowStateMinimized Set PlotServ window minimized
Help (Developers) Display the list of PlotServ commands in a
scrolling window. Also works if you click the printer picture in
PlotServ and key in CTRL-H.
Statistics (Developers) Display counts of Commands (including jobs),
Jobs, Actions, Unknown Actions and the number of items
currently in the print list to a scrolling window. This command
is not counted in the statistics and counts are cleared after being
displayed. Also works if you click the printer picture in
PlotServ and key in CTRL-S.
StartLog (Developers) Lists all commands as they happen to a scrolling
window. Also works if you click the printer picture in PlotServ
and key in CTRL-L.
#<comment> Comment in job file.
Registry Usage

plotservCmd

Makes no changes to the registry.


Needs to be on the PDMS search path for executables.
Uses the PlotServ path from the registry when it needs to start it, see PlotServ.

PlotServ

PlotServ needs no preparation at install time for its settings to be stored in the registry under the
following key:

HKEY_CURRENT_USER\Software\AVEVA\PlotServ\Settings

The installation of plotservCmd, PlotServ and PlotViewer is now done automatically whenever
plotservCmd is run. The previous method is still active but should not be used.

For reference information only:

The plotservCmd program looks for the registry path where the pathname of the directory
containing PlotServ.exe is to be found. If it is not found plotservCmd assumes that
PlotServ and PlotViewer are on the current search path and will then do its own
installation. The registry key is:
HKEY_LOCAL_MACHINE\Software\AVEVA\PlotServ\2.2

PlotViewer

PlotViewer needs no preparation at install time for its settings to be stored in the registry under
the following keys:

HKEY_CURRENT_USER\Software\AVEVA\PlotViewer\Recent File List


HKEY_CURRENT_USER\Software\AVEVA\PlotViewer\Settings

This is an ActiveX EXE that needs to be registered as a server before it can is used by PlotServ.
This is done automatically when PlotViewer is run for the first time but it can be done as part of
the installation by running PlotViewer.exe /regserver (or PlotViewer.exe /unregserver for
uninstallation).

Using PlotServ Commands

PlotServ is controlled under Appware control from PDMS Design and other modules.
The commands should always be run as part of a PlotServ job that is complete in itself, preparing
the printing conditions, selecting whether to preview, printing and eventually clearing the print
list.
Jobs should be run as background processes so that the PDMS user interface is not blocked while
they are being processed. Running in background mode is selected by adding an “&” to end of a
command or by running it with from a Windows start command:

syscom 'plotServCmd Job E:\AVEVA\Pdms11.6\myjob.txt &'


syscom 'start plotServCmd Job E:\AVEVA\Pdms11.6\myjob.txt'
PDMS Examples

The best way to organize the printing of plots from a PDMS module is to prepare a job file
containing the sequence of commands to select the plot files, set colour options and scaling
options, to prompt the user to setup the printer and so on.

Example 1: Consider how the action corresponding to a File > Print menu selection would be
organized. The job file is named job.txt:

# If this is the first time show the PrintSetup dialog


ShowPrintSetupOnce
# Select the following plot files into the printing list
AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot010
AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot011
AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot012
# Print the whole contents of the printing list and clear it
PrintListAndClear
EndJob

This job is sent to the PDMS Plot Service with the following Pml command:

syscom 'plotServCmd Job E:\AVEVA\Pdms11.5.SP1\job.txt'

Example 2: Consider how an action corresponding to a File > Print SetUp menu selection would
be organized. The job file is named setupjob.txt:

# Show the Print Setup dialog unconditionally


ShowPrintSetup
EndJob

Again the job is sent using the Pml:

syscom 'plotServCmd Job E:\AVEVA\Pdms11.5.SP1\setupjob.txt'

Example 3: Consider how to preview files before printing them. Start with a set of commands in
the job file previewjob.txt.

# Select the following plot files into the printing list


AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot010
SelectLatest
AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot011
AddPlotfile E:\AVEVA\Pdms11.5.SP1\plot012
SelectLatest
# Preview
Preview
EndJob

The job file is sent to PlotServ using Pml:

syscom 'plotServCmd Job E:\AVEVA\Pdms11.5.SP1\previewjob.txt'

You might also like