DCC-Stellwerk
 www.gheinz.de
 USB-VCP-Monitor: 115200 Baud, 8n1n
 für Weichen von 0...99 (relativ)
 Weiche stellen: z.B. 7# (Nr.7 gerade)
 oder 23* (Nr.23 rund);
 Sign/Magnitude (SM) Darstellung;
 Weichenkette bilden mit + (D-Taste)
 Kette speichern mit A0+ bis C9+
 XpressNet-Einstellungen mit ABC:
 Registerwert B 0...9 mal 100 -> abs. Adr. der Weiche
 z.B. B1 -> Weichen in XpressNet 100...199
 Beispiele:
 Kette speichern: A3+, B7+, C2+
 Kette ausführen: A3*, B7*, C2*
 Kette löschen:   A3#, B7#, C2# 

Kette gefunden mit Blocknummer bnr = 0 ~ A0
 readchainEE() Blocklänge aus EE-Blockregister blen  = 7
 Lese EEPROM-Adresse eeadr = 100;  SM-Wert smval = -28 = 0x9C
 Lese EEPROM-Adresse eeadr = 101;  SM-Wert smval = +29 = 0x1D
 Lese EEPROM-Adresse eeadr = 102;  SM-Wert smval = -30 = 0x9E
 Lese EEPROM-Adresse eeadr = 103;  SM-Wert smval = -31 = 0x9F
 Lese EEPROM-Adresse eeadr = 104;  SM-Wert smval = +32 = 0x20
 Lese EEPROM-Adresse eeadr = 105;  SM-Wert smval = -33 = 0xA1
 Lese EEPROM-Adresse eeadr = 106;  SM-Wert smval = +34 = 0x22

Kette gefunden mit Blocknummer bnr = 10 ~ B0
 readchainEE() Blocklänge aus EE-Blockregister blen  = 4
 Lese EEPROM-Adresse eeadr = 1100;  SM-Wert smval = +0 = 0x0
 Lese EEPROM-Adresse eeadr = 1101;  SM-Wert smval = +1 = 0x1
 Lese EEPROM-Adresse eeadr = 1102;  SM-Wert smval = -2 = 0x82
 Lese EEPROM-Adresse eeadr = 1103;  SM-Wert smval = -3 = 0x83

Kette gefunden mit Blocknummer bnr = 29 ~ C9
 readchainEE() Blocklänge aus EE-Blockregister blen  = 20
 Lese EEPROM-Adresse eeadr = 3000;  SM-Wert smval = -0 = 0x80
 Lese EEPROM-Adresse eeadr = 3001;  SM-Wert smval = +0 = 0x0
 Lese EEPROM-Adresse eeadr = 3002;  SM-Wert smval = -1 = 0x81
 Lese EEPROM-Adresse eeadr = 3003;  SM-Wert smval = +1 = 0x1
 Lese EEPROM-Adresse eeadr = 3004;  SM-Wert smval = -2 = 0x82
 Lese EEPROM-Adresse eeadr = 3005;  SM-Wert smval = +2 = 0x2
 Lese EEPROM-Adresse eeadr = 3006;  SM-Wert smval = -3 = 0x83
 Lese EEPROM-Adresse eeadr = 3007;  SM-Wert smval = +3 = 0x3
 Lese EEPROM-Adresse eeadr = 3008;  SM-Wert smval = -4 = 0x84
 Lese EEPROM-Adresse eeadr = 3009;  SM-Wert smval = +4 = 0x4
 Lese EEPROM-Adresse eeadr = 3010;  SM-Wert smval = -5 = 0x85
 Lese EEPROM-Adresse eeadr = 3011;  SM-Wert smval = +5 = 0x5
 Lese EEPROM-Adresse eeadr = 3012;  SM-Wert smval = +6 = 0x6
 Lese EEPROM-Adresse eeadr = 3013;  SM-Wert smval = -6 = 0x86
 Lese EEPROM-Adresse eeadr = 3014;  SM-Wert smval = -7 = 0x87
 Lese EEPROM-Adresse eeadr = 3015;  SM-Wert smval = +7 = 0x7
 Lese EEPROM-Adresse eeadr = 3016;  SM-Wert smval = -8 = 0x88
 Lese EEPROM-Adresse eeadr = 3017;  SM-Wert smval = +8 = 0x8
 Lese EEPROM-Adresse eeadr = 3018;  SM-Wert smval = -9 = 0x89
 Lese EEPROM-Adresse eeadr = 3019;  SM-Wert smval = +9 = 0x9

   incoming char A = dec65 = 0x41
   incoming char 0 = dec48 = 0x30
   incoming char * = dec42 = 0x2A
 
