Discussion:
POS. Cash Register on AS400.- New and Updates
(too old to reply)
Gary Segal
2006-11-02 21:58:24 UTC
Permalink
Still need some Help!!!!! Please advise if you can!!!!!!!!!!!
;-)
My best,
Gary
====================================================================

I am back. After 4 hours of testing. I still wasn't able to open the
cash drawer.

I've tried all possible variations that I could think off. None of them
open the drawer. I can print the receipt without any problems. I get
hex characters printed on it.

1. Changing WSCST - Does Not work

:INITPRT
DATA ='1B70'X.
:INITPRT
DATA ='1B401270'X.
:INITPRT
DATA ='2797'X.

2. Inserting Hex into spool file - Does Not work

C Move X'2797' P#Hex 1
C Move X'2797' P#Hex2 2
C Move X'1B70' P#Hex 1
C Move X'1B70' P#Hex2 2

and compile PRTF with:
Unprintable character action:
Replace character . . . . . . *NO *SAME, *YES, *NO
Replacement character . . . . 40-FE, *SAME

3. I have changed "Printer Commands" on a printer properties. I was
able to open the drawer from PC(Print test Pgage),

But, as soon as I print from AS400 to the same printer (same parms in
"Printer Commands") "Sim Sim" stays close.

Any other Ideas. Am I doing something wrong. Looks like that no one
knows how to do it. I can not believe that I am the first one who is
trying to do this.

Thank You all for your help............

Gary

---------------------------------------------------------------------------------------------------------------------

It seems to me IBM support have given you an acceptable pointer to the
solution.
The caveat is that I've never tried this particular support using a
WSCST however ...
A look through the WSCST source you sent shows two interesting tags
:INITPRT and :RESETPRT
A cursory glance through the WSCST Programming Reference says:
"The INITPRT (initialize printer) tag defines the ASCII control
sequence for the initialize printer function for an ASCII printer. The
host print transform function uses the INITPRT tag at the beginning of
each print job."

and

"The RESETPRT (reset printer) tag defines the ASCII control sequence
for the reset printer function for an ASCII printer. The RESETPRT tag
is used by the host print transform at the end of each print job."

Because printing a receipt is a "print job" (presuming each receipt is
a separate spooled file) it would seem reasonable that you could modify
either of these tags to include the ESC P incantation. Your only
decision is whether to open the drawer before printing the receipt
(i.e. :INITPRT) or after (:RESETPRT).

The current data for these tags already includes the Escape character.
I'm fairly sure that Escape codes can be strung together so you only
need to add the 70 to the end of the current data. Easy enough to try
it both with and without the second 1B and see what happens.

Regards,

Simon Coulter.

----------------------------------------------------------------------------------------------------------------------

Hello again.

still need some more help. I am almost there. I am able to print to
Receipt printer from AS400, but still can not open cash drawer.

I have spoke to Wasp(Cash drawer manufacturer). They told me:

"ESC P should open the cash drawer. In hexadecimal this is 1B70 and in
decimal it is 27112"

I tried to put in spool file as hex. No luck

Also spoke to IBM(Client Access support team). They said that there in
no way to trigger "ESC P" in Client access accept by putting it in
WSCST(Work Station Customizing Object), but they no longer support it
therefore they can not let me know how to do it.


Does anyone has any knowledge what syntaxes do I have to put in my
WSCST object and where? Text file is pretty big. Please see attached.


Thanks a million

Gary Segal
Goebel Of North America
609-730-8929 Direct

===============================================================

Original
--------------

Hi guys,
I need some advise on "Point of Sale" hardware.
We have a store with two POS(Wasp) systems that are using Wasp software
and
hardware. We have to upload/download inventory, convert data, etc....
It does not work smoothly....... we have 2 stand a long Wasp Quick
store systems:

http://www.waspbarcode.com/point_of_sale/quickstore_pos_bundle_p.asp

We would like to write Cash Register software that will work directly
with our inventory files and merge into our existing applications.

