Beruflich Dokumente
Kultur Dokumente
Serpro de
Serpro de
Protokoll Protocol
für motrona-Geräte for motrona Units
8. Historie 10 8. History 10
2
1. Allgemeine Angaben 1. General Information
Das verwendete Protokoll entspricht dem The units use the LECOM protocol (DIN ISO
LECOM- Standard (DIN ISO 1754), der 1745) which is a common standard with
häufig in der Antriebstechnik verwendet wird. drive applications. Setting of the desired
Die Einstellung der gewünschten Baudrate, Baud rate and the data format as well as the
des Datenformats sowie die pinout of the data connector are clearly
Anschlußbelegung des Datensteckers sind described in the general operating
in der jeweiligen Bedienungsanleitung des instructions of the unit in use.
verwendeten Gerätes beschrieben.
Es ist zu beachten, daß seitens des Gerätes Please note that any response of a unit will
jegliche Antwort oder Rückmeldung unter- be suppressed after access by the general
bleibt, sobald dieses über eine Sammel- address "00" or a collective address like
adresse angesprochen wird. "20".
3
4. Anforderung von Daten 4. Request for Data
Zum Auslesen von Daten aus dem To read out data from the operational
Arbeitsspeicher ( RAM ) des Gerätes gilt das registers ( RAM ), the subsequent request
folgende Anforderungs-Protokoll: string must be used:
Die zu verwendenden Register-Codes C1 For the valid register codes C1 and C2,
und C2 sind aus der Parameter- Liste des please refer to the parameter list of the unit
jeweiligen Gerätes zu entnehmen. in use.
EOT 3 1 0 3 ENQ
...
hex: 04 33 31 30 33 05
EOT 1 1 ! 0 8 1 A 0 0 ENQ
...
hex: 04 31 31 21 30 38 31 41 30 30 05
4
Bitte beachten Sie, dass neben den Ziffern Please note that figures 0-9 and characters
0–9 auch die Zeichen A-F zur Adressierung A-F may be used for register addressing,
verwendet werden können, die mit den where A-F are expressed by hexa-
Hexadezimal-Codes 4.1 bis 4.6 ausgedrückt decimalcodes 4.1 to 4.6.
werden. With a correct unit address and a valid
Bei richtiger Geräteadresse und gültigem register code, the unit responds with one of
Register-Code antwortet das Gerät je nach the subsequent strings (depending on mode
Adressierungs-Art mit einem der folgenden of addressing):
beiden Strings:
BCC BCC
STX = Control character CTRL B ( Hex 02 ) ETX = Control character CTRL C ( Hex 03 )
XXX = Register data BCC = Block check character
Die Stellenzahl der gesendeten Datenwerte The total number of data characters "XXX"
"XXX" hängt vom jeweiligen Wert des depends on the actual numeric value of the
angewählten Registers ab und kann bei selected data register and may also be
negativen Werten auch ein Minuszeichen leaded by a minus sign with negative values.
enthalten. Vornullen werden grundsätzlich Leading zeros are always supressed and will
unterdrückt und erscheinen nicht im Antwort- not appear in the telegram.
Telegramm. The block check character "BCC" is
Der Block-Check-Character "BCC" ist das generated by an Exclusive-OR over all
Exclusiv-Oder aller gesendeten Zeichen von characters between “C1” resp. “!” and “ETX”
„C1“ bzw. „!“ bis „ETX“ (jeweils ein- (both included)
schließlich).
Wenn in der Anforderung ein ungültiger bzw. If the request string contains an invalid or
unbekannter Datencode (C1-C4 oder S1-S2) unknown register code (C1 – C4 or S1-S2),
gesendet wurde, antwortet das Gerät nur : the response of the unit will just be :
Wenn sonstige Fehler im Anfrage-Protokoll In case of other errors in the request string,
festgestellt werden, antwortet das Gerät nur the unit just responds by "NAK" (Hex 15)
mit "NAK" ( Hex 15 )
BCC
EOT AD1 AD2 STX C1 C2 XXX ETX BCC
...
BCC
EOT AD1 AD2 STX ! C1 C2 C3 C4 S1 S2 XXX ETX BCC
...
5
Die Länge des Datenstrings "XXX" ist hierbei The data string "XXX" can have any number
beliebig und kann wahlweise auch Vornullen of characters and may also contain leading
und ein negatives Vorzeichen enthalten. zeros or a negative sign.
Der Block-Check-Character "BCC" ist The block check character "BCC" represents
wiederum das Exclusiv- Oder aller again the Exclusive-OR function of all
gesendeten Zeichen zwischen "C1" bzw. „!“ characters between "C1" resp. “!” and "ETX".
und "ETX".
Bei korrekter Übertragung des Protokolls Upon a correct transmission of above
antwortet das Gerät mit "ACK", in allen protocol, the unit will respond by "ACK" and
anderen Fällen mit "NAK". in all other cases by "NAK" .
Die neu übertragenen Daten werden bei With motrona units, all data from a serial
motrona-Geräten zuerst in einem Puffer- transmission will first be latched in a
speicher hinterlegt, greifen also noch buffer register and will not affect the
nicht in die Funktion des Gerätes ein ! current operation, until the command
Erst nach Übertragung des Befehls "Activate Data" has been transmitted.
"Activate Data" werden die neuen Werte This procedure enables the user to
aktiv. Dadurch ist es möglich, bei prepare a complete new set of
laufender Maschine beliebig viele parameters in the background of the unit,
Parameter zu verändern, und dann mit with no effect to the production in
einem einzigen Befehl alle neuen progress, and to activate all at the same
Vorgaben gemeinsam zu aktivieren. time by one single command.
Nach Netzabschaltung wird automatisch der Upon power up, the unit automatically
Parameter-Satz aus dem EEProm in das transfers the EEProm data to the RAM
RAM geladen. Seriell übertragene Daten register. Previous serial register
sind verloren, wenn sie nicht vor Netzab- modifications will be lost, unless these data
schaltung aktiviert und anschließend im have been activated first and then stored to
EEProm gespeichert wurden. the EEProm.
Serial transmit
Parallel comm. BUFFER Register
Serial receive
"Activate data"
RAM Register
( operational data )
"Store to EEProm"
Power up
EEProm Register
( non-volatile data )
6
6. Übertragung von Steuerbefehlen 6. Transmission of Control Commands
Alle Steuerbefehle benutzen dasselbe Über- All control commands are using the same
tragungsformat wie in Abschnitt 4 gezeigt. transmission protocol like shown in section
Der Datenstring "XXXXX" besteht hier aller- 4. However, the data string "XXXXX" uses
dings nur aus der Ziffer "1" zum Einschalten only one character which is "1" to switch the
und der Ziffer "0" zum Ausschalten von function on and which is "0" to switch the
Steuerkommandos. Einige der Befehle set- function off again. Some of the serial
zen sich unmittelbar nach Aktivierung auto- commands will automatically reset to zero
matisch auf "0" zurück ( z.B. "Activate data" upon execution of the corresponding
oder "Store to EEProm". Andere Befehle commands ( i.e. "Activate data" or "Restore
bleiben statisch erhalten, bis sie über ein er- to EEProm" ). Others will need to be set and
neutes serielles Kommando wieder zurück- also to be reset by serial command ( i.e.
gesetzt werden ( z.B. Reset, Start/Stop, Reset, Start/Stop, Trim etc.)
Trimm usw. )
Bezüglich der seriell aktivierbaren Befehle For applicable command codes, please see
finden Sie alle Angaben in der Bedie- the operating instructions of the unit you use.
nungsanleitung des entsprechenden
Gerätes.
Die serielle Aktivierung eines Steuerbefehls All serial transmission of a control command
hat dieselbe Auswirkung, als wenn der will have the same result as when you set
entsprechende Hardware- Eingang auf the appropriate hardware input to "High".
"High" gelegt wird.
Wenn z.B. seriell der Reset-Befehl auf "1" If, i.e. by serial communication, the Reset flag
gesetzt wurde, ist das Gerät im Reset- has been set to "1", the unit will be in it's
Zustand, unabhängig davon ob der Reset state, independant of what the logical
entsprechende Hardware- Eingang High oder level at the hardware reset input is. Only with
Low ist. Erst wenn seriell das Reset- the serial reset flag at "0" and the reset input
Kommando auf "0" zurückgesetzt wurde, ist at "Low", the unit will be in it's normal
der Hardware- Reset wieder voll operative state !
funktionsfähig ! Upon power up, all serial command flags will
Bei Netzzuschaltung werden alle seriellen automatically be reset to "0" .
Befehle automatisch auf "0" gesetzt.
Das nachfolgende Beispiel zeigt, wie der The following example describes how to
Parameter „Factor1“ bei einem BY125- transmit a new “Factor1” setting to a BY125
Gleichlaufregler verändert wird. synchro controller.
BY125 benutzt die Standard-Adressierung BY125 uses standard addressing for register
für die seriellen Codestellen. Bei Geräten mit access. Where you use a unit with extended
erweiterter Adressierung gilt das unten- addressing, the subsequent example is fully
stehende Beispiel ebenso, bis auf die valid,too, except of the extended version of
erweiterte Darstellung der Codestellen mit address codes and sub codes.
den Subcodes.
7
Im Beispiel benutzen wir ein BY125-Gerät The example uses a BY125 controller with
mit der Geräteadresse „11“. Dem Para- serial unit address “11”. According to the
meter „Factor1“ ist laut Gerätebeschreibung manual, register “Factor1” uses the serial
die serielle Codestelle „00“ zugeordnet. Wir access code “00”. The example shows how
wollen Factor1 auf den Wert „0.9873“ to set the register to a value of “0.9873”
setzen.
7.1 Zuerst senden wir den Daten-String 7.1 First, we transmit the data string
bestehend aus insgesamt 13 ASCII-Zeichen: consisting of totally 13 ASCII characters:
Die Zeichen mit grauem Hintergrund werden Characters with gray background are used
mittels Exclusiv-Oder zur Bildung des to form the block check character by an
Block-Check-Characters benutzt. Betrachten exclusive- OR function. Consider each of
Sie bitte hierzu im Feld „Binary Code“ die 8 the 8 columns in the binary code field
Spalten (nur den grau unterlegten Bereich). (only gray rows).In the high bit column we
In der höchstwertigen Spalte ganz links find all zeros, therefore the exclusive OR is 0
finden wir ausschliesslich Nullen. Das and the high bit of the block check character
Exclusiv-Oder und damit das entsprechende must be zero at this position.
Bit des BCC ist daher ebenfalls 0.
In der kleinstwertigen Spalte ganz rechts In the low bit column we find 0-0-0-1-0-1-1-1
finden wir die Bitfolge 0-0-0-1-0-1-1-1 (von (from up to down) and the exclusive OR is
oben nach unten). Das Exclusiv-Oder und also „0“. Therefore the low bit of the block
damit das entsprechende Bit des BCC ist check character must be „0“ again at this
daher ebenfalls 0. In der Spalte links neben position. In the column left of the lowest bit,
dem kleinsten Bit ergibt die EX-OR-Funktion the X-OR function results in a „1“ etc.
den Wert 1
Allgemein gilt: Bei einer geradzahligen In general we can say: when in one column
Anzahl von „1“ in einer Spalte ist das BCC- we find an even number of „1“, the block
Bit an dieser Stelle „0“. Bei einer check bit must be „0“ at this position. When
ungeradzahligen Anzahl von „1“ in einer we find an odd number of „1“, the block
Spalte ist das BCC-Bit an dieser Stelle „1“ check bit must be „1“ at this position
Wenn wir nun die resultierenden Bits des So we find with our example, that the 8 Bits
BCC in einer Reihe lesen, ergibt sich damit of the block check character, read as a row,
die Binärzahl are
0-0-1-1-0-1-1-0 0-0-1-1-0-1-1-0
as dem Hexadezimal-Code „36“ oder dem which equals to the Hexadecimal code “36”
ASCII-Zeichen „6“ entspricht. or to the ASCII character of „6“.
8
7.2 Bestätigung abwarten 7.2 Wait for acknowledgement
Bei korrekter Übertragung wird das Gerät After correct transmission, the unit will
mit dem Bestätigungs-Zeichen “ACK” acknowledge by responding “ACK” (Hex
antworten (Hex „06“, binär 0000 0110). Falls “06” or binary 0000 0110).
das Gerät stattdessen mit „NAK“ antwortet Where the unit instead should respond
(Hex „15“), wurde die Sendung wegen eines “NAK” (Hex “15”), the transmission was
Fehlers nicht akzeptiert (z.B. falscher BCC rejected due to a fault like wrong BCC or
oder nicht korrekte Folge der Zeichen) incorrect sequence of characters etc.
Falls das Gerät überhaupt nicht antwortet, Where the unit does not respond at all, this
war entweder der gesendete String indicates an uncomplete transmission string
unvollständig, oder serielle Grundein- or wrong basic serial settings like Baud rate,
stellungen wie Baudrate, Datenformat usw. Data format etc.
sind nicht korrekt.
9
Hinweis: Hint:
Die Lebensdauer bei EEProms ist auf ca. The life time of EEProm memory chips is
100 000 Speicherzyklen beschränkt, limited to a total number of about
danach ist eine sichere Speicherung 100 000 storage cycles. After this, stored
nicht mehr gewährleistet!. data may get lost.
10