Microlab 300 Host Protocol v1 0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

LIS2-A HOST-PC COMMUNICATION

Host communication
Microlab 300 series
Document version: v1.0

VITAL SCIENTIFIC N.V. 1 PRELIMINARY DOCUMENTATION


LIS2-A HOST-PC COMMUNICATION

TABLE OF CONTENTS

1 Introduction ........................................................................................... 3
1.1 Purpose .......................................................................................................................................... 3
1.2 Scope ............................................................................................................................................. 3
1.3 Definitions, acronyms and abbreviations ....................................................................................... 3
1.4 References ..................................................................................................................................... 3
1.5 Overview ........................................................................................................................................ 3

2 Hardware interfaces .............................................................................. 4


2.1 Serial port interface ........................................................................................................................ 4

3 Data handling ........................................................................................ 5


3.1 General .......................................................................................................................................... 5
3.2 Packet format ................................................................................................................................. 5

4 Messages............................................................................................... 7
4.1 Message components .................................................................................................................... 7
4.2 Connect message .......................................................................................................................... 7
4.3 Send Result.................................................................................................................................... 8

PRELIMINARY DOCUMENTATION 2 VITAL SCIENTIFIC N.V.


LIS2-A HOST-PC COMMUNICATION

1 Introduction

1.1 Purpose
This document defines the interface between a Laboratory Information System (LIS) and a Microlab 300
series instrument. The LIS is in this document referred to as ‘Host’.

1.2 Scope
The scope of this document is limited to defining the external interface of the Microlab 300.

1.3 Definitions, acronyms and abbreviations


Abbreviation Description
Host Computer that is part of the LIS and communicates with the analyser.
LIS Laboratory Information System

Definition Description

1.4 References
[1]

1.5 Overview
Chapter 2 defines the low-level interface between analyser and Host.
Chapter 3 defines the format of the low-level packets transmitted between analyser and Host.
Chapter 4 defines the format of the individual messages that can be transmitted between PC and Host.

VITAL SCIENTIFIC N.V. 3 PRELIMINARY DOCUMENTATION


LIS2-A HOST-PC COMMUNICATION

2 Hardware interfaces

2.1 Serial port interface


In order to connect a PC Host to the analyser, a NULL-modem (crossed Rx/Tx signals) cable is sufficient.

The line signal definition is shown in the following table:

DB-9 Signal name Direction


pin #
1 CD Carrier Detect input
2 Rx Receive data input
3 Tx Transmit data output
4 DTR Data Terminal Ready output
5 SG Signal Ground
6 DSR Data Set Ready input
7 RTS Request To Send output
8 CTS Clear To Send input
9 RI Ring Indicator input

Only TX and RX are used to transfer data. There will be no hardware handshaking.
Communication is fixed at 9600 baud, 8 databits, no parity, 1 stopbit (8-N-1).

Warning:
The XON-XOFF protocol (which can be set by Windows) must NOT be used, because this can interfere with
the protocol.

PRELIMINARY DOCUMENTATION 4 VITAL SCIENTIFIC N.V.


LIS2-A HOST-PC COMMUNICATION

3 Data handling

3.1 General
Messages are transmitted in packets. Each packet starts with a header byte (FFh) followed by packet
information data. A packet is concluded with a checksum.

Every packet received correctly must be acknowledged by sending an acknowledge (ACK) packet. If a
packet is recevied incorrectly (ie, checksum incorrect) it must be responded to by sending a NAK packet.

The analyser also transmits ‘heartbeat’ packets. These must be responded to by sending a ‘heartbeat
acknowledge’ packet. If the analyser does not receive any response to its heartbeat requests, it concludes
that the host connection is no longer available.

3.2 Packet format


The format of Data packets is:
Byte 1 2 3 4 5..N-1 N
FFh Length Type and ID Block marker Message data Checksum

The format of all other packets is:


Byte 1 2 3 4
FFh Length Type and ID Checksum

FFh = Header
Length = The number of bytes in this packet, not including header and length bytes (=N-2).
Type and ID = Byte indicating type of message and ID.
Bit 7 6 5 4 3 2 1 0
Type ID

The Type bits indicate the type of the packet as follows


Type Description
Bit 7 6 5
0 0 0 Data packet
0 0 1 ACK packet
0 1 0 NAK packet
0 1 1 Heartbeat request
1 0 0 Heartbeat acknowledge
1 0 1 Reserved / ignore
1 1 0 Reserved / ignore
1 1 1 Reserved / ignore

The ID is a modulo 32 number identifying a data packet. In case of ACK or NAK the ID field
is set to 0.

VITAL SCIENTIFIC N.V. 5 PRELIMINARY DOCUMENTATION