1. Is there any POS software with open source?
2. What hardware is the best to use?
3. How can I make iSeries(model 9406 V5R2M0) to communicate with a Wasp
cash register?
4. Is there a special API's to open the cash drawer?

Thank you in advance

Gary Segal
***@Goebel.com
Bradley V. Stone
2006-11-02 22:28:39 UTC
Permalink
Here is the latest information I got from a collegue on how this should
be able to be accomplished. Posted here for posterity in hopes that it
is the answer:

Probably the easiest way would be to send them as ASCII. You can send
transparent ASCII in a printer file
that the 400 won't convert from EBCIDIC to ASCII.

You need to change the printer file to not convert unprintable
characters. CHGPRTF FILE(QPRINT4) RPLUNPRT(*NO *SAME)

Then inside the program, you can send the ASCII characters. Here is an
example of a string that changes the font

D Font2 C CONST(X'03061B2661343552')

The first 2 hex characters, the 03 is a code that tells the printer that
you are sending transparent ASCII data. The second characters specify
the length of the string in Binary. So the 06 indicates that 6 hex
characters are to follow the 03

Here is a longer example.

D Font1 C CONST(X'03191B266C31481B266C304F1B-
D 266C31451B266130521B26613043')

So you still have the hex 03 followed by 19 which indicates there will
be 25 hex characters. It gets a little confusing counting the
characters in binary. You go from 09 to 0A, 0B, 0C, 0D, 0E, 0F, 10,
11.... etc to 19.
Post by Gary Segal
Still need some Help!!!!! Please advise if you can!!!!!!!!!!!
;-)
My best,
Gary
====================================================================
I am back. After 4 hours of testing. I still wasn't able to open the
cash drawer.
I've tried all possible variations that I could think off. None of them
open the drawer. I can print the receipt without any problems. I get
hex characters printed on it.
1. Changing WSCST - Does Not work
:INITPRT
DATA ='1B70'X.
:INITPRT
DATA ='1B401270'X.
:INITPRT
DATA ='2797'X.
2. Inserting Hex into spool file - Does Not work
C Move X'2797' P#Hex 1
C Move X'2797' P#Hex2 2
C Move X'1B70' P#Hex 1
C Move X'1B70' P#Hex2 2
Replace character . . . . . . *NO *SAME, *YES, *NO
Replacement character . . . . 40-FE, *SAME
3. I have changed "Printer Commands" on a printer properties. I was
able to open the drawer from PC(Print test Pgage),
But, as soon as I print from AS400 to the same printer (same parms in
"Printer Commands") "Sim Sim" stays close.
Any other Ideas. Am I doing something wrong. Looks like that no one
knows how to do it. I can not believe that I am the first one who is
trying to do this.
Thank You all for your help............
Gary
---------------------------------------------------------------------------------------------------------------------
It seems to me IBM support have given you an acceptable pointer to the
solution.
The caveat is that I've never tried this particular support using a
WSCST however ...
A look through the WSCST source you sent shows two interesting tags
:INITPRT and :RESETPRT
"The INITPRT (initialize printer) tag defines the ASCII control
sequence for the initialize printer function for an ASCII printer. The
host print transform function uses the INITPRT tag at the beginning of
each print job."
and
"The RESETPRT (reset printer) tag defines the ASCII control sequence
for the reset printer function for an ASCII printer. The RESETPRT tag
is used by the host print transform at the end of each print job."
Because printing a receipt is a "print job" (presuming each receipt is
a separate spooled file) it would seem reasonable that you could modify
either of these tags to include the ESC P incantation. Your only
decision is whether to open the drawer before printing the receipt
(i.e. :INITPRT) or after (:RESETPRT).
The current data for these tags already includes the Escape character.
I'm fairly sure that Escape codes can be strung together so you only
need to add the 70 to the end of the current data. Easy enough to try
it both with and without the second 1B and see what happens.
Regards,
Simon Coulter.
----------------------------------------------------------------------------------------------------------------------
Hello again.
still need some more help. I am almost there. I am able to print to
Receipt printer from AS400, but still can not open cash drawer.
"ESC P should open the cash drawer. In hexadecimal this is 1B70 and in
decimal it is 27112"
I tried to put in spool file as hex. No luck
Also spoke to IBM(Client Access support team). They said that there in
no way to trigger "ESC P" in Client access accept by putting it in
WSCST(Work Station Customizing Object), but they no longer support it
therefore they can not let me know how to do it.
Does anyone has any knowledge what syntaxes do I have to put in my
WSCST object and where? Text file is pretty big. Please see attached.
Thanks a million
Gary Segal
Goebel Of North America
609-730-8929 Direct
===============================================================
Original
--------------
Hi guys,
I need some advise on "Point of Sale" hardware.
We have a store with two POS(Wasp) systems that are using Wasp software
and
hardware. We have to upload/download inventory, convert data, etc....
It does not work smoothly....... we have 2 stand a long Wasp Quick
http://www.waspbarcode.com/point_of_sale/quickstore_pos_bundle_p.asp
We would like to write Cash Register software that will work directly
with our inventory files and merge into our existing applications.
1. Is there any POS software with open source?
2. What hardware is the best to use?
3. How can I make iSeries(model 9406 V5R2M0) to communicate with a Wasp
cash register?
4. Is there a special API's to open the cash drawer?
Thank you in advance
Gary Segal
Dr.UgoGagliardelli
2006-11-03 08:24:46 UTC
Permalink
Post by Gary Segal
Still need some Help!!!!! Please advise if you can!!!!!!!!!!!
;-)
My best,
Gary
Hi Gary, here you are again!
Basically you have to know that if you create an *USERASCII
printer-file, as400 printer-writer will send data to the printer as is,
without doing any formatting or data conversion. Writing ascii data into
the spooled file is up to you. So I suggest you to create a program
described *USERASCII printer-file and write directly hex data, that you
have already discovered.

