StarIO for Windows®

StarIO is a high level programming tool that simplifies the development and creation of software for Star printers.
StarIO exposes an easy-to-use API that gives you fundamental communications access to the printer. This API is supplied pre-formed for all the most popular programming environments including Java and .NET, and exposes the same functionality regardless of the printer model or the communications interface you’re using.

StarIO is supporting the Star Line Mode and the StarPRNT Mode.

Operating Environment

Supported models

Thermal Printer
TSP650II, FVP10, TSP800II, TSP650, TSP700II, TUP500, TUP900, mPOP
Hybrid Printer
HSP7000
Dot Matrix Printer
SP700, SP500
Portable Printer
SM-L200, SM-S210i, SM-S220i, SM-S230i, SM-T300i, SM-T400i
DK-AirCash
(Cash Drawer Controller)
SAC10

 

Note for Portable Printers

StarIO for Windows do not work with the following firmware version because StarPRNT emulation is not implemented.

Model Namefirmware version
SM-S210i
older than 3.0
SM-S220i
older than 3.0
SM-T300i
older than 3.0
SM-T400i
older than 3.0

 

OS Requirement

Windows 7 (32bit/64bit)
Windows 8 (Desktop UI 32bit/64bit) *WindowsRT is not supported
Windows 8.1 (Desktop UI 32bit/64bit) *WindowsRT 8.1 is not supported
Windows 10 (32/64bit) *Windows 10 Mobile Edition and IoT Edition is not supportedく

 

Printer Setting in Star IO V2.2.1.0

■ Setting Printer DIP SW1

Serial
(COM)
Parallel
(LPT)
USBEthernet
(LAN)
BluetoothRemarks
Vendor ClassPrinter Class
TSP650II8=OFF8=OFF
5=OFF
5=OFF:Set to USB Vendor Class
8=OFF:Set NSB enable
FVP108=OFF8=OFF
5=OFF
5=OFF:Set to USB Vendor Class
8=OFF:Set NSB enable
TSP800II8=OFF8=OFF
5=OFF
5=OFF:Set to USB Vendor Class
8=OFF:Set NSB enable
TSP6508=OFF8=OFF
5=OFF
--- 5=OFF:Set to USB Vendor Class
8=OFF:Set NSB enable
TSP700II8=OFF8=OFF
5=OFF
5=OFF:Set to USB Vendor Class
8=OFF:Set NSB enable
TUP5005=OFF--- 5=OFF:Set to USB Vendor Class
TUP9005=OFF6=OFF
(Mode 1)
--- 5=OFF:Set to USB Vendor Class
6=OFF:Set to USB Mode 1(Firmware version 4.4 or earlier)
(Mode1:USB Printer Class New Type)
HSP70008=OFF5=OFF--- 5=OFF:Set to USB Printer Class
8=OFF:Set NSB enable
SP7005=OFF 5=OFF:Set to USB Vendor Class
SP5005=OFF--- 5=OFF:Set to USB Vendor Class
SAC10------------
※ The blank area is factory default.
※ The Bluetooth interface is available on TSP650II, TSP700II, TSP800II, FVP10, SP700(SP742), SAC10, mPOP, SM-L200, SM-S210i, SM-S220i, SM-S230i, SM-T300i and SM-T400i.

※ mPOP, SM-L200, SM-S210i, SM-S220i, SM-S230i, SM-T300i and SM-T400i do not have DIP SW.

 

■ Setting Printer Memory Switch (MSW)

Serial
(COM)
Parallel
(LPT)
USBEthernet
(LAN)
BluetoothRemarks
Vendor ClassPrinter Class
TSP650II
FVP10
TSP800II
TSP650---
TSP700II
TUP500MSW7-8=1MSW7-8=1---MSW7-8=1:Set NSB enable
TUP900MSW7-8=1---MSW7-8=1:Set NSB enable(Firmware version 4.4 or earlier)
mPOP------------
HSP7000---
SP700MSW4-7=1MSW4-7=1MSW4-7=1:Set NSB enable
SP500MSW4-7=1MSW4-7=1---MSW4-7=1:Set NSB enable
SM-L200------------
SM-S210i------------
SM-S220i------------
SM-S230i------------
SM-T300i------------
SM-T400i------------
SAC10------------
※ The blank area is factory default.
※ The Bluetooth interface is available on TSP650II, TSP700II, TSP800II, FVP10, SP700(SP742), SAC10, mPOP, SM-L200, SM-S210i, SM-S220i, SM-S230i, SM-T300i and SM-T400i.

 

