09-02-2009 12:15 PM
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
Solved! Go to Solution.
09-03-2009 11:47 AM
09-03-2009 03:59 PM
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.
09-03-2009 04:05 PM
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
09-03-2009 04:12 PM
09-08-2009 11:13 AM
I need to use the USB connection, I have two printer by test station
09-08-2009 12:46 PM
You've already said that.
When they are plugged in, do you or don't you see two LP resources in MAX?
09-08-2009 12:52 PM - edited 09-08-2009 12:55 PM
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
09-08-2009 01:22 PM
Dennys:
NO, the MAX is not detecting any LP or printers when plug into usb.
09-08-2009 01:30 PM
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