What Bradley say is valid only when you can use that techique called
partial-transparency, when you use an host transformed printer you
cannot use that.
Post by Gary Segal
====================================================================
I am back. After 4 hours of testing. I still wasn't able to open the
cash drawer.
I've tried all possible variations that I could think off. None of them
open the drawer. I can print the receipt without any problems. I get
hex characters printed on it.
1. Changing WSCST - Does Not work
:INITPRT
DATA ='1B70'X.
:INITPRT
DATA ='1B401270'X.
:INITPRT
DATA ='2797'X.
2. Inserting Hex into spool file - Does Not work
C Move X'2797' P#Hex 1
C Move X'2797' P#Hex2 2
C Move X'1B70' P#Hex 1
C Move X'1B70' P#Hex2 2
Replace character . . . . . . *NO *SAME, *YES, *NO
Replacement character . . . . 40-FE, *SAME
3. I have changed "Printer Commands" on a printer properties. I was
able to open the drawer from PC(Print test Pgage),
But, as soon as I print from AS400 to the same printer (same parms in
"Printer Commands") "Sim Sim" stays close.
Any other Ideas. Am I doing something wrong. Looks like that no one
knows how to do it. I can not believe that I am the first one who is
trying to do this.
Thank You all for your help............
Gary
---------------------------------------------------------------------------------------------------------------------
It seems to me IBM support have given you an acceptable pointer to the
solution.
The caveat is that I've never tried this particular support using a
WSCST however ...
A look through the WSCST source you sent shows two interesting tags
:INITPRT and :RESETPRT
"The INITPRT (initialize printer) tag defines the ASCII control
sequence for the initialize printer function for an ASCII printer. The
host print transform function uses the INITPRT tag at the beginning of
each print job."
and
"The RESETPRT (reset printer) tag defines the ASCII control sequence
for the reset printer function for an ASCII printer. The RESETPRT tag
is used by the host print transform at the end of each print job."
Because printing a receipt is a "print job" (presuming each receipt is
a separate spooled file) it would seem reasonable that you could modify
either of these tags to include the ESC P incantation. Your only
decision is whether to open the drawer before printing the receipt
(i.e. :INITPRT) or after (:RESETPRT).
The current data for these tags already includes the Escape character.
I'm fairly sure that Escape codes can be strung together so you only
need to add the 70 to the end of the current data. Easy enough to try
it both with and without the second 1B and see what happens.
Regards,
Simon Coulter.
----------------------------------------------------------------------------------------------------------------------
Hello again.
still need some more help. I am almost there. I am able to print to
Receipt printer from AS400, but still can not open cash drawer.
"ESC P should open the cash drawer. In hexadecimal this is 1B70 and in
decimal it is 27112"
I tried to put in spool file as hex. No luck
Also spoke to IBM(Client Access support team). They said that there in
no way to trigger "ESC P" in Client access accept by putting it in
WSCST(Work Station Customizing Object), but they no longer support it
therefore they can not let me know how to do it.
Does anyone has any knowledge what syntaxes do I have to put in my
WSCST object and where? Text file is pretty big. Please see attached.
Thanks a million
Gary Segal
Goebel Of North America
609-730-8929 Direct
===============================================================
Original
--------------
Hi guys,
I need some advise on "Point of Sale" hardware.
We have a store with two POS(Wasp) systems that are using Wasp software
and
hardware. We have to upload/download inventory, convert data, etc....
It does not work smoothly....... we have 2 stand a long Wasp Quick
http://www.waspbarcode.com/point_of_sale/quickstore_pos_bundle_p.asp
We would like to write Cash Register software that will work directly
with our inventory files and merge into our existing applications.
1. Is there any POS software with open source?
2. What hardware is the best to use?
3. How can I make iSeries(model 9406 V5R2M0) to communicate with a Wasp
cash register?
4. Is there a special API's to open the cash drawer?
Thank you in advance
Gary Segal
--
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñejoAlcoolInside
Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'
niko
2006-11-03 10:59:44 UTC
Permalink
hi,

