Virtual Console: Difference between revisions

From CANopen-Lift
Jump to navigation Jump to search
No edit summary
(Added proposed ESC-Z as described in the German version of the article.)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[de:Virtuelle_Konsole]]
[[de:Virtuelle_Konsole]]
[[Datei:canopen-terminal.png|right]]
[[File:canopen-terminal.png|right|CANopen Terminal]]
 


== CANopen virtual terminal for CiA 417, Object 600Ah ==
== CANopen virtual terminal for CiA 417, Object 600Ah ==
<div style="border:1px solid #8080FF; background:#E0E0FF; font-size:100%; padding:5px; margin-top:5px;">Tip:  The Object 600Ah for the virtual terminal will be defined as CiA 417 V 1.0.5. That means that there are some changes to the initial proposal with the object 1026h (CiA 301). </ Div>  
 
<div style="border:1px solid #8080FF; background:#E0E0FF; font-size:100%; padding:5px; margin-top:5px;">Tip:  The Object 600Ah for the virtual terminal will be defined as CiA 417 V 1.0.5. That means that there are some changes to the initial proposal with the object 1026h (CiA 301). </div>
 


=== General ===
=== General ===
Line 12: Line 15:


There are 2 remote control channels:  
There are 2 remote control channels:  
* An input channel (stdin), and
* An input channel (stdin), and
* an output channel (stdout)
* an output channel (stdout)
Line 24: Line 28:




=== Process of data exchange via SDO ===
=== Data exchange process via SDO ===


The output device (virtual terminal) polls the Object 600Ah, subindex 2 cyclically. If it reads a symbol different than zero (0), will be displayed on the terminal. The control sequences VT-52 will be used to control the cursor.
The output device (virtual terminal) polls the Object 600Ah, subindex 2 cyclically. If it reads a char different than zero (0), it will be displayed on the terminal. The control sequences VT-52 will be used to control the cursor.


If there are no signs the poll lenght will be shorter.
If there are no chars available, the polling time could be longer.


To manually control a key a keycode will be written in the Object 600Ah, subindex 1.
To manually control a key a keycode will be written in the Object 600Ah, subindex 1.


=== Ablauf des Datenaustausches via MPDO ===


Um die Kommunikation zu beschleunigen, besteht die Möglichkeit, die Ein- und Ausgabedaten per MPDO zu versenden.  
=== Data exchange process via MPDO ===
 
There is the posibility of using in- and output data via MPDO to accelerate the process.


Display-Ausgaben (Gerät -> Virtuelles Terminal):
Display-output (Device -> Virtual terminal):


   COB-ID:      0x500 + Node-ID Gerät
   COB-ID:      0x500 + Node-ID device
   Länge:        8 Bytes
   Lenght:        8 Bytes
   Address:      Node-ID Gerät (Source)
   Address:      Node-ID device (Source)
   Multiplexor:  600Ah, Subindex 2
   Multiplexor:  600Ah, Subindex 2
   Data:        DWORD mit bis zu 4 Zeichen
   Data:        DWORD up to 4 characters


Tastatur-Eingaben (Virtuelles Terminal -> Gerät):
Keyboard input (Virtual Terminal -> device):


   COB-ID:      0x500 + Node-ID virtuelles Terminal
   COB-ID:      0x500 + Node-ID virtual terminal
   Länge:        8 Bytes  
   Lenght:        8 Bytes  
   Address:      0x80 + Node-ID Gerät (Destination)
   Address:      0x80 + Node-ID device (Destination)
   Multiplexor:  600Ah, Subindex 1
   Multiplexor:  600Ah, Subindex 1
   Data:        DWORD mit bis zu 4 Zeichen
   Data:        DWORD up to 4 characters
 
Zum Einschalten der Display-Ausgabe via MPDO schickt das virtuelle Terminal entweder ein beliebiges Zeichen ungleich NUL (0) oder Cntrl-A (01h). Mit Cntrl-A wird die Zeitüberwachung aktiviert, d. h. das virtuelle Terminal muss mindestens jede Sekunde einen Tasten-Code schicken (z. B. Cntrl-A). Bekommt in diesem Mode das Gerät innerhalb von 4 s kein Zeichen, wird die Display-Ausgabe via MPDO abgeschaltet.


