Sending a printer native command during printing, using VB S’abonner

0
Avatar
Martin Florian

Hi everyone,

as the title states, I’d like to send a native command to the printer when certain criteria is met.

After sending a print job to the printer I’d like the printer to pause after printing 20 labels. After pressing the pause button on the printer itself, it should resume printing the next 20 labels before pausing again, repeating this behavior until the total number of copies specified in BarTender has been printed.

The solution I’m trying to realize consists of a serialized data field, used as a counter which increments +1 after every printed label, and a VB script that checks after every printed label, whether the value of the serialized field is 20 or a multiple thereof. If the value is divisible by 20, send the printer’s native pause command:

    Dim fract

    Dim whole

 

    fract = Value/20

    whole = Fix(fract)

 

    If (fract - whole) = 0 Then

      //send pause command to printer

    End If

 

The printer’s native command, which pauses it:     ESCp1

The ESC command (without the p1) is                  in ASCII: 27                         in Hex: 1B

 

Can someone help me to send the ESCp1 command to the printer?

I was thinking of adding the script to the serialized data field as a Transform Event set to OnPostSerialize. If I’m completely off, please point me in the right direction.

 

I’d be very grateful for any help you could give me!

4 commentaires

0
Avatar
Pete Thane
Actions pour les commentaires Permalien

Hi,

I am not sure whether this is possible as the Pause Printing Command is added by the driver and not in the label template and printer commands..

That being said, if you are using one of Seagull's drivers and go into the Document Properties>Stock screen there should be an option to set this up in driver.for example 

  • For a Zebra Printer you need to adjust the Feed Mode>Pause option and amend it to Specified Interval and then set it to 20
  • For a Datamax O'Neill - Post-Print Action and choose Pause and adjust the Occurrence
  • For a Sato - Media Handling > Pause and Occurrence similar to the Datamax

Hopefully this will get you up and running as you require.

Pete

0
Avatar
Martin Florian
Actions pour les commentaires Permalien

Hi Pete,

thanks for taking the time to answer my question.

I'm using a cab printer. Unfortunately their drivers don't include this particular functionality.

Adding the required p1<CR> command in the Action List will pause the printer, but only once at the very beginning of the print job. I tried to implement the solution I mentioned in the top post by adding PCM.WriteLine to change the printer code, but wasn't successfull. (Not possible in this particular case or simply my lack of coding skills?)

Pausing the printer after a predetermined number of labels seems like a rather simple feature to implement...

Thanks again for your help.

0
Avatar
Pete Thane
Actions pour les commentaires Permalien

Hi Martin,

If you uses Seagull's CAB driver then you will have that option available to you.

Pete

0
Avatar
Martin Florian
Actions pour les commentaires Permalien

Hi Pete,

thanks for pointing that out. I finally had the chance to install the Seagull drivers. Just as you said, they include the option of enabling "pause and cut" or “pause” and adjusting its occurrence.

I was also able to tell the printer to cut after every printed label. This way I achieved my goal of printing several sets of 20 individually cut labels.

Problem solved. Absolutely no VB necessary.

Thanks for all your help.

Martin

Vous devez vous connecter pour laisser un commentaire.