sending hexadecimal control characters, how to?

Peter Alcibiades palcibiades-first at yahoo.co.uk
Thu Dec 3 06:03:53 EST 2009


Sarah, brilliant!  It is indeed a receipt printer.  So do you maybe know how 
to do the next part?  In order to activate the paper cutter on it, one
is supposed to do this to trigger the auto cutter drive:

<ESC> “d” “0” or <ESC> “d” <0>
(1B)H (64)H (30)H or (1B)H (64)H (00)H
<ESC> “d” “1” or <ESC> “d” <1>
(1B)H (64)H (31)H or (1B)H (64)H (01)H

So do you have to convert some or all of this to ascii, and then
put that into the text?  And if so how?

The cash drawer via control 7 is pretty much essential, the paper cutter
would be very nice if possible.

Peter


Sarah Reichelt-2 wrote:
> 
> On Thu, Dec 3, 2009 at 7:53 PM, Peter Alcibiades
> <palcibiades-first at yahoo.co.uk> wrote:
>> I need to send a plain ascii text file to a printer, which is going to be
>> done, let's assume the file is printest, with
>>
>>        cat printest>/dev/usb/lp0
>>
>> Which just dumps the text file to that device.  There might be other ways
>> to do it, but that is verified to work.
>>
>> For this to do some other stuff, it needs to have hex 07 at the end of
>> it.
>> Probably very simple but I never did this before
>>
>> How do you do it?  Do I have to use send a raw key ascii code number
>> somehow?
> 
> I have had a similar case where I had to send binary characters to a
> receipt printer e.g. CHR 27.
> It worked fine when I sent numToChar(27) instead,so I suggest you
> convert your hex to decimal, then try sending numToChar of whatever
> you get.
> (I realise that if it is only hex 07, then sending numToChar(7) is
> what you need to try, but there might be others, which is why I
> explained my logic).
> 
> If this doesn't work, let me know and I will check my old code.
> 
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://n4.nabble.com/sending-hexadecimal-control-characters-how-to-tp947501p947554.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list