Zum Deaktivieren der Display-Ausgabe schickt das virtuelle Terminal Cntrl-D (04h) oder wenn die Zeitüberwachung (Cntrl-A) aktiv ist, beendet das Gerät automatisch die Ausgabe, wenn kein Zeichen mehr empfangen wurde.
To switch-on the display-output via MPDO the virtual terminal sends either a number different from zero (0) or Cntrl-A (01h). Cntrl-A activates the time monitoring, that means that the virtual terminal has to send a keycode (eg, Cntrl-A) almost every second. If the device does not recieve any sign in 4s the display-output will be switched-off.


Damit es bei der Zeichenausgabe per MPDO nicht zu einer zu hohen Buslast kommt, sollten maximal zwei MPDO pro 10 ms ausgegeben werden (inhibit Timer 5 ms).
To deactivate the display-output, the virtual terminal sends Cntrl-D (04h) or, if the time monitoring (Cntrl-A) is on, the virtual terminal is automatically switched-off when it does not recieve any sign.


== Zeichensatz ==
In order not to overload the bus, one should not send more than 2 MPDO pro 10ms (inhibit timer 5 ms)


Für die Kodierung der Zeichen (Umlaute) wird der Zeichensatz ISO-8859-15 (siehe [[wpde:ISO_8859-15|ISO-8859-15]]) verwendet.
== Character set ==


The character set ISO-8859-15 (siehe [[wpde:ISO_8859-15|ISO-8859-15]]) can be used to enconde the characters (umlauds)


== Tastaturcodes (Virtuelle Tasten) ==
== Keyboardcodes (Virtual keys) ==


Folgende ASCII-Codes können für eine Menü-Steuerung verwendet werden:
The following ASCII-codes can be use to control the menu:


{| border="1" cellspacing="0" cellpadding="3"
{| border="1" cellspacing="0" cellpadding="3"
! Dez.  !! Hex      !! Char  !! Bedeutung
! Dez.  !! Hex      !! Char  !! Meaning
|-
|-
| 24    || 0x18      || CAN  || End Taste (Cntrl-X)
| 24    || 0x18      || CAN  || End key (Cntrl-X)
|-
|-
| 45    || 0x2D      || '-'  || Minus Taste
| 45    || 0x2D      || '-'  || Minus key
|-
|-
| 43    || 0x2B      || '+'  || Plus Taste
| 43    || 0x2B      || '+'  || Plus key
|-
|-
| 13    || 0x0D      || CR    || Enter Taste
| 13    || 0x0D      || CR    || Enter key
|-
|-
| 27 65 || 0x1B 0x41 || ESC A || Pfeil Auf Taste
| 27 65 || 0x1B 0x41 || ESC A || up arrow key
|-
|-
| 27 66 || 0x1B 0x42 || ESC B || Pfeil Ab Taste
| 27 66 || 0x1B 0x42 || ESC B || Down arrow key
|-
|-
| 27 67 || 0x1B 0x43 || ESC C || Pfeil Rechts Taste
| 27 67 || 0x1B 0x43 || ESC C || right arrow key
|-
|-
| 27 68 || 0x1B 0x44 || ESC D || Pfeil Links Taste
| 27 68 || 0x1B 0x44 || ESC D || left arrow key
|-
|-
| 27 80 || 0x1B 0x50 || ESC P || F1 Taste
| 27 80 || 0x1B 0x50 || ESC P || F1 key
|-
|-
| 27 81 || 0x1B 0x51 || ESC Q || F2 Taste
| 27 81 || 0x1B 0x51 || ESC Q || F2 key
|-
|-
| 27 82 || 0x1B 0x52 || ESC R || F3 Taste
| 27 82 || 0x1B 0x52 || ESC R || F3 key
|-
|-
| 27 83 || 0x1B 0x53 || ESC S || F4 Taste
| 27 83 || 0x1B 0x53 || ESC S || F4 key
|}
|}


