CANopen (Preview)
1. Overview
This document describes the details of the CANopen communication profile on the Grayhill Touch Encoder. The Touch Encoder supports the following communication objects and protocols:
LSS slave
NMT slave
1x Server SDO
SYNC producer & consumer
Heartbeat producer
EMCY producer
Additionally, the Touch Encoder implements several 0x2000+ objects that are used to control the device and exchange data with it. The objects are described in detail in the following sections.
2. Communication profile
The following sections list some key objects that are supported by the Touch Encoder. For the sake of brevity, only the entry values are provided. Please refer to the CiA 301 for the complete description of the objects and their entries.
Object 0x1006: Communication cycle period
The Touch Encoder implements a SYNC producer. Use this object to configure the cycle period.
Object 0x1008: Manufacturer device name
Sub-index | Name | Default Value |
---|---|---|
0x00 | Manufacturer device name | "Touch Encoder" |
Object 0x1017: Producer heartbeat time
The Touch Encoder implements a heartbeat producer. Use this object to configure the heartbeat time.
Object 0x1018: Identity
Sub-index | Name | Default Value |
---|---|---|
0x00 | Highest sub-index supported | 4 |
0x01 | Vendor-ID | 0x00000307 |
0x02 | Product code | 0x00000060 |
0x03 | Revision number | No |
0x04 | Serial number | No |
TPDO parameters
Object 1804: TPDO 5 communication parameters
Sub-index | Name | Default Value |
---|---|---|
0x01 | COB-ID | 0x40000680 |
0x02 | Transmission Type | 254 |
0x03 | Inhibit Time | 0 |
0x05 | Event Timer | 0 |
0x06 | Sync Start Value | 0 |
Object 1805: TPDO 6 communication parameters
Sub-index | Name | Default Value |
---|---|---|
0x01 | COB-ID | 0x40000681 |
0x02 | Transmission Type | 254 |
0x03 | Inhibit Time | 0 |
0x05 | Event Timer | 0 |
0x06 | Sync Start Value | 0 |
Object 1806: TPDO 7 communication parameters
Sub-index | Name | Default Value |
---|---|---|
0x01 | COB-ID | 0x40000682 |
0x02 | Transmission Type | 254 |
0x03 | Inhibit Time | 0 |
0x05 | Event Timer | 0 |
0x06 | Sync Start Value | 0 |
Object 1807: TPDO 8 communication parameters
Sub-index | Name | Default Value |
---|---|---|
0x01 | COB-ID | 0x40000683 |
0x02 | Transmission Type | 254 |
0x03 | Inhibit Time | 0 |
0x05 | Event Timer | 0 |
0x06 | Sync Start Value | 0 |
Object 1A04: TPDO 5 mapping parameters
Sub-index | Name | Default Value |
---|---|---|
0x00 | Number of mapped objects | 0x02 |
0x01 | Command Status | 0x20000208 |
0x02 | Compact Result | 0x20000338 |
Object 1A05: TPDO 6 mapping parameters
Sub-index | Name | Default Value |
---|---|---|
0x00 | Number of mapped objects | 0x01 |
0x01 | Channel Queue Size | 0x20000109 |
Object 1A06: TPDO 7 mapping parameters
Sub-index | Name | Default Value |
---|---|---|
0x00 | Number of mapped objects | 0x01 |
0x01 | RIE Report | 0x20020140 |
Object 1A07: TPDO 8 mapping parameters
Sub-index | Name | Default Value |
---|---|---|
0x00 | Number of mapped objects | 0x01 |
0x01 | GUIDE Notification | 0x20030340 |
3. Touch Encoder Objects
3.1. Object 0x2000: Commands
The Commands object is the endpoint for general device configuration.
VALUE DEFINITION
Sub-index 0x01 is used to submit a command. A command consists of a command ID and an optional command-specific data of varying length as depicted in the table below. For the list of the available commands, please see Command Reference.
Byte | Length (Bytes) | Description |
---|---|---|
0 | 1 | Command ID |
1 | Variable | Command-specific data (see Command Reference) |
Sub-index 0x02 is a single byte entry that represents the status of the recently submitted command. The status code of 15 indicates that the command is still in progress while all other values indicate that the command has completed. By default, TPDO 5 combines this entry along with sub-index 0x03 for the efficient way to reap the command result.
Byte | Bits | Description | Values |
---|---|---|---|
1 | 3-0 | Status Code | 0 - success |
1 - error | |||
2 - access denied | |||
3 - device busy | |||
15 - in progress | |||
6-4 | Size in Compact Result | 0-7 - Result size in bytes | |
7 | Result location | 0 - Result available in Sub-index 3 and 4 | |
1 - Result available in Sub-index 4 only |
The sole purpose of sub-index 0x03 is to contain the result of a command if the result size does not exceed 7 bytes. This allows it to be mapped in a TPDO (TPDO5) along with the status (sub-index 0x02). The appropriate bits in the status entry (sub-index 0x02) will indicate this. If the result is 8 bytes or larger, it is only available in sub-index 0x04 and must be read using SDO.
OBJECT DESCRIPTION
Index | 0x2000 |
---|---|
Name | Commands |
Object code | RECORD |
Data Type | Commands record |
Category | Mandatory |
ENTRY DESCRIPTION
Sub-index | 0x00 |
---|---|
Description | Highest sub-index supported |
Entry category | Mandatory |
Access | const |
PDO mapping | No |
Value Range | 0x04 |
Default value | 0x04 |
Sub-index | 0x01 |
---|---|
Description | Command |
Entry category | Mandatory |
Access | wo |
PDO mapping | No |
Value Range | |
Default value | No |
Sub-index | 0x02 |
---|---|
Description | Status |
Entry category | Mandatory |
Access | ro |
PDO mapping | Optional |
Value Range | |
Default value | No |
Sub-index | 0x03 |
---|---|
Description | Compact Result |
Entry category | Mandatory |
Access | ro |
PDO mapping | Optional |
Value Range | No |
Default value | 00000000000000 |
Sub-index | 0x04 |
---|---|
Description | Result |
Entry category | Mandatory |
Access | ro |
PDO mapping | No |
Value Range | No |
Default value | No |
3.2. Object 0x2001: Channels
There are certain commands that require exchange of data beyond the initial request and response. These commands require the host to specify the channel index as part of the command data. The channel index directly identifies a sub-index in the Channels object to be used for further communication.
VALUE DEFINITION
Sub-index 0x01 to 0x08 are the communication channels. The data exchanged between the host and the device using the channel is command-specific and not defined in this section. Each channel is a domain entry with the read/write behavior as follows. Data written to the channel is sent directly to the command context for consumption. Data destined for the host is placed in the channel-specific queue. Each read operation on the channel will yield the data from the front of the queue. There is a limit to the amount of data that can be queued in all channels. It is important for the host to read the data from the channel as soon as possible. The device will drop each new data when the queue space is exhausted and an EMERGENCY message will be emitted. In case the channel index is assigned to a different context (different command), the device will drop all data present in the queue.
Sub-index 0x09 is a TPDO-mappable entry that contains the queue size of each channel. Each byte represents the queue size of the corresponding channel as shown in the table below. The size increases with each new data put in the queue and decreases with each read operation. By default, TPDO 6 contains this entry for the efficient way to monitor the queue size of each channel.
Byte | Description |
---|---|
0 | Channel 1 queue size |
1 | Channel 2 queue size |
... | ... |
7 | Channel 8 queue size |
OBJECT DESCRIPTION
Index | 0x2001 |
---|---|
Name | Channels |
Object code | RECORD |
Data Type | Channels record |
Category | Mandatory |
ENTRY DESCRIPTION
Sub-index | 0x00 |
---|---|
Description | Highest sub-index supported |
Entry category | Mandatory |
Access | const |
PDO mapping | No |
Value Range | 0x09 |
Default value | 0x09 |
Sub-index | 0x01 |
---|---|
Description | Channel 1 |
Entry category | Mandatory |
Access | rw |
PDO mapping | No |
Value Range | No |
Default value | No |
Sub-index | 0x02 |
---|---|
Description | Channel 2 |
Entry category | Mandatory |
Access | rw |
PDO mapping | No |
Value Range | No |
Default value | No |
.
.
.
Sub-index | 0x08 |
---|---|
Description | Channel 8 |
Entry category | Mandatory |
Access | rw |
PDO mapping | No |
Value Range | No |
Default value | No |
Sub-index | 0x09 |
---|---|
Description | Status |
Entry category | Mandatory |
Access | rw |
PDO mapping | Optional |
Value Range | |
Default value | 0x0000000000000000 |
3.3. Object 0x2002: Raw Input Events
Object 0x2002 is the interface for the Raw Input Events (RIE). RIE are reported whenever a new input event is available and is being processed by the Touch Encoder. Input events are generated when any of the TE's user input devices show a change in their state. Each input device (encoder, touch sensor) generates a different type of RIE report.
VALUE DEFINITION
Sub-index 0x01 is an 8-byte entry that contains the most recent RIE report. By default, TPDO 7 contains this entry for the efficient notification mechanism. The following tables describe the layout of each report type.
Byte | Bits | Field Name | Value |
---|---|---|---|
0 | 7-0 | RIE Type | 0x00 - Touch |
1 | 0 | Tip Switch | 0-touch not detected |
1-touch detected | |||
3-1 | Contact ID | Contact ID | |
6-3 | Contact Count | Contact Count | |
7 | Reserved | 0 | |
2 | 15-0 | Contact X-coordinate | 16-bit signed integer data |
4 | 15-0 | Contact Y-coordinate | 16-bit signed integer data |
6 | 15-0 | Contact Time Stamp | 0x0000-0xFFFF |
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | RIE Type | 0x01 - Encoder |
1 | 15-0 | Encoder Raw Value | 0x0000-0xFFFF* |
Sub-index 0x02 is currently a write-only entry that is used to configure the RIE as follows:
Byte | Description | Value |
---|---|---|
0 | Control | 0x00 - RIE disabled |
0x01 - RIE enabled | ||
1-? | Don't care | Additional bytes are ignored |
OBJECT DESCRIPTION
Index | 0x2002 |
---|---|
Name | Raw Input Events |
Object code | RECORD |
Data Type | Raw input events record |
Category | Mandatory |
ENTRY DESCRIPTION
Sub-index | 0x00 |
---|---|
Description | Highest sub-index supported |
Entry category | Mandatory |
Access | const |
PDO mapping | No |
Value Range | 0x02 |
Default value | 0x02 |
Sub-index | 0x01 |
---|---|
Description | Report |
Entry category | Mandatory |
Access | ro |
PDO mapping | Optional |
Value Range | |
Default value | 0x0000000000000000 |
Sub-index | 0x02 |
---|---|
Description | Config |
Entry category | Mandatory |
Access | ro |
PDO mapping | No |
Value Range | |
Default value | No |
3.4. Object 0x2003: GUIDE
This object allows the host to control the GUIDE project currently running on the Touch Encoder. It offers facilities to monitor various events occurring as well as to control screen and the associated variables.
VALUE DEFINITION
Sub-index 0x01 is a read/write entry that contains the current screen ID. Writing to this entry will effectively change the screen on the Touch Encoder.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Screen ID | 0x01-0xFF |
Sub-index 0x02 is a read/write domain entry to query and modify variables in the running project. The write operation is used to select a variable and change its value. The data sent as part of the write operation must begin with the screen ID and the variable ID. The new variable value can optionally follow. The pair of identifiers is used to select a variable whose value is to be changed (if the variable value is provided) and for any subsequent read operation that will return the current value of the variable. The table below describes the layout of the write operation.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Screen ID | 0x00-0xFF |
1 | 7-0 | Variable ID | 0x00-0xFF |
2-?* | Variable | New Value | Variable-specific data** |
As described above, the write operation must be carried out in order to select a variable. Once the variable is selected, the host can read its value by issuing a read operation to sub-index 0x02. The read operation will return the pair of identifiers (screen ID and variable ID) followed by the current value of the variable:
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Screen ID | 0x00-0xFF |
1 | 7-0 | Variable ID | 0x00-0xFF |
2-? | Variable | Current value | Variable-specific data* |
Sub-index 0x03 is a read-only entry that contains the last GUIDE notification. This entry is updated whenever the current screen is changed, a variable has changed or a new GUIDE event has occurred. The entry is TPDO-mappable for the efficient way to monitor GUIDE events. By default, TPDO 8 contains this entry. The general format of the notification is as follows:
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x01 - Screen Change |
0x03 - Int Variable Change | |||
0x04 - String Variable Change | |||
0x10 - Knob Event | |||
0x11 - Touch Event | |||
0x12 - Gesture Event | |||
0x13 - Scene Event | |||
0x20 - Failure | |||
1-? | Variable | Notification data | Notification-specific data |
Please refer to GUIDE Notification for the complete list of notification types and the corresponding data layout.
OBJECT DESCRIPTION
Index | 0x2002 |
---|---|
Name | GUIDE Interface |
Object code | RECORD |
Data Type | GUIDE record |
Category | Mandatory |
ENTRY DESCRIPTION
Sub-index | 0x00 |
---|---|
Description | Highest sub-index supported |
Entry category | Mandatory |
Access | const |
PDO mapping | No |
Value Range | 0x03 |
Default value | 0x03 |
Sub-index | 0x01 |
---|---|
Description | Current Screen |
Entry category | Mandatory |
Access | rw |
PDO mapping | No |
Value Range | |
Default value | 0 |
Sub-index | 0x02 |
---|---|
Description | Variable |
Entry category | Mandatory |
Access | rw |
PDO mapping | No |
Value Range | |
Default value | No |
Sub-index | 0x03 |
---|---|
Description | Notification |
Entry category | Mandatory |
Access | ro |
PDO mapping | Optional |
Value Range | |
Default value | 0x0000000000000000 |
4. Command Reference
The following subsections describe the commands that can be submitted to the Touch Encoder using the Commands object (0x2000, sub-index 0x01).
4.1 Restart
This command restarts the Touch Encoder.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0x44 - Restart |
1-? | * | Don't care | 0x00 |
4.2 Restart To Utility Mode
In the Utility Mode, it is possible to access the Touch Encoder info, perform software update and configure the device.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0x45 - Launch Utility |
1-? | * | Don't care | 0x00 |
4.3 Backlight Control
The Backlight Control command allows setting the backlight intensity as well as the persistence of the backlight setting. The backlight level is a percentage value from 0 to 100, where 0 means no backlight and 100 means maximum brightness. The persistence control allows to specify whether the backlight level should be persistent across restarts or not.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0x80 - Backlight Control |
1 | 7-0 | Reserved | 0x00 |
2 | 6-0 | Level | 0-100 |
7 | Persistence Control | 0 - persistent | |
1 - non-persistent |
4.4 Suspend
The Suspend command puts the Touch Encoder into a low-power state. The device wakes up when it detects activity on the CAN bus.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0xF0 - Suspend |
1-? | * | Don't care | 0x00 |
4.5 Request Project Info
This command requests the brief project info from the Touch Encoder.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0xC3 - Project Info Request |
1-? | * | Don't care | 0x00 |
The result has the following format:
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0xC3 - Project Info |
1 | 7-0 | Project Type | 0x00 - GUIDE |
0x01 - GIIB (Legacy) | |||
2 | 31-0 | Checksum | CRC32 checksum of the project .zip file |
4.6 Live Update Request
The request initiates the software update. As part of the request, the host must specify the channel index to be used for further communication with the Touch Encoder. To learn more about the live update procedure, see our Live Update guide.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0x55 - Live Update Request |
1 | 7-0 | Component Type | 0 - Package |
3 - Project | |||
2 | 23-0 | Upload Size | File size in bytes |
5 | 7-0 | Channel Index | 1-8 |
4.7 Service Tool Authentication Request
This request initiates the service tool authentication session. As part of the request, the host must specify the channel index to be used for further communication with the Touch Encoder. To learn more, refer to Service Tool Authentication.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Command ID | 0x01 - Service Tool Authentication Request |
1 | 7-0 | Clearance | 1 - Service Tool |
2 | 7-0 | Channel Index | 1-8 |
5. GUIDE Notification
This section describes all notification types that can be stored in the GUIDE Notification entry (0x2003, sub-index 0x03). Apart from the screen and variable change notifications, we distinguish event notifications that are issued when a particular event occurs in context of a visual element.
5.1. Screen Change
This notification is generated whenever the current screen is changed. The notification data contains the new screen ID.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x01 - Screen Change |
1 | 7-0 | New Screen ID | 0x01-0xFF |
2-7 | * | Don't care | 0x00 |
5.2. Integer Variable Change
This notification is generated whenever an integer variable changes its value. The notification data contains the screen ID, variable ID and the new value of the variable.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x03 - Int Variable Change |
1 | 7-0 | Screen ID | 0x00-0xFF |
2 | 7-0 | Variable ID | 0x00-0xFF |
3 | 31-0 | New Value | 32-bit signed integer value |
5.3. String Variable Change
This notification is generated whenever a string variable changes its value. The notification data contains the screen ID, variable ID and the new value of the variable. If the string length exceeds 5 bytes, the value is truncated to 5 bytes, possibly in the middle of a UTF-8 code point. If the string is shorter than 5 bytes, it is padded with zeroes to fill the remaining bytes.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x04 - String Variable Change |
1 | 7-0 | Screen ID | 0x00-0xFF |
2 | 7-0 | Variable ID | 0x00-0xFF |
3-7 | * | New Value | UTF-8 string, truncated to 5 bytes |
5.4. Knob Event
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x10 - Knob Event |
1 | 7-0 | Element ID | 0x00-0xFF |
2 | 7-0 | Reserved | 0x00 |
3 | 16-0 | Encoder Delta | 16-bit signed integer value |
5.5. Touch Event
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x11 - Touch Event |
1 | 7-0 | Element ID | 0x00-0xFF |
2 | 7-0 | Type | 0 - Down |
1 - Move | |||
2 - Up | |||
3 - Enter | |||
4 - Leave | |||
3 | 2-0 | Contact ID | 0-7 |
7-3 | Reserved | 0x00 | |
4 | 15-0 | Contact X-coordinate | 16-bit signed integer value |
6 | 15-0 | Contact Y-coordinate | 16-bit signed integer value |
5.6. Gesture Event
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x12 - Gesture Event |
1 | 7-0 | Element ID | 0x00-0xFF |
2 | 7-0 | Type | 0 - Tap |
1 - Axis-aligned swipe | |||
3 | 31-0 | Gesture Data | See below for details |
Gesture Data varies depending on the value of Type. It is defined as follows:
Tap:
Byte
Bits
Description
Value
3
15-0
X
16-bit signed integer value
5
15-0
Y
16-bit signed integer value
Axis-aligned swipe:
Byte
Bits
Description
Value
3
1-0
Direction
0 - Up
1 - Dwn
2 - Left
3 - Right
7-2
Reserved
0x00
4
7-0
Reserved
0x00
5
15-0
Reserved
0x0000
5.7. Scene Event
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x13 - Scene Event |
1 | 7-0 | Element ID | 0x00-0xFF |
2 | 7-0 | Type | 0 - Input focus change |
1 - Visibility change | |||
3 | 31-0 | Data | See below for details |
Data varies depending on the value of Type. It is defined as follows:
Input focus change:
Byte
Bits
Description
Value
3
7-0
Input focus
0 - Focus gained
1 - Focus lost
4
7-0
Reserved
0x00
5
15-0
Reserved
0x0000
Visibility change:
Byte
Bits
Description
Value
3
7-0
Visibility
0 - Hidden
1 - Visible
4
7-0
Reserved
0x00
5
15-0
Reserved
0x0000
5.8. Failure
Failure notification is issued in response to a failed attempt to set the active screen or to modify a variable.
Byte | Bits | Description | Value |
---|---|---|---|
0 | 7-0 | Notification Type | 0x20 - Failure |
1 | 7-0 | Failure Type | 0x01 - Screen |
0x02 - Variable |