Operating instructions, General information, Transmission protocol – Baumer N 214 Benutzerhandbuch

Seite 8

Advertising
background image

N 214

8 www.baumer.com

Operating Instructions

Interface description
N 214 Prog. 01

1. General information

The serial interface can fulfill the same functions as the display and the keys on the counter. Via the interface,
data can be called up and parameters can be reprogrammed. When used with the serial interface, the counter
is generally operated by a PC. It is, however, also possible to use a different device with similar characteristic
features.

2. Transmission protocol

The transmission is effected character-by-character in the ASCII code. Each character consists of 8 bits. The
8

th

bit is the parity bit, in case of "no parity", the 8

th

bit is always sent null.

Upon each enquiry by the PC, the counter sends an acknowledgment via the serial interface, provided that the
data transmission was correct.
A transmission of characters is started with a start character <STX> and terminated with a terminator <ETX>.
In addition, the counter sends a <CR> (carriage return) after the <ETX>, enabling the reading in (in high-level
programming languages such as BASIC) of a complete data block with one statement.
The <STX> is followed by an address assigned to the counter. Thus it is possible to address the relevant
counter in a serial network. After the address, the line (position) to be read out or to be programmed is entered.
In case of a programming statement, a "P" (program) and the data (parameter) follow.

As explained below, the protocol is divided up into 3 groups:

a) Reading of storage locations (READ statement):

<STX> address line <ETX> [<CR>]



b) Programming of storage locations (WRITE statement):
<STX> address line P data <ETX> [<CR>]


c) Special statements:
<STX> address parameter <ETX> [<CR>]

<STX> Start of text (02Hex)
Address 00..99 (device address)
Line 01..XX (see operating scheme)
P Programming statement
Data Programming data
Parameter Special statements
<ETX> End of text (03Hex)
<CR> 0DHex (control character "carriage return")
"CR" does not have to be indicated (optional), is however always
sent back by the counter.

Example:

General

<STX> address line <ETX> (address=35; line=02)

ASCII <STX>3502<ETX>
Hex 02H,33H,35H,30H,32H,03H

Important !
The blanks between the individual characters in the statements merely serve for a clearer presentation.
The inputting at the PC must be done without blanks. In the description, control characters (less than 20Hex)
are put into angle brackets.
If the PC sends a wrong protocol, the counter will send back an error message, provided that the N 214 is still
ready to receive. For further information read the section error messages.

Advertising