A0* Kette wird ausgeführt. 
 readchainEE() Blocklänge aus EE-Blockregister blen  = 7
 Lese EEPROM-Adresse eeadr = 100;  SM-Wert smval = -28 = 0x9C
  Weiche schalten: SM-Wert smval = -28 = 0x9C
   XpressNet Weiche Nummer xadr = 128
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 128
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 101;  SM-Wert smval = +29 = 0x1D
  Weiche schalten: SM-Wert smval = +29 = 0x1D
   XpressNet Weiche Nummer xadr = 129
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 129
   XpressNet Weiche Richtung 0

 Lese EEPROM-Adresse eeadr = 102;  SM-Wert smval = -30 = 0x9E
  Weiche schalten: SM-Wert smval = -30 = 0x9E
   XpressNet Weiche Nummer xadr = 130
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 130
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 103;  SM-Wert smval = -31 = 0x9F
  Weiche schalten: SM-Wert smval = -31 = 0x9F
   XpressNet Weiche Nummer xadr = 131
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 131
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 104;  SM-Wert smval = +32 = 0x20
  Weiche schalten: SM-Wert smval = +32 = 0x20
   XpressNet Weiche Nummer xadr = 132
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 132
   XpressNet Weiche Richtung 0

 Lese EEPROM-Adresse eeadr = 105;  SM-Wert smval = -33 = 0xA1
  Weiche schalten: SM-Wert smval = -33 = 0xA1
   XpressNet Weiche Nummer xadr = 133
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 133
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 106;  SM-Wert smval = +34 = 0x22
  Weiche schalten: SM-Wert smval = +34 = 0x22
   XpressNet Weiche Nummer xadr = 134
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 134
   XpressNet Weiche Richtung 0


   incoming char B = dec66 = 0x42
   incoming char 0 = dec48 = 0x30
   incoming char * = dec42 = 0x2A
 
B0* Kette wird ausgeführt. 
 readchainEE() Blocklänge aus EE-Blockregister blen  = 4
 Lese EEPROM-Adresse eeadr = 1100;  SM-Wert smval = +0 = 0x0
  Weiche schalten: SM-Wert smval = +0 = 0x0
   XpressNet Weiche Nummer xadr = 100
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 100
   XpressNet Weiche Richtung 0

 Lese EEPROM-Adresse eeadr = 1101;  SM-Wert smval = +1 = 0x1
  Weiche schalten: SM-Wert smval = +1 = 0x1
   XpressNet Weiche Nummer xadr = 101
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 101
   XpressNet Weiche Richtung 0

 Lese EEPROM-Adresse eeadr = 1102;  SM-Wert smval = -2 = 0x82
  Weiche schalten: SM-Wert smval = -2 = 0x82
   XpressNet Weiche Nummer xadr = 102
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 102
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 1103;  SM-Wert smval = -3 = 0x83
  Weiche schalten: SM-Wert smval = -3 = 0x83
   XpressNet Weiche Nummer xadr = 103
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 103
   XpressNet Weiche Richtung 1


   incoming char B = dec66 = 0x42
   incoming char 0 = dec48 = 0x30
   incoming char # = dec35 = 0x23
B0# Kette gelöscht.     Kettenindex kidx = 0

   incoming char 2 = dec50 = 0x32
   incoming char 1 = dec49 = 0x31
   incoming char # = dec35 = 0x23
   chr[0...2] = 21#
  Weiche schalten: SM-Wert smval = +21 = 0x15
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 0

   incoming char * = dec42 = 0x2A
   chr[0...2] = 1#*
  Weiche schalten: SM-Wert smval = -21 = 0x95
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 1

   incoming char # = dec35 = 0x23
   chr[0...2] = #*#
  Weiche schalten: SM-Wert smval = +21 = 0x15
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 0

   incoming char * = dec42 = 0x2A
   chr[0...2] = *#*
  Weiche schalten: SM-Wert smval = -21 = 0x95
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 1

   incoming char D = dec68 = 0x44
 Verkettung angefordert mit D; Kettenindex kidx = 0
  Weiche schalten: SM-Wert smval = -21 = 0x95
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 1

   incoming char 5 = dec53 = 0x35
   incoming char 4 = dec52 = 0x34
   incoming char # = dec35 = 0x23
   chr[0...2] = 54#
  Weiche schalten: SM-Wert smval = +54 = 0x36
   XpressNet Weiche Nummer xadr = 154
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 154
   XpressNet Weiche Richtung 0

   incoming char * = dec42 = 0x2A
   chr[0...2] = 4#*
  Weiche schalten: SM-Wert smval = -54 = 0xB6
   XpressNet Weiche Nummer xadr = 154
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 154
   XpressNet Weiche Richtung 1

   incoming char D = dec68 = 0x44
 Verkettung angefordert mit D; Kettenindex kidx = 1
  Weiche schalten: SM-Wert smval = -54 = 0xB6
   XpressNet Weiche Nummer xadr = 154
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 154
   XpressNet Weiche Richtung 1

   incoming char 9 = dec57 = 0x39
   incoming char 3 = dec51 = 0x33
   incoming char D = dec68 = 0x44
   incoming char A = dec65 = 0x41
   incoming char 5 = dec53 = 0x35
   incoming char D = dec68 = 0x44
 Schreibe auf EEPROM-Adresse eeadr = 600;  smval = SM-Wert smval = -21 = 0x95
  Weiche schalten: SM-Wert smval = -54 = 0xB6
   XpressNet Weiche Nummer xadr = 154
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 154
   XpressNet Weiche Richtung 1

 Schreibe auf EEPROM-Adresse eeadr = 601;  smval = SM-Wert smval = -54 = 0xB6
  Weiche schalten: SM-Wert smval = +0 = 0x0
   XpressNet Weiche Nummer xadr = 100
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 100
   XpressNet Weiche Richtung 0

