POS kick drawer
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
POS kick drawer
I only found one post ages ago for this kind of question and it never really answered it
Ive got my printer installed and livecode prints out a nice dynamically filled invoice to the USB printer by setting the printer name then simply telling it to print card.
now then. I can set in the windows print software for that printer that if a cash drawer is attached i can tell it to open the drawer when the print is done (or at the start of the print) however i dont want the drawer to always open when printing. Or sometimes i was the drawer to open without printing. I tried one of the methods listed here
http://support.epostraders.co.uk/suppor ... erKick.pdf
in microsoft word i set the font to "control" and told it to print just an A in that font and it kicks the drawer without printing.
this doesnt really help me from livecode though and i cant even find the font "control" in livecode.
The 2nd method that looks promising is to send an ESC command to the USB printer.... but this one leaves me clueless. The other programming advice they give i assume is something like VB or C++ or something which is gibberish to me and also doesnt help in livecode.
Has anyone been down this path and has an answer for me? Ive been all over google and still cant find specifics
Ive got my printer installed and livecode prints out a nice dynamically filled invoice to the USB printer by setting the printer name then simply telling it to print card.
now then. I can set in the windows print software for that printer that if a cash drawer is attached i can tell it to open the drawer when the print is done (or at the start of the print) however i dont want the drawer to always open when printing. Or sometimes i was the drawer to open without printing. I tried one of the methods listed here
http://support.epostraders.co.uk/suppor ... erKick.pdf
in microsoft word i set the font to "control" and told it to print just an A in that font and it kicks the drawer without printing.
this doesnt really help me from livecode though and i cant even find the font "control" in livecode.
The 2nd method that looks promising is to send an ESC command to the USB printer.... but this one leaves me clueless. The other programming advice they give i assume is something like VB or C++ or something which is gibberish to me and also doesnt help in livecode.
Has anyone been down this path and has an answer for me? Ive been all over google and still cant find specifics
Re: POS kick drawer
You could try making a field with the ASCII control chars from the PDF : chr(27) and so on. Then have a button which prints the contents of the field. I'd have a try here but apart from not having a pos drawer I am not handy to access computer atm and just have this phone.
Re: POS kick drawer
ah well the main question is how to tell it to print ascii characters. it cant be as simple as typing chr(27) in a field. it would just print chr(27)
Re: POS kick drawer
the same way i can type:: answer"hello" . is it possible to type:: print"hello".. or in my case print the ascii stuff?
Re: POS kick drawer
i feel like a moron. I tried loading on the generic text thing to try it out ( http://support.epostraders.co.uk/suppor ... erKick.pdf ) however it says i need to press and hold the Esc key. When i do this the window closes
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: POS kick drawer
I can' test it here, but you could try
and for the ESC problem you could try to trap escapeKey
Code: Select all
revPrintText numToByte(27)
Code: Select all
on escapeKey
end escapeKey
shiftLock happens
Re: POS kick drawer
hmm. i typed the below. First thing that hapened was it popped open the print window which i dont want. At least when using the normal print this stack it will just print with no dialog box. secondly i dont think the escape is working. it prints a little slip with ←p0↓· or something close to that the down arrow looks more like a vertical bar with a small right bar sticking out of the middle of it and the last one is a u with accent on it. weird.
edit
solved the print window thing with revShowPrintDialog showPageSetup,showPrintDialog. However the fact that it prints what im getting and it doesnt print p0 50 500 when i type (alt25) ↓ i get the down arrow not 50
Code: Select all
revPrintText numToByte(27)&numToByte(112)&numToByte(48)&numToByte(25)&numToByte(250)
solved the print window thing with revShowPrintDialog showPageSetup,showPrintDialog. However the fact that it prints what im getting and it doesnt print p0 50 500 when i type (alt25) ↓ i get the down arrow not 50
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: POS kick drawer
Hi,
I'm seldom on Win (mostly for testing only). But this is here now more hardware specific.
The arrows are a good sign because they indicate that you are sending non-printable chars that have some pseudographic display on screen or printer.
So I looked into your POS manual and found that they are using character code table PC437.
Options to go on.
I can think of the following. (May be you already know most. Then this is for other readers.)
http://en.wikipedia.org/wiki/Code_page_437
http://en.wikipedia.org/wiki/Escape_sequence
http://en.wikipedia.org/wiki/Control_character
CP437 fonts (for Win, also good for displaying pseudo graphics, DOS-like).
http://www.microsoft.com/typography/fon ... x?FMID=708
http://eistee.gmxhome.de/ascii/indexen.htm
Unicode mapping for codepage 437.
ftp://ftp.unicode.org/Public/MAPPINGS/V ... /CP437.TXT
Looks to be "a lot", but they explain everything thoroughly. Presumably you have less problems with that than I do. In any case I would give it a try for at least several hours.
If you succes it would be fine to summarize in a note here how you managed/solved the code page issue within LC.
Hermann
I'm seldom on Win (mostly for testing only). But this is here now more hardware specific.
The arrows are a good sign because they indicate that you are sending non-printable chars that have some pseudographic display on screen or printer.
So I looked into your POS manual and found that they are using character code table PC437.
Options to go on.
I can think of the following. (May be you already know most. Then this is for other readers.)
- Test if the driver awaits HexCode for the nonprintable control chars from the low code page region.
- Convert your input with a codeTable function (from web or faster: make your own)
- [ install an asciifont that displays table PC437 (see font links below) ]
- install a PC437 keyboard layout; ready made from web or use
http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx
http://en.wikipedia.org/wiki/Code_page_437
http://en.wikipedia.org/wiki/Escape_sequence
http://en.wikipedia.org/wiki/Control_character
CP437 fonts (for Win, also good for displaying pseudo graphics, DOS-like).
http://www.microsoft.com/typography/fon ... x?FMID=708
http://eistee.gmxhome.de/ascii/indexen.htm
Unicode mapping for codepage 437.
ftp://ftp.unicode.org/Public/MAPPINGS/V ... /CP437.TXT
Looks to be "a lot", but they explain everything thoroughly. Presumably you have less problems with that than I do. In any case I would give it a try for at least several hours.
If you succes it would be fine to summarize in a note here how you managed/solved the code page issue within LC.
Hermann
shiftLock happens
Re: POS kick drawer
Hi,
Another thing, dunno if you can address/ map the printer to a COM: port. In this case, you could talk directly to it, even in binary. See "open file" in the dictionary.
Hope I could give you new ideas for testing ;-)
Have you tried it with spaces? "revPrintText numToByte(27) && numToByte(112) && ..." ? And maybe with "numtochar" instead of "numtobyte"?Da_Elf wrote:Code: Select all
revPrintText numToByte(27)&numToByte(112)&numToByte(48)&numToByte(25)&numToByte(250)
Another thing, dunno if you can address/ map the printer to a COM: port. In this case, you could talk directly to it, even in binary. See "open file" in the dictionary.
Hope I could give you new ideas for testing ;-)
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: POS kick drawer
ok, after extensive searching and trying and prodding none of the darned ascii stuff worked for me. I knew i could use a special font which i found in word called "control" and simply print an "A". but i couldnt find that font anywhere in livecode. However in the printer utilities i did find a place that can map one font to the control font. So i selected courier new (id never use that font) and mapped it to control font. I made a tiny substack with a field in it with a letter A and font set to courier new. when i printed the stack i get the correct responce of the drawer popping open. unfortunately a small slip of paper is fed and cut so have to work on that one now. but whoohoo. i get the drawer open now
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: POS kick drawer
I think the problem is that the print command isn't what you want. Printing will probably always cause a paper feed. Instead try opening the printer port using the "open file" command as was suggested and then just write to it. Or use sockets. Using the com port should also avoid needing any particular font.
The syntax isn't listed in the dictionary under "open file" but you can find it if you look up "com".
The syntax isn't listed in the dictionary under "open file" but you can find it if you look up "com".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: POS kick drawer
Yet another approach. Did you already have a look at this?
Building a DIY touch screen POS system
Cheap. Especially if you use a Raspberry Pi as server.
It uses this open source project, that has a *lot* of options: Unicentaopos.
Source is java, but how to connect to hardware is presumably portable to LC.
Building a DIY touch screen POS system
Cheap. Especially if you use a Raspberry Pi as server.
It uses this open source project, that has a *lot* of options: Unicentaopos.
Source is java, but how to connect to hardware is presumably portable to LC.
shiftLock happens