Color-guide Development Kit CDK - NI



03.01.2005

SICManual.doc

Version 6.00

SIC Communication Manual

Introduction

To establish a bi-directional connection between a SIC-instrument and a PC over serial interfaces (COM-Ports), the SIC protocol (Serial Interface Communication protocol) was developed.

Programmers can use the examples and sources to create customized application for QC and further needs.

What is SIC

The SIC protocol makes a complete set of functions available for bi-directional communication dealing with data and options of SIC_instrument. Basically, SIC protocol is a string of bytes containing headers, commands, ASCII strings, and a communication error control, all expressed in HEX-codes, understandable for the Instrument using SIC-protocol. Every Byte has a meaning depending on his position in the string. The sequence of information is static, means: the first byte sent is a Request to send (RTS), the answer is Acknowledge (ACK), after this introduction the data exchange starts with identification of destination (instrument or PC), the second byte defines source, third the type of source, fourth the kind of program, and so on.

A complete string sent to instrument or vice versa looks like

01 03 00 00 00 08 00 00 02 04 01 01 02 00 05 A3 F0

well recognized by the instrument or the PC, but not very comfortable for our eyes...

How to handle SIC

SIC protocol as the basic communication interface can be handled by programs, to decode the HEX string to readable data, like spectral data, kind of instrument, colorimetric data and so on.

The byksic32.dll can be implemented in Windows applications like VBA macros (e.g. this DLL is used by the Excel sheets). This DLLs make commands available, that can be used for remote control and data exchange, using the SIC-protocol and translate into readable data.

SIC Protocol Definition

Introduction

The following will explain the operation and use of SIC commands. Instruments capable of using SIC Protocol can communicate bi-directional with external devices, in most cases a PC using RS 232 (V 24) serial interface. SIC protocol provides an instrument specific command set, to establish data transfer and remote control.

Definition of SIC Protocol

SIC protocol uses a serial link to instrument, all BYK-Gardner instruments using a RS-232C serial interface. They are defined as DCE (Data Communication Equipment), means they are able to hook up to a DTE (Data Transfer Equipment) using a straight through serial cable (no other physical type of serial cable is yet implemented in SIC, to prevent having different cables for different types of instruments).

Basically the SIC Protocol (Serial Instrument Communication) commands can be split into three parts:

1. Establish communication

2. Transfer Parameters and data requests for transmission and start data exchange.

3. Assure error free transmission by using CRC-16 checksum conditions

Before starting an SIC session, instrument and PC have to clarify conditions of data transfer, to establish an error free communication. Means: a Request to send (RTS) and acknowledge (ACK) are send, to make sure both partners are ready for data exchange.

After communication is established, a SIC header defines the type of data transfer.. Last not least, an error checksum is calculated, to assure, all data has been correctly transmitted.