Instead of

:INITPRT
DATA ='1B70'X.
:INITPRT
DATA ='1B401270'X.
:INITPRT
DATA ='2797'X.

Try

:INITPRT
DATA ='1B704012702797'X.

I have done some test (not for POS printers) with standard PCL printers
where some PCL commands need to be in one part. (only one 1B escape
character plus multiple commands).
maybe you have simmilar problem.

..and for test, instead of sending spool directly to the printer try to save
it to the file then open it in the notepad to review what you have inside.
Also you can print this saved file to the printer from DOS prompt if you
have localy attatched printer on LPT1 with command

type filename >> lpt1:

In this way you can test what is missing in datastream and what is received
from printer session.


Niko.
Jonathan Bailey
2006-11-03 13:14:09 UTC
Permalink
Post by niko
hi,
Instead of
:INITPRT
DATA ='1B70'X.
:INITPRT
DATA ='1B401270'X.
:INITPRT
DATA ='2797'X.
Try
:INITPRT
DATA ='1B704012702797'X.
I have done some test (not for POS printers) with standard PCL printers
where some PCL commands need to be in one part. (only one 1B escape
character plus multiple commands).
maybe you have simmilar problem.
..and for test, instead of sending spool directly to the printer try to save
it to the file then open it in the notepad to review what you have inside.
Also you can print this saved file to the printer from DOS prompt if you
have localy attatched printer on LPT1 with command
In this way you can test what is missing in datastream and what is received
from printer session.
Niko.
You could create data on the pc to ensure the codes are correct. I
would use debug, eg.
debug test
-e 100
0C99:0100 32.
then enter your data following each hex byte witha space & using enter
to finish:
0C99:0100 32.1b 4F.70 06.40 54.12 15.70
use d to check your work:
-d 100
then write out 5 bytes:
-rcx
CX 0000
:5
-w
Writing 00002 bytes
-q

If you edit the document make sure you use rcx each time before you
write the data to check/change the filelength

