Skip to content

Command Definition File

A command definition file is a text file (*.txt) that describes transmission data in a predefined format and is saved in ANSI format and UNICODE format.

Format

The command definition file format is as follows:

Command Definition File

Name Description
Command name Describe an arbitrary command name to be specified by DirectSendRead.
  • Use ASCII characters except for "=" and "#". When any character other than ASCII characters is written, only the character is ignored.
  • Command names are case-sensitive.
  • Registerable command name is up to 33 bytes. When 34 bytes or more are written, 33 bytes are registered, and characters after 34 bytes are ignored.
  • When describing the same command names in 1 command definition file, the first command name is registered. When the command name already registered is specified, it is ignored.
  • Write "=" between the command name and the transmission data.
Transmission data
Transmission data
Describe printer commands and data to send to the printer.
  • When specifying binary data for transmission data, describe the data in two-digit hexadecimal numbers. Separate each data with a 1-byte space.
  • The maximum transmission data size is 10240 bytes.
    Transmission data sizes of the command definition examples shown below are as follows:
    - CmdName_1 : 1 byte
    - CmdName_2 : 2 bytes
Comment Describe the command definition etc.
  • Add "#" at the beginning of the comment.
  • There is no limitation of characters to be written.
  • Comments are optional.

Examples of command definition:
  CmdName_1=01#Request printer status.
  CmdName_2=0C 10#Mark feed and get checkpoint response.

注意

  • Data in command name unit described according to the format. Be sure to describe it on 1 line for 1 command definition.

参考

  • The maximum size of a command definition file is 4 GB.
  • The number of registerable command definitions depends on the available memory of the system.

How to Use

How to use the command definition file is described.

  1. Create a command definition file.
  2. Register the command definition file in the SDK internal memory by SendDataFile.
  3. Specifying the command name by DirectSendRead executes the contents of the transmission data.

注意

  • The registered command definition is discarded by CloseMonPrinter.
  • When a new command definition file is registered after registering the command definition file, the already registered command definition is overwritten.