Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Printer selection using AccuTerm
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedPrinter selection using AccuTerm

 Post Reply Post Reply
Author
Message
homer View Drop Down
Newbie
Newbie


Joined: April 01 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote homer Quote  Post ReplyReply Direct Link To This Post Topic: Printer selection using AccuTerm
    Posted: April 01 2004 at 7:19am
Greetings,

I've for a slight problem. I need to drive 4 printers from one computer - on the other side of a VPN, so they cannot be defined on anything local to Pick (d3/nt). I want to use AccuTerm scripting to select one of four printers for the subsequent printout to be printed on.

I've got it halfway working by the simple expedient of the single line script as follows:

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
EQU AM TO CHAR(254), VM TO CHAR(253), SVM TO CHAR(252)
!
!
   SCRIPT = \ActiveSession.PrinterName = "Epson Stylus C84 SERIES"\ : EM
   CRT ESC : STX : 'P' : SCRIPT : CR :
   !

and then I can print on that printer. When I try to print on two printers from within the same basic program, the printout only shows up on one. Is there some way to 'close' the printer before selecting the printer for the next printout?

I tried the ActiveSession.PrinterClose, but it tells me I don'thave enough arguments.

I'm using AccuTerm 2K2 (5.0d {5.0.52})

Thanks,

Larry Hazel
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: April 02 2004 at 5:13am
Hi Larry -

You should be able to switch printers on the fly and close them using PrinterClose. I wrote the following test program that prints a page on the default printer, then on a second printer and finally another page on the default printer. I tested this with AccuTerm 2K2 5.2, but I don't think there would be a problem with 2K2 5.0 or even AccuTerm 2000. Here is the sample program:


EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
SLAVE.ON = CHAR(24)
SLAVE.OFF = CHAR(20)
PTR1 = ''
PTR2 = 'Tektronix Phaser 850DP'
SCR='INITSESSION.PRINTERNAME="':PTR1:'"'
PRINT ESC:STX:'P':SCR:CR:
PRINT SLAVE.ON:
PRINT 'THIS IS THE DEFAULT PRINTER'
FOR I=1 TO 40
PRINT I
NEXT I
PRINT SLAVE.OFF:
SCR='INITSESSION.PRINTERCLOSE'
SCR=SCR:EM:'INITSESSION.PRINTERNAME="':PTR2:'"'
PRINT ESC:STX:'P':SCR:CR:
PRINT SLAVE.ON:
PRINT 'THIS IS THE OTHER PRINTER'
FOR I=1 TO 40
PRINT I
NEXT I
PRINT SLAVE.OFF:
SCR='INITSESSION.PRINTERCLOSE'
SCR=SCR:EM:'INITSESSION.PRINTERNAME="':PTR1:'"'
PRINT ESC:STX:'P':SCR:CR:
PRINT SLAVE.ON:
PRINT 'THIS IS THE DEFAULT PRINTER'
FOR I=1 TO 40
PRINT I
NEXT I
PRINT SLAVE.OFF:
SCR='INITSESSION.PRINTERCLOSE'
PRINT ESC:STX:'P':SCR:CR:
PRINT 'DONE'


Thanks,

Pete
Back to Top
homer View Drop Down
Newbie
Newbie


Joined: April 01 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote homer Quote  Post ReplyReply Direct Link To This Post Posted: April 07 2004 at 6:31am
Pete,

Thanks for the sample program. I'll be able to give it a try on Thursday when I'm back at the clients. There is one difference that I note from what I did and what you did.

I probably will not be able to turn the slave printer on and off from within the program. Their system demands that printers be assigned in a strange manner by the executing PROC. So, we'll be assigning these computers the "AS" spooler command, as in SP-ASSIGN AS. That way D3 controls where the item is printed. Not the physical device on the local computer, but the manner in which is is spooled.

I'll let you know tomorrow if it works under the conditions I mentioned above.

Thanks,

Larry Hazel
Back to Top
homer View Drop Down
Newbie
Newbie


Joined: April 01 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote homer Quote  Post ReplyReply Direct Link To This Post Posted: April 13 2004 at 9:30am
Pete,

As I suspected, your suggestion was exactly right. The only problem we had was with the SP-ASSIGN AS that I mentioned. Even with PRINTER OFF and PRINTER CLOSE, the second printout went to the same place as the first printer. Weird!

Anyway, that's not a problem since we have sufficient time between reports for the system to do its own printer processing and closing and consequently, everytime we come to one of these special reports and do the SP-ASSIGN AS after we set the printer for the desired queue, everything works great.

Thanks again for your information.

Larry Hazel
Back to Top
sbhenkel View Drop Down
Newbie
Newbie


Joined: March 03 2017
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbhenkel Quote  Post ReplyReply Direct Link To This Post Posted: August 10 2017 at 9:15am
Is there a way to pull a list of available printers, as if you went into tools/printers/slave printers to choose, so you could then present the list to the user for him to choose?
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: August 10 2017 at 11:47am
Hi Steve -

Sorry - no easy way to get the same list of printers as AccuTerm shows in the printers setup page. Its actually a fairly complex process to get the list. You might be able to use one of the GUI routines to select a printer, but the list may not be the same as the one in the setup page.

Thanks,

Pete

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.