Announcement

Collapse
No announcement yet.

Printer Control Codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printer Control Codes

    After many months of coding & hardware debugging I finally
    have my data acquisition program running! After all of the
    hastles so far I have now run-afoul of the printer. I am using
    a great piece of trailing-edge technology - a Diablo 630. The
    manual say that 'ESC U' is the control sequence to initiate a
    1/2 carriage return (1/2 line feed). The code I have used with
    no success is:

    LPRINT CHR$(27) CHR$(85)

    Am I missing something? Has anyone had any luck sending printer
    commands?
    Thanks in advance for the help.

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

  • #2
    Assuming you are running under Windows, I have to set the Spool
    Settings to Raw to get some printer commands to work. This setting
    if found under the Printer properties. It normally defaults to EMF.

    Mike


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

    Comment


    • #3
      [QUOTE]Originally posted by Mike Burns:
      [B]Assuming you are running under Windows, I have to set the Spool
      Settings to Raw to get some printer commands to work. This setting
      if found under the Printer properties. It normally defaults to EMF.

      Mike


      I am running "vanilla" DOS 6.22

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

      Comment


      • #4

        Steve,

        Try LPRINT CHR$(27);CHR$(85)

        Regards

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

        Comment


        • #5
          John, unfortunately the semi-colon between the CHR$() arguments will have no effect, since they are optional at that point (as separators between arguments).

          However, adding one at the end of the LPRINT statement may be useful, or an implicit CR+LF will be sent to the printer nullifying the effect of the 1/2 CR to some degree.

          Therefore, please try this slight variation:
          Code:
          LPRINT CHR$(27,85);
          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected].nz

          Comment


          • #6
            Steve,

            Check your printer manual to see if there are any other control
            codes that have to be issued, which will affect line spacing.
            Years ago when I used a Radio Shack DWII that is similar to a
            Diablo 630, I was not able to do superscripting or subscripting
            unless I first issued the codes for turning off the automatic
            line feed.

            Allen

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

            Comment


            • #7

              Steve,
              I don't know exactly the Diablo 630 is doing,
              but there is a simple way to test the Line Spacing
              if the printer supports Basic Language :

              N=65

              FOR I=1 TO 60
              LPRINT CHR$(27);CHR$(N);CHR$(I)
              NEXT I

              'reset the N to other number if #65 not working

              'for i=1 to 60 sets the line spacing to i/60 of an inch for subsequent line feed commands.


              Regards




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

              Comment


              • #8
                Originally posted by Lance Edmonds:
                ....please try this slight variation:
                Code:
                LPRINT CHR$(27,85);
                Lance,
                The code snippet plugged in and played perfectly !!! In case anyone
                cares ....
                LPRINT CHR$(27, 68)
                .... gives a negative 1/2 linefeed

                Thanks everyone for the help!
                Steve

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

                Comment

                Working...
                X