LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zebra TLP 2844 USB

Solved!
Go to solution

 

We are using some Zebra TLP 2844 printers under USB but the actual software is in C++ and the printers works fine, now I'm changing to LabView but it doesn't work (in LabView works fine with serial port but not with USB).

I allready have the templates to send the data to printers and are two diferent files, one is de *.BIN and the *.EJF (I'm changing just the data inside of *.EJF)

First I need to send the .BIN and next the .EJF

C++ is doing that using the next command:

 

  sprintf(cmd, "copy tracking.bin %s",prn);
  sprintf(cmd, "copy tracking.ejf %s",prn);

 

Were prn = printer pointer

 

how can I emulate the las code in labview?

 

thank you

 

PD: elimnate .txt on both files
 

0 Kudos
Message 1 of 13
(7,431 Views)
no body can help me?
0 Kudos
Message 2 of 13
(7,403 Views)

I'm not aware of an equivalent function in LabVIEW.  It would probably save time to write this in C and then use a Call Library function node to call it from LabVIEW.

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 3 of 13
(7,384 Views)

Hi lmontoya,

 

There are two ways to approach this,

 

1) Use the existing driver created in C++, compile a DLL and call that DLL in LabVIEW. Otherwise, LabVIEW  can't directly translate the commands you indicated.

2) Use our NI-VISA driver to control your device. This requires a new set of commands. The USB Instrument Control Tutorial will allow you to configurea USB-RAW device to be controled by NI-VISA.

 

I highly recommend using option 1, the one Ben recommended 

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 4 of 13
(7,381 Views)
Another option might be the VISA Write From File with LPT1 as the resource name.
0 Kudos
Message 5 of 13
(7,379 Views)

I need to use the USB connection, I have two printer by test station

 

 

0 Kudos
Message 6 of 13
(7,328 Views)

You've already said that.

 

When they are plugged in, do you or don't you see two LP resources in MAX?

0 Kudos
Message 7 of 13
(7,316 Views)

lmontoya wrote:

 

We are using some Zebra TLP 2844 printers under USB but the actual software is in C++ and the printers works fine,

First I need to send the .BIN and next the .EJF

C++ is doing that using the next command:

 

  sprintf(cmd, "copy tracking.bin %s",prn);
  sprintf(cmd, "copy tracking.ejf %s",prn);

 

Were prn = printer pointer

 


I think you actually omit the interesing part in your C program. What you show here simply formats the string "copy tracking.bin <whatever the prn variable contains, probably LPT1 or why not ZEBRA>"

 

This in itself does absolutley nothing but after that you probably have a call to execl() or something like that where you pass the cmd variable as parameter. The equivalend to this in LabVIEW is the System Exec vi. However if you want to execute internal cmmands that are internal to the DOS shell you have to invoke that DOS shell first by adding the cmd.exe to the front of your command. Something like "cmd.exe copy tracking.bin ZEBRA".

 

Rolf Kalbermatter

Message Edited by rolfk on 09-08-2009 07:55 PM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 13
(7,313 Views)

Dennys:

NO, the MAX is not detecting any LP or printers when plug into usb.

 

0 Kudos
Message 9 of 13
(7,297 Views)

lmontoya wrote:

Dennys:

NO, the MAX is not detecting any LP or printers when plug into usb.

 


So tell us first what string the prn variable does contain and then what you do with the cmd variable AFTER the sprintf() function. sprintf() simply formats a text into a memory buffer and can by no means cause any printer, USB or normal LPT, to do anything.

 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 13
(7,293 Views)