SIC protocol is capable of transferring up to 255 bytes in normal mode and up to 16777216 bytes in multiple block transfer mode (defined in place 7 and 8 in SIC chain ( refer to "Meanings of the single bytes").

3 Instruments compatible with SIC

All instruments that have been developed since 1996 are compatible with SIC. All future instruments will be compatible also. A list of instruments supporting the SIC protocol:

• micro-metallic Fe

• micro-metallic NFe

• micro-TRI (

• micro-haze plus

• color-guide family

• wave-scan family

• haze-gard dual

• temp-gard

• micro-gloss NEW family

• spectro-guide family

Components of the SIC protocol

Communication Part of the Computer

Computer is to be a command requester and data receiver for the instrument. As a command requester the computer establishes communication with the instrument at a defined Baud-Rate (several different Baud rates are available). It sends a command and verifies complete operation. As a data receiver the computer waits for a command and sends acknowledgement after retrieval.

Communication Part of the Instrument

The instrument in SIC protocol is the command receiver and data sender. As command receiver the instrument waits for a command from the external device. Receiving a request, the instrument indicates to be ready and command is send. The instrument verifies the command and indicates success.

As data sender the instrument indicates to the computer that it has data to send. After receiving acknowledge from the PC, data is send. The PC receives data and indicates success.

The use of ASCII control characters

The SIC command protocol uses ASCII command characters to synchronize command sets. By using ASCII characters SIC protocol can indicate a SIC Header, start and end of data transmission. An error indication in SIC by sending a NAK (Shown below) indicates that the protocol did not complete successfully. Below are the ASCII equivalents for the ASCII Control characters.

01 hex Start of header (SOH)

02 hex Start of text (STX)

04 hex Request to send (RTS)

06 hex Acknowledge (ACK)

15 hex Negative Acknowledge (NAK)

Definition Of a SIC header

A SIC header is composed of twelve bytes (( refer to "meanings of the single bytes"). These twelve bytes contain information about the computer, the instrument, the data that is sent, and the status of an attached instrument.

1 Byte: Destination Instrument

Instrument family the SIC Header is sent to:

0x00 Computer

0x01 color-guide 45/0

0x02 micro family

0x03 color-guide sphere

0x04 wave-scan family

0x05 temp-gard

0x06 haze-gard dual

0x08 micro-gloss NEW

0x0A spectro-guide

1 Byte: Source Instrument

Instrument family that sends the SIC-Header:

0x00 Computer

0x01 color-guide 45/0

0x02 micro family

0x03 color-guide sphere

0x04 wave-scan family

0x05 temp-gard

0x06 haze-gard dual

0x08 micro-gloss NEW

0x0A spectro-guide

1 Byte Source Instrument Type

Instrument type within the family that sends the SIC Header:

for color-guide 45/0 family:

00 11mm area

01 20mm area

02 4mm area

255 not yet defined

for micro family

00 micro-haze plus

01 micro-metallic Fe

02 micro-metallic nFe

03 micro-TRI gloss (

for wave-scan family

00 wave-scan T

01 wave-scan DOI

for color-guide sphere:

00 specular gloss included

01 specular gloss excluded

02 specular gloss included, gloss 60°

for micro-gloss NEW:

00 20°

01 60°

02 85°

03 TRI

04 TRI µ

for spectro-guide:

00 45/0

01 sphere

1 Byte Kind of Program

Kind of firmware that is valid in the instrument:

00 custom firmware

01 calibration firmware

02 diagnosis firmware

03 boot loader

04 oven program

05 FPGA program

1 Byte Status

Current status of the instrument:

Bit 0 1 No valid calibration

0 Calibration valid

Bit 1 1 Abnormal RESET

0 Normal RESET

Bit 2 1 Battery low

0 Battery ok

Bit 3 1 instrument not factory calibrated

0 factory calibration ok

Bit 4 1 instrument is hitch calibrated

0 instrument is not hitch calibrated

2 Byte Firmware Version

For example version 3.56:

1. Byte 03

2. Byte 56

1 Byte Data Length

Data length of the block to be transferred

2 Byte Block Sequence Number

Running Number of the block to be transferred (MSB,LSB)

2 Byte Dummy

Definition of an Instrument Command

An instrument command is the command that the computer wants the instrument to perform. It is sent after the SIC Header and is proceeded by an ASCII command STX to indicate that the command is to follow.

Instrument commands may be up to 255 bytes in length. The command depends on the type of instrument; each command may be different for different instruments. A listing of the available commands for the color-guide family is provided in this documentation as Appendix B.

Definition of a SIC Command Session

A SIC command session is the transmission of a command by an external device and the receipt of a command by an external device. The command session is enhanced by the addition of the CRC-16 checksum appending the command. The checksum assure the correct data transmission, a wrong data set is impossible.

Transmission

Computer Sends: RTS

Instrument sends: ACK

Computer Sends: SOH + SIC HEADER+STX+COMMAND+CRC-16 CHECKSUM

Instrument Sends: ACK

Receipt

Instrument Sends:RTS

Computer Sends:ACK

Instrument Sends: SOH + SIC HEADER + STX + DATA + CRC-16 CHECKSUM

Computer Sends: ACK

Special Considerations

Multi block Transfers:

The SIC protocol can be used to transfer more than 255 bytes in a single session through the use of multi-block transfers. In the SIC header byte 9 and 10 are used for this purpose. The procedure is as follows:

During the first block transfer, set the number of blocks that you will transfer in byte 9 and 10 of the SIC Header. Proceed with the normal process of sending data except that for each block that is transferred, decrement the number of blocks being transferred by one. The number of blocks in the SIC header in effect becomes a countdown to the last block.

The last block number would be “0”.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download