Das Gerät entscheidet selbstständig, wie die Tasten zu interpretieren sind. Dabei ist davon auszugehen, dass nicht alle virtuellen Terminals alle Tasten senden.


== Mindestanforderung an VT52 Steuersequenzen ==
The device decides itself how to read the keys. Its assumed that not all the virtual terminals send all the keys.
 
==Minimun requirements for the VT52 control sequences ==


{| border="1" cellspacing="0" cellpadding="3"
{| border="1" cellspacing="0" cellpadding="3"
! Code !! Name !! Bedeutung
! Code !! Name !! Meaning
|-
|-
| ESC A || Cursor up    || Der Cursor wird eine Zeile nach oben bewegt. Ist er schon in der ersten Zeile, erfolgt keine Reaktion.
| ESC A || Cursor up    || The cursor will move up one line. If it is y in the first row there will not be any reaction.
|-
|-
| ESC B || Cursor down  || Der Cursor wird eine Zeile nach unten bewegt. Ist er schon in der letzten Zeile, erfolgt keine Reaktion.
| ESC B || Cursor down  || The cursor will move down one line. If it is in the last row, there will no be any reaction.
|-
|-
| ESC C || Cursor right || Der Cursor wird um eine Spalte nach rechts bewegt. Ist er schon ganz rechts, erfolgt keine Reaktion.
| ESC C || Cursor right || The cursor will move one row to the left. Total right, no reaction.
|-
|-
| ESC D || Cursor left  || Der Cursor wird um eine Spalte nach links bewegt. Ist er schon ganz links, erfolgt keine Reaktion.
| ESC D || Cursor left  || The cursor will move one row to the left. Total left, no reaction.
|-
|-
| ESC E || Clear home  || Der Bildschirm wird gelöscht, der Cursor geht nach links oben.
| ESC E || Clear home  || The screen will be switched-off, the cursor will go up to the left.
|-
|-
| ESC H || Cursor home  || Der Cursor geht nach links oben.
| ESC H || Cursor home  ||The cursor will go up to the left.
|-
|-
| ESC I || Cursor up and insert || Der Cursor geht um eine Zeile nach oben. Ist er schon in der ersten Zeile, wird eine Leerzeile eingefügt. Die Folgezeilen rücken dann nach unten.
| ESC I || Cursor up and insert || The cursor moves up one row . If it is in the first row, an empty row will show up. The following rows descend.
|-
|-
| ESC J || Clear to end of frame || Der Bildschirm wird ab Cursor bis zum Ende gelöscht.
| ESC J || Clear to end of frame || The screen will be switched off from the cursor.
|-
|-
| ESC K || Clear to end of line || Die Zeile wird ab Cursor gelöscht.
| ESC K || Clear to end of line || The rows will be cleared from the cursor to the end.
|-
|-
| ESC L || Inser line || Leerzeile wird an aktueller Cursor-Zeile eingefügt. Der Rest des Bildschirms wir um eine Zeile nach unten geschoben.
| ESC L || Inser line || New rows will be inserted by the cursor row. The rest of the screen will move one line down.
|-
|-
| ESC M || Delete line || Löscht die Zeile, in der sich der Cursor befindet. Die anderen Zeilen rücken auf. Die letzte Zeile wird leer.
| ESC M || Delete line || Clears the row where the cursor is. The other lines move up. The last one will be cleared.
|-
|-
| ESC Yyx || Move Cursor || Bewegt den Cursor auf Zeile y und Spalte x. Auf die y- und x-Position muss immer 32 addiert werden. (x = 0 ... 19, y = 0 ... 3)
| ESC Yyx || Move Cursor || Move the cursor to the line y and the column x. 32 should always be  added at the X and Y position . (x = 0 ... 19, y = 0 ... 3)
|-
|-
| ESC e || Cursor on || Cursor einschalten
| ESC e || Cursor on || Switch-on the cursor
|-
|-
| ESC f || Cursor off || Cursor ausschalten
| ESC f || Cursor off || Switch-off the cursor
|-
|-
| ESC j || Store cursor || Die aktuelle Cursor-Position wird gespeichert.
| ESC j || Store cursor || The current position of the cursor will be saved.
|-
|-
| ESC k || Restore cursor || Der Cursor wird auf die mit ESC j gespeicherte Position bewegt.
| ESC k || Restore cursor || The cursor will move to the position stored with ESC j.
|-
|-
| ESC l || Clear line || Die Cursor-Zeile wird gelöscht. Der Cursor geht dann auf den Zeilenanfang.
| ESC l || Clear line || The cursor row will be cleared up. Then the cursor goes to the start line.
|-
|-
| ESC o || Clear line to cursor || Die Cursor-Zeile wird vom Anfang bis zum Cursor gelöscht.
| ESC o || Clear line to cursor || The cursor row will be cleared up from the start to the cursor.
|-
|-
|}
|}


