Previous Thread
Next Thread
Print Thread
ATE print/preview fails with printer not defined #33018 14 Jul 20 05:51 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
I hope someone can help me because i have no idea what I am doing. I'm trying to understand why a program running under ATE is failing to use Apex (I think) to preview a file. I did not write this program and I am unfamiliar with its code. The error I get is generic:

Windows printer [ATECRT] is not defined to this workstation.

There is an ATECRT.INI file in SYS: on the host Linux system and it has DEVICE = AUXLOC:. I changed that to PROMPT:, but it made no difference. I also replaced the file with a duplicate named ATECRT.PQI in ASHCFG: - that too had no effect. I also set many TRACE options on in ATE, but the popup debug window did not appear. These options included LP, ATE, GDIPRT, FOPENS, DEBUG, XDEBUG, INOUT, BASERR, and others.

This program used to work before I replaced my Windows PC with a new one. I had to reinstall and reconfigure ATE on the new PC and I obviously omitted some program or setting. The Linux host, on the other hand has not changed.

I need to get this functioning on my own system so I can make it work on my customer's system, which recently had to be rebuilt. Now this feature no longer works on either system.

I'd appreciate any help I can get. Thank you.

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33019 14 Jul 20 06:13 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
This is confusing. I suggest debugging from the dot prompt, using:

Code
.SET TRACE LP ON
.PRINT ATECRT=<some file>


That should make clear both how or if the server-side logic is selecting the printer, and also some insight into how ATE is handling it.

Then you may want to try running the program that generates the printout to see if it behaves the same.

My guess is that you'll find some combination of ...

1) The server-side isn't using XCALL SPOOL to print the file via the ATECRT printer. Instead, it is probably issuing a TAB(-10,AG_SPOOLCFG) to tell ATE to pre-select the printer ATECRT, and then using TAB(-1,82) to open the auxiliary port and outputting the print file via that method.

2) There is no ATECRT.PQI[1,7] on the ATE client. (This isn't a standard printer that comes with ATE, so it would have had to have been transferred there from the host, perhaps using ZTXFER, or ATSYNC.)

3) You may need to use the Settings > Preview Preferences dialog to set the condition under which APEX appears.

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33020 14 Jul 20 07:10 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
When I printed to ATECRT from the dot prompt within ATE, the trace showed:

.
.print atecrt=sys:atecrt.ini
ATECRT.INI[1,4]

Trace: EZSPL ptr = atecrt, file = atecrt.ini
Trace: EZ_NCF flag set in options, skipping config files
Trace: EZSPL prv=0, pon=0, tpa=0, sw=0x0, options=0x804002a, guiflags=20
Trace: load_ptr_ini(atecrt); prev=
Trace: EZSPL After printer ini, switches = 0 (0)
Trace: EZSPL preview_req = 0, print_req = 1, switches = 0 (0)
Trace: EZSPL calling fspool, ptr = atecrt, switches = 0 (0)
Trace: load_ptr_ini(atecrt); prev=
Trace: After printer INI: switches = 262272 (40080), flags = 196612
Trace: concatenating...
Trace: /data/nif/miame/dsk0/001004/atecrt.ini to /data/nif/miame/dsk0/001044/tsk
aac.004Total of 1 file submitted, 2 disk blocks

Then the APEX preview window opened properly.

I then ran the problem program and got the same error msg as before: "Windows printer [ATECRT] not defined to this workstation." No APEX or debug window.

Your first guess seems to be correct - my debugging shows that the program is invoking:

