Class TMW20Driver (unit DMW20Drv)

Inherits from

TComponent

Aborted

Constructors


constructor Create( AOwner: TComponent );

Constructor

ACK-NACK PC32 PROTOCOL Each block of data has the following structure: +----+----+----+----+--------------+----+----+----+----+ | st | s1 | s2 | id | .



Functions

destructor Destroy;

Destructor

Destructor


function Download( dest: TStringList ): TMW20DownloadError;

Download data from the MW20 pen

Download data from the MW20 pen


function DownloadACKNACK( dest: TStringList ): TMW20DownloadError;

Download data using the MW20 ACK-NACK PC32 protocol

Download data using the MW20 ACK-NACK PC32 protocol


function DownloadNative( dest: TStringList ): TMW20DownloadError;

Download data using the MW20 Native protocol

Download data using the MW20 Native protocol


procedure Notification( AComponent: TComponent; Operation: TOperation );

Handle component deletions (design-time only)

Handle component deletions (design-time only)


Properties

property COMDriver : TCommPortDriver

COM port driver

property Protocol : TMW20Protocol

Protocol

Events

Variables

FCOMDriver : TCommPortDriver;

COM port driver

FProtocol : TMW20Protocol;

MW20 Protocol


Constructors


constructor Create( AOwner: TComponent );

Constructor

ACK-NACK PC32 PROTOCOL Each block of data has the following structure: +----+----+----+----+--------------+----+----+----+----+ | st | s1 | s2 | id | ... data ... | ct | c1 | c2 | cr | +----+----+----+----+--------------+----+----+----+----+ Where fields have the following meaning: st: Synchronization character: '-' Put at the beginning of each block. This character is used to synchronize the receiver on the first character of the block. s1: ASCII value (hex digit) of the first significant nibble of the character count. This character together with the following one (s2) represents the number of characters in the data field of the block. s2: ASCII value (hex digit) of the least significant nibble of the character count. This character together with the previous one represents the number of characters in the data field of the block. id: This character is "1" (ASCII $31) in the first block, "0" (ASCII $30) in the last block. In all the other blocks this character identifies the block contents and its value is assigned by the application program. data: This field has variable length and contains data. ct: This is the block counter; this number is increased by every new block, starting from "0" (ASCII $30) in the first block up to "9" (ASCII $39). When this counter reaches the value "9" it rolls over the "0". This character can be tested by the receiver to detect if some block has been omitted or lost. c1: ASCII value of the most significant nibble of the checksum character. This character, together with the following one (c2), contains the checksum information. c2: ASCII value of the least significant nibble of thee checksum character. This character, together with the previous one (c1), contains the checksum information. The checksum character is computed performing binary addition on all the characters of the block (excluding the synchronization character, i.e. the starting "-"). cr: This is the block terminator flag, the ASCII character CR ($0D). With the ACK-NACK PC32 protocol, after trasmitting every block, the MW20 stops and waits for the ACK character (ASCII $06) from the host computer. If the host computer receives the block correctly, it will answer with ACK and the trasmission continues with the next block; otherwise it will answer with NACK (ASCII $15) and the block will be trasmitted again until it is correctly received. If, for any reason, the MW20 receives a character different from ACK and NACK, it will send a NACK to the host requiring the trasmission of the acknowledge character. After a certain number of consecutive NACK (about 30), the trasmission will be aborted and and error is issued on the host console. When the ACK-NACK protocol is selected, the RTS and CTS signals are ignored by the MW20 and therefore only two wires (TX and RX) plus the ground signal are used for the comunication. The last block of the trasmission is always "-0000FF" (without the quotes). [Protocol description excerpt from Datalogic DW20 User's Manual] [Copyright Datalogic. All rights reserved] } { Constructor


Functions


destructor Destroy;

Destructor

Destructor


function Download( dest: TStringList ): TMW20DownloadError;

Download data from the MW20 pen

Download data from the MW20 pen


function DownloadACKNACK( dest: TStringList ): TMW20DownloadError;

Download data using the MW20 ACK-NACK PC32 protocol

Download data using the MW20 ACK-NACK PC32 protocol


function DownloadNative( dest: TStringList ): TMW20DownloadError;

Download data using the MW20 Native protocol

Download data using the MW20 Native protocol


procedure Notification( AComponent: TComponent; Operation: TOperation );

Handle component deletions (design-time only)

Handle component deletions (design-time only)


Properties


property COMDriver : TCommPortDriver

COM port driver


property Protocol : TMW20Protocol

Protocol


Events


Variables


FCOMDriver : TCommPortDriver;

COM port driver


FProtocol : TMW20Protocol;

MW20 Protocol