IOConnection is a high level programming tool that simplifies the development and creation of software for Star printers.
IOConnection exposes an easy-to-use API that gives you fundamental communications access to the printer.
IOConnection is supporting the ESC/POS Emulation.
TSP043
Windows XP (32bit only)
Windows Vista (32bit/64bit)
Windows 7 (32bit/64bit)
Windows 8 (Desktop UI 32bit/64bit)
The files that are necessary for developing applications are stored in the "/redistributables" folder.
However, the files to use are different depending on the development language and environment.
Refer to the following tables for the files to use and their storage locations.
Visual C++ |
|
---|
Visual C++ |
|
---|
The sample file has been written in Visual Studio 2005
To use IOConnection in your Visual C++ project: include the ”IOPortConnection.h” header file, link against the ”IOPortConnection.lib” library file. When you run it, put ”IOPortConnection.dll” into the same folder where the application locates. ”IOPortConnection.h” header file is written in-line with the function declarations.
Here we explain to you some functions which are commonly used within your use of IOConnection.
For the API commands that have not been mentioned here, please refer to Development Environment for the details of each cpntents.
Your usage of IOConnection always begins by opening a port.
In Visual C++
Using OpenPort function
If OpenPort failed, it will simply reture ”0” to indicate failure.
The following reasons may cause the OpenPort fails.
In Visual C++
The GetLastError function you called returns the result of ' ERROR_ALREADY_EXISTS ' back to you.
IOConnection API is described in different ways depends on each environments.
In Visual C++
all other APIs take the port handle as the first parameter.
When you have finished using the port, you must close it.
In Visual C++
This is done by calling the ClosePort API.
You are recommended to close ports as soon as you've finished using them in order to avoid the ports conflict in your system.
The OpenPort function accepts three parameters: the port name, the port settings, and the communication timeout.
We want to explain the port naming and settings parameters by the difference of the interface.
Specifying the serial port name like ”COM1” or ”COM2”
These fields are assembled with 'baudRate', 'parity', 'dataBits', 'stopBits', 'flowControl'.
Each fields are a comma-separated string described with 'baudRate', 'parity', 'dataBits', 'stopBits', 'flowControl'.
( For example: "9600,n,8,1,h")
Baud rates: This field can be one of: "115200", "57600", "38400", "19200", "9600", "4800".
Parity: This field can be one of:"n", "e", "o".
Data bit This field can be one of: "7" or "8".
Stop bit: The stopBits field must be specified as "1".
FlowControl: This field can be one of:"n", "h".
The port name parameter is formed by combining "usbprn:" with your printer's Windows printer queue name.
For the sample program attached, the printer queue name was created with 1 byte character however, two byte characters also can be used.
For example, when you want to specify a Windows queue name as "Star TSP043", you may create it as:
The port settings parameter must be the empty string.
Specifying the parallel port name like "LPT1" or "LPT2".
The port settings parameter must be the empty string.
The port name parameter is formed by combining "TCP:" with your printer's IP address.
For example, if your printer is established on the 192.168.1.102 address then you would pass
The port settings parameter must be the empty string.
The following is the description of the restrictions for this release.
Please read it carefully before you use this printer.