A5+ Kette gespeichert.  Anzahl gespeicherter Weichen: 2

   incoming char A = dec65 = 0x41
   incoming char 5 = dec53 = 0x35
   incoming char * = dec42 = 0x2A
 
A5* Kette wird ausgeführt. 
 readchainEE() Blocklänge aus EE-Blockregister blen  = 2
 Lese EEPROM-Adresse eeadr = 600;  SM-Wert smval = -21 = 0x95
  Weiche schalten: SM-Wert smval = -21 = 0x95
   XpressNet Weiche Nummer xadr = 121
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 121
   XpressNet Weiche Richtung 1

 Lese EEPROM-Adresse eeadr = 601;  SM-Wert smval = -54 = 0xB6
  Weiche schalten: SM-Wert smval = -54 = 0xB6
   XpressNet Weiche Nummer xadr = 154
   XpressNet Weiche Adr_High = 0
   XpressNet Weiche Adr_Low = 154
   XpressNet Weiche Richtung 1


   incoming char A = dec65 = 0x41
   incoming char B = dec66 = 0x42
   incoming char C = dec67 = 0x43
   Stellwerksetup chr[0],[1],[2] = ABC


 Lenz A0, Roco A1 = 0
 Reg.-Adr B0...9 = 1
 XnetAdr C00...30 = 28
   Ende mit #

   incoming char 
   # = dec35 = 0x23
   Setup Ende, update EEPROM

Kette gefunden mit Blocknummer bnr = 0 ~ A0
 readchainEE() Blocklänge aus EE-Blockregister blen  = 7
 Lese EEPROM-Adresse eeadr = 100;  SM-Wert smval = -28 = 0x9C
 Lese EEPROM-Adresse eeadr = 101;  SM-Wert smval = +29 = 0x1D
 Lese EEPROM-Adresse eeadr = 102;  SM-Wert smval = -30 = 0x9E
 Lese EEPROM-Adresse eeadr = 103;  SM-Wert smval = -31 = 0x9F
 Lese EEPROM-Adresse eeadr = 104;  SM-Wert smval = +32 = 0x20
 Lese EEPROM-Adresse eeadr = 105;  SM-Wert smval = -33 = 0xA1
 Lese EEPROM-Adresse eeadr = 106;  SM-Wert smval = +34 = 0x22

Kette gefunden mit Blocknummer bnr = 5 ~ A5
 readchainEE() Blocklänge aus EE-Blockregister blen  = 2
 Lese EEPROM-Adresse eeadr = 600;  SM-Wert smval = -21 = 0x95
 Lese EEPROM-Adresse eeadr = 601;  SM-Wert smval = -54 = 0xB6

Kette gefunden mit Blocknummer bnr = 29 ~ C9
 readchainEE() Blocklänge aus EE-Blockregister blen  = 20
 Lese EEPROM-Adresse eeadr = 3000;  SM-Wert smval = -0 = 0x80
 Lese EEPROM-Adresse eeadr = 3001;  SM-Wert smval = +0 = 0x0
 Lese EEPROM-Adresse eeadr = 3002;  SM-Wert smval = -1 = 0x81
 Lese EEPROM-Adresse eeadr = 3003;  SM-Wert smval = +1 = 0x1
 Lese EEPROM-Adresse eeadr = 3004;  SM-Wert smval = -2 = 0x82
 Lese EEPROM-Adresse eeadr = 3005;  SM-Wert smval = +2 = 0x2
 Lese EEPROM-Adresse eeadr = 3006;  SM-Wert smval = -3 = 0x83
 Lese EEPROM-Adresse eeadr = 3007;  SM-Wert smval = +3 = 0x3
 Lese EEPROM-Adresse eeadr = 3008;  SM-Wert smval = -4 = 0x84
 Lese EEPROM-Adresse eeadr = 3009;  SM-Wert smval = +4 = 0x4
 Lese EEPROM-Adresse eeadr = 3010;  SM-Wert smval = -5 = 0x85
 Lese EEPROM-Adresse eeadr = 3011;  SM-Wert smval = +5 = 0x5
 Lese EEPROM-Adresse eeadr = 3012;  SM-Wert smval = +6 = 0x6
 Lese EEPROM-Adresse eeadr = 3013;  SM-Wert smval = -6 = 0x86
 Lese EEPROM-Adresse eeadr = 3014;  SM-Wert smval = -7 = 0x87
 Lese EEPROM-Adresse eeadr = 3015;  SM-Wert smval = +7 = 0x7
 Lese EEPROM-Adresse eeadr = 3016;  SM-Wert smval = -8 = 0x88
 Lese EEPROM-Adresse eeadr = 3017;  SM-Wert smval = +8 = 0x8
 Lese EEPROM-Adresse eeadr = 3018;  SM-Wert smval = -9 = 0x89
 Lese EEPROM-Adresse eeadr = 3019;  SM-Wert smval = +9 = 0x9