On Dec 3, 6:51 pm, cla...@lairds.us (Cameron Laird) wrote:
> In article <7560161e-9456-4602-91a7-1f2da2969...@s8g2000prg.googlegroups.com>,hari <haricib...@gmail.com> wrote:
>
> .
> .
> .>3.)What does "printercommand" mean to you: is it the abstract,
> >"when
> >I push *here* on the screen, a receipt comes out *there*",
> >or the more low-level "COPY $SOME_FILE PRN:", or something
> >in-between?

>
> > There are commands to set the label size, cut position of
> >paper,CurrentPrinterstatus, this status acquiring will have response
> >from theprinter.I need to collect those responses fromprinter.

>
> .
> [details to consider
> at a later time]
> .
> .
> This is interesting. You have provided good responses, and
> we're making progress. Let's look more closely at these
> commands now. What's an example of a single command--"set
> the label size", for example. Do you know of any way to
> run it in isolation? Is it a "command-line command", or,
> simply a documented (COM?) programming interface? I entirely
> understand your aim to automate with Tcl. Put automation and
> Tcl aside for the moment, though, and just focus on one
> command: how do you exercise it not-under-automation? How
> does its response come to you? What is an example of a
> response?
>
> Are these commands documented somewhere?



Hi,
What's an example of a single command--"set
the label size", for example. Do you know of any way to
run it in isolation? Is it a "command-line command", or,
simply a documented (COM?) programming interface?

consider for setting the label size command as F (topleft
coordinates,bottom cordinates). its a 3 byte data sent to the printer.

For response consider prinetr status PC 74, need to send two bytes of
data, printer responses the status with 8 bytes.

As far as now , I have only commands set, no printer?But I need to
be ready with idea how it can be done.

So I m using a similar printer and its command set, So if this is
automated, only commands needs to be changed. Currently for this
printer, comamnds are sent through printer driver.

3.Now I m trying to send comamnd from tcl to serial printer ?but am
unable to do?
set fh [open com2: RDWR]

fconfigure $fh -blocking 0 -buffering none \
-mode 9600,n,8,1 -translation binary -eofchar {}

puts $fh 1B 40 //command to initialize printer
bad argument "40": should be "nonewline"


Is this is the proper way to send command to serial printer?For status
response,how can I read it from the printer?


Thanks and Regards
-Hari