HTH
Jonathan
niko
2006-11-03 15:34:35 UTC
Permalink
Yeah.

I am not describing something that he well use for printing.
I give only a tip how he can test received spool to detect wher can be a
problem.

Did he get correct escape codes etc...
Some speciffic things I have tested that way and this was helpfull to
detect problems.

Niko.
Gary Segal
2006-11-06 18:23:43 UTC
Permalink
Thank you all for all your help.

I finally got it to open, but it prints garbage line at the beginning.
As soon as I will take care of it, I will post all the steps that I
did.?
Thanks again
Gary

that 1 guy
2006-11-03 13:45:51 UTC
Permalink
here's how we open a drawer for a clients POS System.


*************** Beginning of data ****************************
0001.00 H
0002.00 FEPSON O F 80 OF PRINTER

0003.00 C* *ENTRY PLIST
0003.01 C EXCPTDONE

0003.02 C SETON
LR
0037.00 OEPSON E 00 DONE
0041.01 O 18
X'03051B70002550'
****************** End of data *******************************


hope that helps

that 1 guy
d***@lcor.com
2006-11-03 14:36:44 UTC
Permalink
This example is using ASCII pass through which allows ASCII characters
to be sent within the normal AS400 print stream and is extremely useful
for sending PCL commands to printers. What the code below means is:
X'03 - start ASCII pass thru,
05 take the next 5 hex characters (this value is in hex so 10 would
mean next 16 )
1B70002550 this is next 5 hex characters for the ASCII command which
could differ based on your needs (cash drawer config, etc) and in this
case translates to <ESC>F<NUL><EM>2. Ususally cash drawers open with
the BEL command (Hex 07), so what you see below may be a misprint.
Post by that 1 guy
here's how we open a drawer for a clients POS System.
*************** Beginning of data ****************************
0001.00 H
0002.00 FEPSON O F 80 OF PRINTER
0003.00 C* *ENTRY PLIST
0003.01 C EXCPTDONE
0003.02 C SETON
LR
0037.00 OEPSON E 00 DONE
0041.01 O 18
X'03051B70002550'
****************** End of data *******************************
hope that helps
that 1 guy
d***@lcor.com
2006-11-03 14:40:54 UTC
Permalink
I think I was a little mixed up in my translation, what it really says
is <ESC>p<NUL>%P
Post by d***@lcor.com
This example is using ASCII pass through which allows ASCII characters
to be sent within the normal AS400 print stream and is extremely useful
X'03 - start ASCII pass thru,
05 take the next 5 hex characters (this value is in hex so 10 would
mean next 16 )
1B70002550 this is next 5 hex characters for the ASCII command which
could differ based on your needs (cash drawer config, etc) and in this
case translates to <ESC>F<NUL><EM>2. Ususally cash drawers open with
the BEL command (Hex 07), so what you see below may be a misprint.
Post by that 1 guy
here's how we open a drawer for a clients POS System.
*************** Beginning of data ****************************
0001.00 H
0002.00 FEPSON O F 80 OF PRINTER
0003.00 C* *ENTRY PLIST
0003.01 C EXCPTDONE
0003.02 C SETON
LR
0037.00 OEPSON E 00 DONE
0041.01 O 18
X'03051B70002550'
****************** End of data *******************************
hope that helps
that 1 guy
Gary Segal
2006-11-06 18:19:32 UTC
Permalink
Doug,

Thank you very much. Your solution worked. I finally got it to open,
but it prints garbage line at the beginning. Do you have any idea how
to prevent it from printing?
Thanks
Gary
Post by that 1 guy
here's how we open a drawer for a clients POS System.
*************** Beginning of data ****************************
0001.00 H
0002.00 FEPSON O F 80 OF PRINTER
0003.00 C* *ENTRY PLIST
0003.01 C EXCPTDONE
0003.02 C SETON
LR
0037.00 OEPSON E 00 DONE
0041.01 O 18
X'03051B70002550'
****************** End of data *******************************
hope that helps
that 1 guy
Loading...