LIS2-A HOST-PC COMMUNICATION

Block marker = A message may be split into blocks over multiple packets, since a packet can only hold
messages up to 252 bytes large. Bits 0 and 1 of this byte are used to identify if it is a first,
intermediate or last packet of a message. All unused bits should be set to 0.

Bit 1 0
0 0 Intermediate packet
0 1 First packet of a message
1 0 Last packet of a message
1 1 First and last packet of a message

Note: Typically a messages will fit in a single packet.

Checksum = A module 256 addition of all packet bytes following the header byte until the checksum byte,
substracted from 256. Therefore, the module 256 sum of all bytes following the header,
including the checksum byte must be zero.

The total size of a packet shall not exceed 257 bytes.

PRELIMINARY DOCUMENTATION 6 VITAL SCIENTIFIC N.V.


LIS2-A HOST-PC COMMUNICATION

4 Messages
This section describes the messages that are sent from the analyser to the host or received by the analyser
from the host.

4.1 Message components


Every message consists of a series of component. A component can be:
- A byte
- A text
- A signed 16 bit integer value (Int16)
- An unsigned 16 bit integer value (UInt16)
- A signed 32 bit integer value (Int32)
- An unsigned 32 bit integer value (UInt32)

All texts are transmitted in unicode UTF-16. Each character is represented by a two byte value with the most
significant byte first.
Byte 1 2 3 4 5 6 7
Contents Length MSB LSB MSB LSB MSB LSB
Example 3 00h 4Ah 00h 56h 00h 39h
‘J’ ‘V’ ‘9’
Note: Length can also be 0.

Integer values are transmitted as 2 byte (16 bit) or 4 byte (32 bit) values, most significant byte comes first.
Integer values can be signed (Int16 or Int32) or unsigned (UInt16 or UInt32).
Byte 1 2 3 4
Contents MSB LSB
Example 00h 02h 68h A6h
000268A6h
=
157862

4.2 Connect message


A connect message is transmitted to bring the connection into online state. The host must transmit this
message in order to enable the communication with the analyser.

Component Contents Comments


1 Byte: 0Ah Identification of connection message

Example:
Transmitted: #FF#04#00#03#0A#EF (connect message)
Received: #FF#02#20#DE (acknowledge)

VITAL SCIENTIFIC N.V. 7 PRELIMINARY DOCUMENTATION


LIS2-A HOST-PC COMMUNICATION

4.3 Send Result


A result message contains the following components:

Component Contents Comments


1 Byte: 04h Identification of result message
2 Text Serial Number
3 Byte:00h .. 03h Measure type:
00h = REAGENT BLANK
01h = CALIBRATION
02h = CONTROL
03h = SAMPLE
4 Text Test name
5 Text CALIBRATION: calibration name and number: <name>(<#>)
CONTROL: control name
SAMPLE: patient name
[5a] [Text] Only transmitted in case of SAMPLE. Contains: sample code
6 Int32 Measured absorbance in 0.1 mAbs (i.e., multiplied by 10,000).
Divide by 10,000 to for Absorbance value.
7 Int32 Concentration multiplied by 1,000. Divide by 1,000 for actual
concentration value.
8 Text Units for concentration
9 Text Flags on result

PRELIMINARY DOCUMENTATION 8 VITAL SCIENTIFIC N.V.


LIS2-A HOST-PC COMMUNICATION

Example:
Transmitted: #FF#2F#00#03#04#06#00#33#00#2D#00#31#00#30#00#39#00#38#03#02#00
#4A#00#56#00#02#00#31#00#34#00#00#00#03#00#00#00#00#04#00#6E#00
#6F#00#6E#00#65#00#CF

Byte Value Component


FFh Packet header
2Fh Packet length
00h Packet type = Data; Packet ID = 0
03h Block marker: first and last packet
04h Identification Result message
06h length ’3-1098’ Serial number
00h '3'
33h
00h '-'
2Dh
00h '1'
31h
00h '0'
30h
00h '9'
39h
00h '8'
38h
03h SAMPLE Measure type
02h length Test name
00h 'J' 'JV'
4Ah
00h 'V'
56h
00h '' Patient name
02h '14' Sample code
00h
31h
00h
34h
00h 3 0,0003 Absorbance value
00h
00h
03h
00h 0 0,000 Concentration
00h
00h
00h
04h length 'none' Units
00h 'n'
6Eh
00h 'o'
6Fh
00h 'n'
6Eh
00h 'e'
65h
00h '' Flags
CFh Checksum

VITAL SCIENTIFIC N.V. 9 PRELIMINARY DOCUMENTATION

You might also like