The text of a manual · part 12 of 23
CiMAX 78xx Scanner Technical Reference Manual: CHAPTER 6 Host Commands & Downloads, pages 97 to 106
Pages 97 to 106 of 201, from CiMAX 78xx Scanner Technical Reference Manual
The original document is the PDF (2.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the RVSI CiMatrix 7800, Sick 7850 and Siemens 7800
Page 97
6 Host Commands & Downloads
CHAPTER 6
This chapter describes how to use a Starnode network and the serial ports to connect the scanner to a host computer to communicate with, control and download C programs.
Introduction The scanner can be connected to a host PC computer by a Starnode network via the STARNODE port, or through a serial port. Once communication with the host or network has been established, the scanner can be commanded to perform many functions and to provide requested information. The commands can be sent to the Setup port but are most commonly sent to the Host or Starnode port. This chapter will describe in detail: •
How to control the scanner or solicit information from it using commands downloaded from a host computer or Starnode controller
•
How to change parameters using commands from a host computer
•
How to develop C programs for a scanner and download them to it.
Host Commands & Downloads
6
Before beginning Starnode operations, you should know the network protocols and messages.
Control Commands from the Host When sending commands to the scanner through a Host or Terminal/Setup port, a framing character, normally, a tilde (~), must be sent before and after each command. When sending commands to the scanner through a Starnode or Ethernet port, a forward slash ( / ) must precede each command. Otherwise, all strings that begin with an ASCII A or greater will be interpreted as data and be sent to the user program. In Starnode environments, command values are passed via the SSEND, SBRDC, or SBRDT operations. Table 6–1 contains a description of each commanded. The commands are listed numerically, by decimal value, in ascending order. Commands with a decimal value of less than 65 are processed at the operating system level. Commands with a decimal value of 65 or greater are interpreted as data to be passed to a user C program running on the scanner.
Rev H, February 2002
CiMAX 78xx Technical Reference Manual
6-1
Page 98
Chapter
6
Host Commands & Downloads
TABLE 6–1. Terminal Control Commands
Command Message Type
(Decimal)
(Hex)
(ASCII)
Request Diagnostic String
52
34
4
Request Status Information
53
35
5
Reset
59
3B
;
Clear Diagnostic Count
60
3C
<
Enable Digital Output
61
3D
=
Turn Relay Off
62
3E
>
Setup Command
63
3F
?
Program Message
65 (or greater)
41 (or greater)
A
Display Box/No Read Count *
~TOTAL~
Debugging Information *
~DATA~
Start Presence
~!~
Stop Presence
~$~
Clear Box/No Read Registers *
~TOT00~
Turn Laser On/Off *
~LASxx~
Request Status from Slaves *
~QSNDx~
Query Slave for Data *
~QGETx~
Flush All Slave Data *
~QFLS~
Note: Additional commands are available to implement “Gap Tracking Diagnostics” on page 8-24, “Recording” on page 8-37, and “Playback” on page 8-38. * Commands sent over STARNODE or TCP/IP must be prefixed with a forward slash ( / ).
6-2
CiMAX 78xx Technical Reference Manual
Rev H, February 2002
Page 99
Control Commands from the Host
ASCII 4 Command - Requesting a Diagnostic String Upon receiving an ASCII 4 command (decimal 52; hexadecimal 34), the scanner will send the following string back to the controller: 7800 #NNNNN Where NNNNN is the message count for this scanner. This will be a value between 00000 and 65535. This string can be used for diagnostic purposes. The message count is incremented each time this message is requested. The count is reset to zero when the unit receives an ASCII < command (decimal 60; hexadecimal 3C), an ASCII ; command (decimal 59; hexadecimal 3B); or when the scanner is rebooted by turning it Off and then On again. Message Format - None
Example In Starnode environments, downloading only the ASCII 4 will result in the scanner returning a message count.
Host Commands & Downloads
6
Rev H, February 2002
CiMAX 78xx Technical Reference Manual
6-3
Page 100
Chapter
6
Host Commands & Downloads
ASCII 5 Command - Requesting Status Information When the scanner receives an ASCII 5 command (decimal 53; hexadecimal 35), it responds by sending a string representing its current status. The information returned can be useful for troubleshooting malfunctions. The returned string has the format: 7800 V.V ABCDEFGHIJKLMNOPQ where: V.V - The version number of the software used in the scanner ABCDEFGHIJKLMNOPQ - The 17-character diagnostic string The diagnostic status string reflects the current status of the scanner, as shown in Table 6–2. TABLE 6–2. Status String Interpretation
Position
Meaning when 1
A
Inzone presence on
B
Outzone presence on
C
Zone synchronization error
D
Decode Flag
E
Bar timing overflow
F
Scan speed off ±12%
G
Sending data
H
Timeout on last Starnode download
I
Receiving data
J
Receive error has occurred
K
*Relay 1 (NO READ) energized
L
*Relay 2 (MATCH) energized
M
*Relay 3 (NO MATCH) energized
N
Scanner is in Setup menu or diagnostic mode
O
Scanner is operating under user program control
P
Scanner is configured with default parameter values
Q
Laser diode failure detected
*Note: NO READ, MATCH, and NO MATCH are assigned to Relays 1, 2, and 3 respectively by the scanner control program. These assignments can be changed by setup parameters 541, 542 and 543 using the Setup menu or by a C program.
Status String Digit Explanations A - Inzone Presence 1 indicates that the presence photoeye or Microswitch™ has detected an object entering the scanning zone.
6-4
CiMAX 78xx Technical Reference Manual
Rev H, February 2002
Page 101
Control Commands from the Host
B - Outzone Presence 1 indicates that the outzone presence photoeye or Microswitch™ has been triggered. This indicates that the box or object is leaving the scanning zone. C - Zone Sync Error 1 indicates that a zone synchronization error has occurred. When not using gap tracking, this error occurs when either the inzone presence detecting device signals a second time before the outzone detector has signaled once, or the outzone device signals prior to an inzone signal. D - Decode Flag 1 indicates that the decoder is processing data. E - Bar Timing Overflow 1 indicates that the scanner is falling behind in analyzing data stored in the bar timing logic buffer. This digit may be 1 if large amounts of barcoded data are being scanned. F - Scan Rate 1 indicates that the scanning mirror is not running within the normal operating range. G - Sending Data 1 indicates that data is currently being sent through the Host, Terminal or Starnode ports. H - Timeout
6 Host Commands & Downloads
In Starnode environments, 1 indicates that the scanner does not perceive the network as operational (i.e., the scanner has not been polled recently by the network). I - Receiving Data 1 indicates that the scanner is currently receiving data through the Host, Setup or Starnode ports. J - Receive Error 1 indicates that received data contained a parity or framing error. K - NO READ Energized 1 indicates a NO READ energized. This assignment can be changed through a C application or by changing parameters. L - MATCH Energized 1 indicates a MATCH energized. This assignment can be changed through a C application or by changing parameters. M - NO MATCH Energized 1 indicates a NO MATCH energized. This assignment can be changed through a C application or by changing parameters.
Rev H, February 2002
CiMAX 78xx Technical Reference Manual
6-5
Page 102
Chapter
6
Host Commands & Downloads
N - Setup/Diagnostic Mode 1 indicates that the unit is operating in the Diagnostics mode or the Setup mode. Refer to “Setup & Diagnostic Modes” on page 5-6 for more information. O - User Program 1 indicates that the scanner is currently executing a user program. P - Default Setup 1 indicates that the scanner is in the Default Setup mode. If SICK Auto Ident, Inc. configured your scanner, this digit will be a 1. If this digit is a 0, at least one of the scanner's parameter values was changed. Refer to 000-099 Decoding & Scanner Operation Parameters in the Scanner Parameters Reference Guide for more information. Q - Laser Diode Fault 1 indicates that the scanner’s laser diode may have failed, or is beginning to fail. Contact SICK Auto Ident, Inc. Customer Service. Message Format - None
Example If the default MESSAGE CHARACTER value is not changed, downloading the string ~5~ over the Host or Setup ports will cause the scanner to return a diagnostic string.
6-6
CiMAX 78xx Technical Reference Manual
Rev H, February 2002
Page 103
Control Commands from the Host
ASCII ; Command - Rebooting Scanner Upon receiving an ASCII ; (semicolon) command (decimal 59; hexadecimal 3B), the scanner will reboot as if it had been turned Off and then On again. The scanner's parameter values will be safely stored in memory after startup. Message Format - None
Example If the default MESSAGE CHARACTER value is not changed, downloading the string ~;~ over the Host or Setup port will cause the scanner to reboot.
Host Commands & Downloads
6
Rev H, February 2002
CiMAX 78xx Technical Reference Manual
6-7
Page 104
Chapter
6
Host Commands & Downloads
ASCII < Command - Clearing Diagnostic Count The ASCII < (less than sign) command (decimal 60; hexadecimal 3C) is used in Starnode environments to clear the message count from a scanner without having to restart it. Refer to “ASCII 4 Command - Requesting a Diagnostic String” on page 6-3 for details regarding the message count. This count may also be reset by sending an ASCII ; command that resets the scanner to it's default values. Message Format - None
Example If the default MESSAGE CHARACTER value is not changed, downloading the string ~<~ over the Host or Setup port will cause the scanner to reset its diagnostic count.
6-8
CiMAX 78xx Technical Reference Manual
Rev H, February 2002
Page 105
Control Commands from the Host
ASCII = Command - Enabling Relay Control Outputs The solid-state control outputs can be enabled by downloading the ASCII = (equal sign; decimal 61; hexadecimal 3D) command. Message Format - =NNN where: NNN - The output to enable in accordance with the following: –
001 for output 1
–
002 for output 2
–
004 for output 3
–
008 for output 4
–
016 for output 5
–
032 for output 6
–
064 for output 7
–
128 for output 8
To enable outputs in combination, enter the sum of the individual output values. For example, entering 007 will enable the first three outputs. Entering 255 will enable all eight outputs.
It is possible to suspend all relay hold countdowns, so that the outputs will not switch back to their disabled state) by sending a 0 as the parameter NNN.
Example ~=0~
Suspend Relay Hold Countdowns
The current states of the outputs (enabled or disabled) will not be directly affected by sending a 0.
Example If the default MESSAGE CHARACTER value is not changed, downloading the string ~=2~ over the Host or Setup port will enable output 2.
Rev H, February 2002
CiMAX 78xx Technical Reference Manual
6-9
Host Commands & Downloads
6
If the RLYHLD (relay hold) time for an output is non-zero, then that output will automatically disable at the end of the hold time. If the RLYHLD is zero, the output will remain enabled.
Page 106
Chapter
6
Host Commands & Downloads
ASCII > Command - De-energizing Relay Control Outputs The solid-state control outputs can be de-energized by downloading the ASCII > (greater-than sign; decimal 62; hexadecimal 3E) command. Message Format - >NNN where: NNN - The output to disable in accordance with the following: –
001 for output 1
–
002 for output 2
–
004 for output 3
–
008 for output 4
–
016 for output 5
–
032 for output 6
–
064 for output 7
–
128 for output 8
To disable outputs in combination, enter the sum of the individual output values. It is possible to resume all relay hold countdowns, so that the outputs will switch back to their disabled states at the end of their Relay Hold Countdowns by sending a single 0 as the parameter NNN.
Example ~>0~
Resume Relay Hold Countdowns
The current states of the outputs, enabled or disabled, will not be directly affected by sending a 0.
Example If the default MESSAGE CHARACTER value is not changed, downloading the string ~>2~ over the Host or Setup port will disable output 2.
6-10
CiMAX 78xx Technical Reference Manual
Rev H, February 2002