?TAB(-10,54);",ATECRT,,,";STR$(ATEPRT'SWITCHES);CHR$(127);
?TAB(-1,82);

with ATEPRT'SWITCHES set to 524288 (i.e., SPSW_PREVIEW or x'80000').

It then opens the file "1047.SPL" and reads (via INPUT LINE) thousands of null lines before hitting EOF. For each line read, it prints it to the screen (though I don't see anything like that happening). Here's the relevant code:

OPEN # 9919,OUT$,INPUT

DBCRT'USING'APEX'NEXT:
INPUT LINE # 9919,PRT'LIN$
IF EOF(9919) <> 0 THEN GOTO DBCRT'USING'APEX'DONE
?PRT'LIN$
GOTO DBCRT'USING'APEX'NEXT

DBCRT'USING'APEX'DONE:
CLOSE # 9919
?TAB(-1,83);
?TAB(-10,54);",";CHR$(127); ! Turn off ATECRT.INI as printer
XCALL ECHO
GOTO DBRPT'CRT'DONE


As for your second guess, these are the only files in %MIAME%/dsk0/001007 on the client PC:

csv2xl.pqi
lp0.new
pdflpd.pqi

Do I need to create ATECRT.PQI and if so, what should it contain? Do I need to create it on the Linux host (in ASHCFG:) or the Windows PC? (As stated above, I tried creating it on the host, but that made no difference.)


Finally, I've played with the Preview Preferences settings, but they seem to have no bearing on this particular problem.

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33021 14 Jul 20 08:12 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Start by creating an ATECRT.PQI file in the 001007 underneath the ATE installation. (The easiest way to do this is to use File > Open Local Session to open up a dot prompt within the ATE installation.)

I'm not quite sure what it was supposed to contain, but you can start with DEVICE=PROMPT:

In this case the ATECRT.PQI or ATECRT.INI on the server side is not being used.

You won't see the lines being "printed to the screen" because the preceding TAB(-1,82); instructs the client to redirect screen output to a file (from where it will be spooled).

And since the AG_SPOOLCFG command is specifying the SPSW_PREVIEW switch, that is activating the APEX preview automatically. (You could override that in the Preview Preferences by setting it to Never, but presumably you wouldn't want to do that.)

So I think you're pretty close to getting this working, although depending on the nature of the output, you may need to tinker with other options in the ATECRT.PQI file.

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33022 14 Jul 20 09:26 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
Thank you, Jack. With an ATECRT.PQI file in the local PC's DSK0:[1,7], I no longer get an error message.

I am still a bit confused. If I tried to access ATE from a different PC on the network, would the new PQI file be present? Is the local session's ppn equivalent to C:\ATE\DSK0\001007?

When people invoke APEX, do they typically want to preview a file using EZVUE or some other application? I'm using the free version of PDFCREATOR but the window has APEX controls on top. Should I be invoking a different app. There is a separate option to print directly to PDFCRE which opens a PDFCREATOR window.

In any case, with the new PQI's DEVICE=PDFCRE, APEX displays an error message at the top of each (otherwise proper looking) page:

//IMAGE,NPDAT:NPFPP2.GIF,1,1,6120,1500,4,0 (err 2)

The specified file exists and has "rwx" privileges for all ashell users. So why am I getting this new error?

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33023 14 Jul 20 09:49 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
I answered the latter question. When I copied the GIF from Linux to the local PC, the //IMAGE error is gone. Now I see the GIF in its place.

I must still be doing something wrong because I now have 2 different options that both produce APEX results.I want one of them to open a PDFCREATOR window.

This is an APEX window, right?

[img]https://ibb.co/2M12yzH[/img]

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33024 14 Jul 20 10:52 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
If the ATE workstations are separate PC's with local ATE installations, then each one would need its own copy of the PQI file and and the image file. But it's also possible that ATE could be installed on a common server such that each workstation was actually referring to the same C:\ATE directory, in which case you'd only need one.

When people use APEX, it would replace a server-side text-only previewer like EZTYP, and instead give you something more like what PC users expect, i.e. more like the Preview option you'd find in Word, or when printing from a browser, etc. In addition to giving you a better WYSIWYG view of the expected output (based on the currently selected printer and settings), it provides a kind of console from which you can do various things with the output -- print to a hard copy device, generate a PDF, export it to a spreadsheet, email it, etc. (Or to just look at it and then discard it, which saves a lot of paper and time when designing complicated forms.)

If the intended target is going to be a PDF, in some ways APEX becomes superfluous since you could generate the PDF directly and then use the PDF viewer. (In that case it would be more like a post-viewer than a pre-viewer, but in the absence of hard copy, not much difference to the user.)

The image you provide is APEX in ATE 6.4. The image looks pretty much like it will look in a PDF viewer, but the PDF hasn't yet been generated.

As an aside, in ATE 6.5, the toolbar has been reorganized somewhat but the options are the same. Here's an image with both versions ...
[Linked Image]

I'm not quite sure I follow which two options you're referring to that produce APEX results. Maybe the above just clarified it. Or, perhaps there is also confusion over the fact that the APEX toolbar has two different print buttons -- one which brings up the standard printer selection dialog, while the other prints "as intended by the application". The difference between those two is often confusing, but seemed necessary for the case where the application requested a specific printer configuration. In the case, while the application is apparently requesting the ATECRT printer configuration, what's not clear is whether it is meant to refer to a specific printer (and possibly printer configuration details such as orientation, paper size, etc), or was just going to refer to the PROMPT: option anyway (in which case both printing options would be the same).

Another point of potential confusion is that when the relevant printer init file specifies DEVICE=PROMPT:, APEX may need to prompt you for a printer selection even before it displays the preview. (The reason here is that it needs a printer context in order to generate the preview.) Once you select a printer, APEX remembers it and will use it as your default for subsequent requests that don't specify an explicit printer.)

If still confused, feel free to give me a call. (I realized at some point after this thread got going that you had started with a phone call, but it seemed like we were making progress here.)

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33025 14 Jul 20 11:03 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
I will call, but maybe you can clarify two more points:
Is there a difference between *.ASH and *.CFG files in ATE? Is there a difference between ATE settings and the ATE configuration?

BTW: On my customer's system all users share a virtual environment, so presumably their configuration/settings file(s) can be saved in a single shared location.


Last edited by Steven Shatz; 14 Jul 20 11:03 PM.
Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33028 15 Jul 20 06:32 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
The *.ASH files are created by the File > Save Settings menu, and contain local display-related settings such as the default main window size and position, color scheme, font, etc. (Essentially the options near the top of the Settings menu -- Beveling, Colors, Font, Misc. Settings and Dialog Sizing.) These settings are supported both by A-Shell/Windows and ATE, and can be saved so as to associate with the current user/current profile, current user/default, all users/current profile or all users/default. (They are kept in the same directory as the client MIAME.INI file.) In the ATE case, it will automatically load any previously saved settings, using the most user/profile specific one that it can find. In the A-Shell/Windows case (where you don't have a connection profile, you can manually request a specific set of saved settings via the -o <settings file> command line switch.

CFG files do not have any specific meaning to A-Shell or ATE, although the extension is typically used when exporting an ATE connection profile to a file so that it can be transferred to another system. Since ATE connection profiles (host address, emulation, login parameters, etc.) are stored in the Registry, the only way to move them from one machine to another is by exporting to a file, transferring the file, then importing from it. ATE's connection properties dialog contains buttons for export/import which function similarly to the Windows REGEDIT export/import functions, although the file formats are not interchangeable. The main advantage to using ATE's built-in export/import just to avoid having to muck around in the system registry, which requires admin privileges, special knowledge, risk, etc.)

Re: ATE print/preview fails with printer not defined [Re: Steven Shatz] #33030 15 Jul 20 07:19 PM
Joined: Jun 2001
Posts: 713
S
Steven Shatz Offline OP
Member
OP Offline
Member
S
Joined: Jun 2001
Posts: 713
Thank you for that clear explanation and for all your help in this matter. ATE is working perfectly on my own system and will soon be back to normal on my customer's system. I couldn't have done it without you.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3