[[Kategorie:Erweiterungen des Profils]]
== Proposal for new control sequences ==
[[Kategorie:Empfehlungen]]
 
[[Category:Application Notes]]
With a new command, the possibility should be created, the properties of the output and input device (terminal) to ask.
 
The device shall transmit
 
  ESC Z = Identify terminal type
 
The controller/terminal shall answer
 
  ESC [<a_rows>;<a_colums>;<g_rows>;<g_colums>;<keymap>] = Terminal features
 
  a_rows, a_columns:  ASCII-Mode Count rows/columns
  g_rows, g_colums:  Graphics-Mode Count rows/columns
  keymap:            0 = normal/standard, 1 = cursor keys (up, down, left right), 2 = +/- keys (end, -, +, CR)
 
Example:
 
  ASCII-Mode only and standard keys:    ESC [4;20]
  ASCII-Mode only and cursor-keys:     ESC [4;20;;;1] oder ESC [4;20;0;0;1]
  Graphics-mode and standard-key:      ESC [4;20;64;128]
  Graphics-mode and cursor-keys:        ESC [4;20;64;128;1]
 
Additionally to enter graphics mode, a command is required:


  ESC g = Enter graphic mode


[[Category:Extension of the profile]]
[[Category:Recommendations]]
[[Category:Application Notes]]
[[Category:Application Notes]]

Latest revision as of 13:54, 6 December 2019

CANopen Terminal
CANopen Terminal


CANopen virtual terminal for CiA 417, Object 600Ah

Tip: The Object 600Ah for the virtual terminal will be defined as CiA 417 V 1.0.5. That means that there are some changes to the initial proposal with the object 1026h (CiA 301).


General

A CANopen device can be used or controlled using the Object 600Ah. The display and the keyboard are located in another CANopen appliance (Virtual Terminal)

The mentioned Object should always be included in the drive unit.

There are 2 remote control channels:

  • An input channel (stdin), and
  • an output channel (stdout)


 Object 600Ah Subindex 1 is stdin (Standard-input: Keyboard)
 Object 600Ah Subindex 2 is stdout (Standard-output: screen)

If the signs Object 600Ah, subindex 2 are ready the device send output to the virtual termnial. The zero sign (0) means no sign available. The control sequences VT-52 can be used to control the cursors.

To control a key manually the keycode (1...225) should be written in the Object 600Ah, subindex 1. Some keys will be send as escape keys (VT-52).


Data exchange process via SDO

The output device (virtual terminal) polls the Object 600Ah, subindex 2 cyclically. If it reads a char different than zero (0), it will be displayed on the terminal. The control sequences VT-52 will be used to control the cursor.

If there are no chars available, the polling time could be longer.

To manually control a key a keycode will be written in the Object 600Ah, subindex 1.


Data exchange process via MPDO

There is the posibility of using in- and output data via MPDO to accelerate the process.

Display-output (Device -> Virtual terminal):

 COB-ID:       0x500 + Node-ID device
 Lenght:        8 Bytes
 Address:      Node-ID device (Source)
 Multiplexor:  600Ah, Subindex 2
 Data:         DWORD up to 4 characters

Keyboard input (Virtual Terminal -> device):

 COB-ID:       0x500 + Node-ID virtual terminal
 Lenght:        8 Bytes 
 Address:      0x80 + Node-ID device (Destination)
 Multiplexor:  600Ah, Subindex 1
 Data:         DWORD up to 4 characters

