Input and Output
Input and Output

Input and Output

This section oulines how to communicate with physical ports, internal ports, and the network.
ZBI allows access to the physical and network connections in the printer. Most ports are, by default, connected to the ZPL processor. When a port is opened in ZBI, the port will be disconnected 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 open when 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.

Available Ports

Port/Connection
ZBI Name
Preferred Access Commands/Functions
Serial
"SER"
OPEN, CLOSE
Parallel
"PAR"
OPEN, CLOSE
USB
"USB"
OPEN, CLOSE
ZPL parser
"ZPL"
OPEN, CLOSE
TCP Server
"TCP", "TCPX"
SERVERSOCKET, SERVERCLOSE, ACCEPT, CLOSE
TCP Client
"TCP"
CLIENTSOCKET, CLOSE
UDP Server
"UDP"
SERVERSOCKET, SERVERCLOSE, ACCEPT, CLOSE
UDP Client
"UDP"
CLIENTSOCKET, CLOSE
Email Sender
"EML"
OPEN, CLOSE
Bluetooth
"BLU"
OPEN, CLOSE
TCPx will not work on PS2 or PS100 print servers.

Creating Connections

Here is a list of the commands in this section:
OPEN
Opens a port for transmitting and receiving data.
CLOSE
Closes specific ports that are in use.
DATAREADY
Determines if there is data received on a specified port.
SERVERSOCKET
Opens a listening socket for incoming UDP packets or TCP connections.
SERVERCLOSE
Closes a listening server socket.
CLIENTSOCKET
Creates an outgoing TCP connection or sets up UDP transmissions.
ACCEPT
Accepts incoming TCP or UDP connections and assigns a channel for the connection.