Configuring printers
Example script
–
Check the status of Xprint and the printer
Naturally, when print output is performed with the -spool option, then BS2000
considers the print job to have been successfully concluded once the print data has
been stored in a temporary file (message SPS0120 - spoolout completed). It is then
no longer possible for BS2 Spool to check the job.
In order to improve this situation, it is now possible to call a script
(/opt/SMAW/X2000/bin/spoolstate.<mn>, <mn> = mnemonic-name) which
checks whether any messages relating to errors or malfunctions are present in Xprint
or the employed printer when the first channel command in the print job (RESERVE-CCW)
is executed. This makes it possible to establish with certainty whether Xprint has been
262
#Print data from print file via Xprint to the printer
# hpljlan
# Print command xpadd with parameter -cp (Xprint creates
# copy of file)
xpadd -dr $1 -de hpljlan -cp
# Delete print data file
rm $1
If multiple emulated printers are configured and these are to output their data at
different physical printers then the script can be extended as follows:
# Determine mnemonic name from file name
# (e.g. /var/opt/SMAW/X2000/tmp/EPRINTER_L0.9021)
MN=`echo $1 | cut -f2 -d'_' | cut -c1-2`
# Print data from file to the corresponding printer as per
# mnemonic name
if [ $MN = L0 ]
then
xpadd -dr $1 -de hpljlan0 -cp
fi
if [ $MN = L1 ]
then
xpadd -dr $1 -de hpljlan1 -cp
fi
if [ $MN = L2 ]
then
xpadd -dr $1 -de hpljlan2 -cp
fi
# Delete print data file
rm $1
Global X2000 functions
U41272-J-Z385-3-76