To switch-on the display-output via MPDO the virtual terminal sends either a number different from zero (0) or Cntrl-A (01h). Cntrl-A activates the time monitoring, that means that the virtual terminal has to send a keycode (eg, Cntrl-A) almost every second. If the device does not recieve any sign in 4s the display-output will be switched-off.

To deactivate the display-output, the virtual terminal sends Cntrl-D (04h) or, if the time monitoring (Cntrl-A) is on, the virtual terminal is automatically switched-off when it does not recieve any sign.

In order not to overload the bus, one should not send more than 2 MPDO pro 10ms (inhibit timer 5 ms)

Character set

The character set ISO-8859-15 (siehe ISO-8859-15) can be used to enconde the characters (umlauds)

Keyboardcodes (Virtual keys)

The following ASCII-codes can be use to control the menu:

Dez. Hex Char Meaning
24 0x18 CAN End key (Cntrl-X)
45 0x2D '-' Minus key
43 0x2B '+' Plus key
13 0x0D CR Enter key
27 65 0x1B 0x41 ESC A up arrow key
27 66 0x1B 0x42 ESC B Down arrow key
27 67 0x1B 0x43 ESC C right arrow key
27 68 0x1B 0x44 ESC D left arrow key
27 80 0x1B 0x50 ESC P F1 key
27 81 0x1B 0x51 ESC Q F2 key
27 82 0x1B 0x52 ESC R F3 key
27 83 0x1B 0x53 ESC S F4 key


The device decides itself how to read the keys. Its assumed that not all the virtual terminals send all the keys.

Minimun requirements for the VT52 control sequences

Code Name Meaning
ESC A Cursor up The cursor will move up one line. If it is y in the first row there will not be any reaction.
ESC B Cursor down The cursor will move down one line. If it is in the last row, there will no be any reaction.
ESC C Cursor right The cursor will move one row to the left. Total right, no reaction.
ESC D Cursor left The cursor will move one row to the left. Total left, no reaction.
ESC E Clear home The screen will be switched-off, the cursor will go up to the left.
ESC H Cursor home The cursor will go up to the left.
ESC I Cursor up and insert The cursor moves up one row . If it is in the first row, an empty row will show up. The following rows descend.
ESC J Clear to end of frame The screen will be switched off from the cursor.
ESC K Clear to end of line The rows will be cleared from the cursor to the end.
ESC L Inser line New rows will be inserted by the cursor row. The rest of the screen will move one line down.
ESC M Delete line Clears the row where the cursor is. The other lines move up. The last one will be cleared.
ESC Yyx Move Cursor Move the cursor to the line y and the column x. 32 should always be added at the X and Y position . (x = 0 ... 19, y = 0 ... 3)
ESC e Cursor on Switch-on the cursor
ESC f Cursor off Switch-off the cursor
ESC j Store cursor The current position of the cursor will be saved.
ESC k Restore cursor The cursor will move to the position stored with ESC j.
ESC l Clear line The cursor row will be cleared up. Then the cursor goes to the start line.
ESC o Clear line to cursor The cursor row will be cleared up from the start to the cursor.

Proposal for new control sequences

With a new command, the possibility should be created, the properties of the output and input device (terminal) to ask.

The device shall transmit

 ESC Z = Identify terminal type

The controller/terminal shall answer

 ESC [<a_rows>;<a_colums>;<g_rows>;<g_colums>;<keymap>] = Terminal features
 
 a_rows, a_columns:  ASCII-Mode Count rows/columns
 g_rows, g_colums:   Graphics-Mode Count rows/columns
 keymap:             0 = normal/standard, 1 = cursor keys (up, down, left right), 2 = +/- keys (end, -, +, CR)

Example:

 ASCII-Mode only and standard keys:    ESC [4;20]
 ASCII-Mode only and cursor-keys:      ESC [4;20;;;1] oder ESC [4;20;0;0;1]
 Graphics-mode and standard-key:       ESC [4;20;64;128]
 Graphics-mode and cursor-keys:        ESC [4;20;64;128;1]

Additionally to enter graphics mode, a command is required:

 ESC g = Enter graphic mode