Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capturing Data FROM USB Printer Zebra RW420 w/MCR
Message
From
11/09/2006 17:09:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Capturing Data FROM USB Printer Zebra RW420 w/MCR
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01152885
Message ID:
01152885
Views:
288
Connected via USB cable, Zebra RW420 Mobile Printer with MCR

The printer has a command language and I can send any command to the printer from its list of commands successfully to set values in the printer or print values, etc. However, I cannot retrieve data unless I print the value returned. How to capture any data (result) returned from the printer from issuing a command?
For example:
   set printer to name GETPRINTER()
   ??? [! U1 getvar"usb.device.friendly_name"+CHR(10)+CHR(13)]
   SET DEVICE TO SCREEN
   SET PRINTER TO 
Will return the device name, but where does it return it to?
   set printer to name GETPRINTER()
   ??? "! U1 MCR 80 ECHO T1 T2 ERRORS"+CHR(10)+CHR(13)
   SET DEVICE TO SCREEN
   SET PRINTER TO 
The above command will turn on the magnetic stripe reader and when a card is swiped, the result is the data (I can verify this if I print it), but how to capture it? The printer manual states that the result is returned to the HOST (or the pc sending the command to the printer) but where does it go to? How can I capture any result? The ECHO parameter tells the printer to print the data as well, but I just want the data returned.

Thanks for any ideas. I am having a brain cramp day (again!) :o)

According to Zebra:

Tracy,
There are no API's or DLL's available; However, the printer communicates with a host using the MCR commands. If you have a device that you want the card information to come back to, then you need to send the MCR commands from that device then scan the card. The information from the scanned card goes back to the host that sent the MCR command. When the printer is turned on the MCR is NOT active. It is not active until a valid MCR command is received. After that MCR command is received the scanned info is sent back to the host. So you will have to write code that sends the MCR command to the printer. Send the MCR command from the host.

Example:

! U1 MCR 0 ECHO T1 T2 ERRORS

Here the timeout is 0 and it won't timeout. It will wait for a card swipe.
(look at CPCL Programming Manual for more details and examples) http://www.zebra.com/id/zebra/na/en/index/resource_library/manuals.results


I am using the manual to get the correct commands, but I can only print the results, and I want to capture the results instead in order to populate fields on a form with the returned results and then print the data later. Label Vista does this so I know it can be done, but how? Does it have to be using communications directly with the USB port instead of the print driver? Using HID api?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform