sending hexadecimal control characters, how to?

Andre Garzia andre at andregarzia.com
Thu Dec 3 08:39:07 EST 2009


Folks,

just a doubt here. I was going to create some shop management software here
in Brazil, but here, due to law, if a software is to interface with a
receipt printer, then you need to "approve" your software with the
goverment, this changes from state to state but it is present in all states
and it means that once they review your source code and test your software,
your software is approved and frozen, you cannot update it. If you update it
then you need to go thru the approval process again. If your software is not
approved and you sell it, then there's a fine and it might even have
jailtime.

So I did not create the software. Is this so in other countries?

Andre

On Thu, Dec 3, 2009 at 9:03 AM, Peter Alcibiades <
palcibiades-first at yahoo.co.uk> wrote:

>
> 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.
> _______________________________________________
> 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
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list