Is it possible to use USB HOST port in ZBI program

// Expert user has replied.
B Bastien Apchain 3 years 6 months ago
142 5 0

Hello,
I developed a ZBI program to print labels that depend on information retrieved via TCP port.
In case of network issue, I need to be able to connect a barcode scanner to the Usb Host port and retrieve the data to replace the normal TCP data.
But I can't find the correct port... I try USB_HOST which is used on SGD printer command but it doesn't work.
If you have any ideas???
Thanks in advance for your help !

Please Register or Login to post a reply

5 Replies

N Nicolas Gingreau

Unfortunately the USB Host port can't be opened in the ZBI. This port is reserved for USB-Mirror and Print Station functionalities.

M Matthew Twyman

I have ZBI program to print labels that depend on barcode data from the USB Host.
I realize I can use ZPL to capture USB Host input, however, I need the data inside a ZBI program in order to further process to network resources.
I can't determine the correct port name or syntax... Please help!

A Alexander Palchikov

Hello.
I think the following video can help you: https://youtu.be/bPYB8iq8goE?t=352
Could you please provide more details:
What is a model name of your printer?
Can you show your ZBI code?
As far as I understand you need just open USB port in your ZBI code and then listen to it.
Below you can find a sample of ZBI code for receiving data from another device.
10 close all
20 open #1: name “USB”
30 open #2: name “ZPL”
40 input #1: A$
50 pring #2: “^XA^FO50,50^A0N,50,50^FD"&A$&"^FS^XZ”
60 goto 40
Alexander Palchikov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

B Bastien Apchain

Hello Alexander,
Thanks, but I already know this video.
In my case I wish to use the Usb Host port on a Zebra ZD420 (the A-Type Usb port which is next to the classic B-type Usb port to connect to computer).
I already use this code:
open #1: name "USB"
The problem is that use the data from the B-Type Usb port not from the Usb-Host port.

E Elton Saunders

I received the following from Zebra Tech Support and thought it made sense to post here to save other from the trouble of trying this:

The USB Host is not a port that can be used with ZBI (6/22/2018) Most ports are, by default, connected to the ZPL processor. When a port is opened in ZBI, the port will bedisconnected from ZPL and connected into the interpreter. Depending on the type of connection, there are two methods you may use to start the connection. For the static connections, the OPEN command should be used. These are the connections that you openwhen starting your program and leave open for the duration of your program. For dynamic connections, servers and clients are set up following the "Sockets" model. On servers, the actual connections are started upon successful calls to ACCEPT. Below are the available connections that can be made and the preferred accessors.

Serial "SER"
Parallel "PAR"
USB "USB"
"USB" is NOT using the USB Host port on the printer. It is utilizing the USB port used for printing.
ZPL parser "ZPL"
TCP Server "TCP", "TCPX"
TCP Client "TCP"
UDP Server "UDP"
UDP Client "UDP"
Email Sender "EML"
Bluetooth "BLU"

CONTACT
Can’t find what you’re looking for?