■ Setting Interface Card DIP Switch (DIPSW)

The following setting is available only when you use 'ResetDevice Function' with Serial Interface.

I/FDIPSW SettingRemarks
Serial I/FDIPSW1-7=ONResetting by DSR (#6): Valid
※ After finishing the above setting, the printer reset also can be effected even at Serial I/F PortOpen

Back to Top

Development Environments

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.

32bit applications
Visual C++
/bin_Win32/StarIOPort.dll
/lib_Win32/StarIOPort.lib
/include/StarIOPort.h
Visual C#
Visual Basic .NET
/bin_Win32/StarIOPort.dll
/bin_anycpu/StarIO.dll

/StarIO.xml
Java
/bin_Win32/StarIOPort.dll

/StarIOJ.dll

/stario.jar
Visual Basic 6.0
/bin_Win32/StarIOPort.dll

/StarIOPort.bas

64bit applications
Visual C++
/bin_x64/StarIOPort.dll
/lib_x64/StarIOPort.lib
/include/StarIOPort.h
Visual C#
Visual Basic .NET
/bin_x64/StarIOPort.dll
/bin_anycpu/StarIO.dll

/StarIO.xml
Java
/bin_x64/StarIOPort.dll

/StarIOJ.dll

/stario.jar

 

Visual C++

The sample file has been written in Visual Studio 2005
To use StarIO in your Visual C++ project: include the ”StarIOPort.h” header file, link against the ”StarIOPort.lib” library file. When you run it, put ”StarIOPort.dll” into the same folder where the application locates. ”StarIOPort.h” header file is written in-line with the function declarations.

 

Visual C# / Visual Basic .NET

The sample file has been written in Visual Studio 2005
Building your application by adding ”StarIO.dll” to your project reference setting. When you run the application, drop ”StarIO.dll” and ”StarIOPort.dll” into the same folder where your application file is located.
Each descriptions for API are available in the ”StarIO.xml” file.Keep this XML file in the same directory as ”StarIO.dll" and view the documentation using Visual Studio’s IntelliSense and Object Browser features.

 

Java

The sample files are compliant with Java Random Ver.1.5.
Specifying "StarIO.jar" to both the compile (javac) and the runtime (java) classpath definitions. When you run the application, drop ”StarIO.jar”, ”StarIOJ.dll” and ”StarIOPort.dll” into the same folder where your application file is located.
The execution sample for the compile and application running commands are mentioned at the header of the ”StarIO_Sample.java” file. For the detail descriptions of each commands, please refer to Here.

 

Visual Basic 6.0

Adding the ”StarIOPort.bas” file as a module and compiling.
When you run it, put ”StarIOPort.dll” into the same folder where the application locates. The description is listed in each parts of the function declaration statement in ”StarIOPort.bas” file .

Back to Top

Programming & Usage

Here we explain to you some functions which are commonly used within your use of StarIO.
For the API commands that have not been mentioned here, please refer to Development Environment for the details of each cpntents.

  1. OpenPort

    Your usage of StarIO always begins by opening a port.

    ■ Openning a port

    Visual C++
    Using OpenPort function
    If OpenPort failed, it will simply reture ”0” to indicate failure.

    Visual C# and Visual Basic .NET
    Calling the Port class's static GetPort method
    When it is successful, a port handle (or object) will be returned back to you.
    When the port you've requested could not be opened, a PortExceptionwill be thrown.

    Java
    Calling the 'StarIOPort class' getPort static method.
    When the port that you've requested could not be opened, a StarIOPortException will be thrown.


    The following reasons may cause the OpenPort fails.

    1. The specified port does not exist.
    2. Port setting is incorrect.
    3. Any of the underlying OS system calls fail themselves (System Error).
    4. When another process has already opened the port that you're attempting to use.

    The reason 'd' is a failure that you can likely recover from.

    ■ Distinguishing OpenPort Errors (When the Port is used by other process).

    Visual C++
    The GetLastError function you called returns the result of ' ERROR_ALREADY_EXISTS ' back to you.

    Visual C# / Visual Basic .NET / Java
    The IsPortInUseFailure property returns the ' True' back to you.


  2. The usage of StarIO API

    StarIO API is described in different ways depends on each environments.

    ■ The usage of StarIO API ( Beside OpenPort)

    In Visual C++ / Visual C#
    all other APIs take the port handle as the first parameter.

    In Visual Basic .NET / Java
    calling the port object's methods.


  3. ClosePort

    When you have finished using the port, you must close it.

    ■ Port closing

    In Visual C++
    This is done by calling the ClosePort API.

    In Visual C# / Visual Basic .NET
    This is done by calling the port class ReleasePort static method.

    In Java
    This is done by call StarIOPort class' StarIOPort.releasePort static method.

    You are recommended to close ports as soon as you've finished using them in order to avoid the ports conflict in your system.
    When writing programs in one of the .NET languages or in Java, it is often convenient to close the port in the finally part of a try / catch / finally construct.

Port specifying method in OpenPort

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.

Serial
■ Port Name

Specifying the serial port name like ”COM1” or ”COM2”


■ Port Setting

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,n")

Baud rates: This field can be one of: "115200", "57600", "38400", "19200", "9600", "4800".

Parity: This field can be one of:"n", "e", "o".

  • n: For none.
  • e: For even.
  • o: For odd.

Data bit This field can be one of: "7" or "8".

Stop bit: This field can be one of: "1" or "2".

FlowControl: This field can be one of:"n", "h", "c".

  • n: For no flow control
  • h: For hardware flow control (DSR)
  • c: For hardware flow control (CTS)


Parallel
■ Port Name

Specifying the parallel port name like "LPT1" or "LPT2".


■ Port Setting

The port settings parameter must be the empty string.


USB Vendow Class
■ Port Name

Three different port name parameter forms are accepted.

  • 1. Do not specify the port name
  • 2. Specifying USB serial number
  • 3. Specifying COM port name

This is useful when you are using only one printer and your printer does not have a USB serial number set (which is the default setting).


1. Do not specify the port name

"usbven:"
"usbven:" instructs StarIO to open the first Star USB Vendor Class device it finds.
When there is no USB serial number set, connecting your printer to different USB ports on the computer will cause it to be assigned varying COM port names - and this would otherwise complicate the use of OpenPort.


2. Specifying USB serial number

"usbven:XXXXXXXX"
"usbven:" causes StarIO to open the printer whose serial number you've specified.
This is usefule in two scenarios:
  • To avoid new ports being created when the printer is connected to the computer's different USB ports.
  • When you have multiple printers connected simultaneously, your printer can be identified.
Note: Star's printers do not have USB serial numbers configured from the factory defaul. You will have to writed a serial number into the device in order to use this facility.


3. Specifying COM port name

"usbven:comX"
"usbven:" causes StarIO to open communications with the printer based on the COM port name it’s been natively assigned.
You can determine what name this is by looking in the Windows Device Manager.
Note: If the printer you are using does not have the USB serial number, each time it gets connected to a different USB port it will be assigned a new COM port name. In this case, you need to change the specified COM port name.


■ Port Setting

The port settings parameter must be the empty string.


USB Printer Class
■ Port Name

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 TSP800II(TSP847II)", you may create it as:

"usbprn:Star TSP800II (TSP847II)"


■ Port Setting

The port settings parameter must be the empty string.


Ethernet
■ Port Name

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

"TCP:192.168.1.102" in as the port name parameter.


■ Port Setting

The port settings parameter must be the empty string.


Bluetooth
■ Port Name

The port name parameter is formed by combining "BT:" with COM port name.
For example, when you want to specify a Bluetooth port name as "COM3", you may create it as:

"BT:COM3" in as the port name parameter.


■ Port Setting

The port settings parameter must be the empty string.

Restrictions & Precautions

The following is the description of the restrictions for this release.
Please read it carefully before you use this printer.

  • This software may conflict with other software that shipped with or for your printer model. If you choose to deploy this alongside other software, please conduct thorough testing to confirm that no such conflicts exist.

When you are using a serial interface

  • When you are using "ResetDevice function", "True" will alway be returned back to you even the printer power is turned off or the printer is connected with your computor.

When you are using a USB interface Printer Class Mode.

  • The "ReadPort function" does not support with old firmware.
    The following is the supporting firmware version by models.

    Model NameSupporting firmware version
    TSP650II1.0 or later
    FVP101.0 or later
    TSP800II1.0 or later
    TSP6502.0 or later
    TSP700II2.0 or later
    TUP5001.0 or later
    TUP9001.2 or later
    mPOP1.0 or later
    HSP70001.0 or later
    SP7002.0 or later
    SP5004.0 or later
    SM-L2001.0 or later
    SM-S210i×
    SM-S220i×
    SM-S230i1.0 or later
    SM-T300i×
    SM-T400i×
    SAC10×


When you are using a ethernet interface

  • The WritePort function succeeds even when the printer is offline. This is because the Ethernet card continues to buffer incoming data regardless of the printer's current status. Any data buffered while the printer is offline will be printed once the printer becomes online again.
  • "ResetDevice function" is not supported. False is always returned back.
  • The "GetParsedStatus", "GetParsedStatusEx", "BeginCheckedBlock", "BeginCheckedBlockEx", "GetOnlineStatus" methods will not be detected in real time when the printer is disconnected powered off.
    One possible solution is to send the Star Line Mode <ETB> command at regular intervals, confirming that the printer's ETB counter increments appropriately.

When you are using a Bluetooth interface

  • The following is the supporting models.

    Model NameBluetooth interfaceSupporting firmware version
    TSP650IIOK1.0 or later
    FVP10OK2.0 or later
    TSP800IIOK2.0 or later
    TSP650×-
    TSP700IIOK5.0 or later
    TUP500×-
    TUP900×-
    mPOPOK1.0 or later
    HSP7000×-
    SP700OK(only SP42)4.0 or later
    SP500×-
    SM-L200OK1.0 or later
    SM-S210iOK1.0 or later
    SM-S220iOK1.0 or later
    SM-S230iOK1.0 or later
    SM-T300iOK1.0 or later
    SM-T400iOK1.0 or later
    SAC10OK1.0 or later

  • "GetOnlineStatus function" is not supported. True is always returned back.
  • "ResetDevice function" is not supported. False is always returned back.

Version History

Ver. No.Date of RevisionChanges
Version 1.2.0.0Mar. 2009Single Release 1st Version.
Version 1.2.1.0Mar. 2010Added a new model "FVP10", "TSP800II".
Version 1.2.2.0Jul. 2010Added a new model "SP500".
Error correction. (Printer Setting)
The limitation of USB interface Vendor Class Mode and parallel interface was released.
Version 1.2.3.0Dec. 2010Fixed a bug of "GetParsedStatusEx" method.
Version 1.3.1.0Apr. 2012Fixed a bug of offline in multiple printers environment.
Fixed a bug of "ERROR_ACCESS_DENIED" generated in "OpenPort" method.
Version 1.3.2.0Jul. 2012Added a new model "TUP500", "TUP900".
Version 1.3.3.0Dec. 2012Added a new model "TSP650II".
Added a new interface "Bluetooth". (TSP650II only)
Version 1.3.3.0Mar. 2014Added a new model "SAC10".
Version 2.0.0.0Apr. 2014Added new models support Bluetooth interface "TSP700II" "TSP800II" "SP700(SP742)".
Version 2.1.0.0Jan. 2015Added a new model support Bluetooth interface "FVP10".
Version 2.2.0.0Sep. 2015Added a new model "mPOP", "SM-L200", "SM-S210i", "SM-S220i", "SM-S230i", "SM-T300i", "SM-T400i".

Legal Information

Copyright 2009-2015 Star Micronics Co., Ltd.
Any company names and product names mentioned herein may be the trademarks or respective owers.
Windows® is a registered trademark of the Micosoft Corporation.