# 11.18 OpenCAN

OpenCan is based on CAN2.0 standard; OpenCAN protocols that could be configured autonomously to accept and send frames.

This protocol is only available in PI8000 series HMI.

**HMI settings**

| **Items**  | **Settings** | **Note** |
| ---------- | ------------ | -------- |
| Protocol   | OPENCAN      |          |
| Connection | CAN port     |          |
| Baud rate  | 250000       |          |

**CAN frame setting in HMI**

1\) Click \[OpenCAN setting] button in communication setting window;

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9IvOTkO_ETy8fuZ%2F0.png?generation=1575525853651781\&alt=media)

2\) Click \[Add] to create a new frame;

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9IwPZTY--U7enPA%2F1.png?generation=1575525853647418\&alt=media)

| **No** | **Items**     | **Description**                                                                                                                                          |
| ------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1      | Add           | add a frame related to register address                                                                                                                  |
| 2      | Insert        | Select the position where you want to insert a frame, and click \[Insert frame] to add a new frame in front of the current frame position                |
| 3      | Frame manager | This list shows some of the main parameters for each frame that the user adds                                                                            |
| 4      | Modify        | Modify the frames in frame management                                                                                                                    |
| 5      | Copy          | Copy one frame to another                                                                                                                                |
| 6      | Delete        | Remove the selected frames from the list by modifying the frames in frame management. If no frames are selected in the list, the first frame is deleted. |
| 7      | Empty         | All frames in the list are cleared                                                                                                                       |
| 8      | Browse        | Displays configuration files in XML format in IE                                                                                                         |
| 9      | OK            | Complete the configuration of the frame and exit                                                                                                         |

3\) Set CANBUS frame in setting windows

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9Ix6l-KtkqD6z2i%2F4.png?generation=1575525853638265\&alt=media)

| **No** | **Items**                      | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1      | ID                             | Set the ID of a can frame in hexadecimal format;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 2      | ID assign                      | split the ID by PF, PS, and SA;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| 3      | Frame type                     | Select Standard frame or Extended Frame;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| 4      | Frame format                   | Select between data frame and remote Frame;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 5      | Data                           | Set the data part of CAN frame, with two Numbers representing a hexadecimal number and Spaces spaced; Maximum support of 8 bytes is defined according to CAN message;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 6      | Use address                    | <p>Set the register address related to the CAN frame, which corresponds to the register address set on the main state one by one. The data obtained from the address is assigned continuously;</p><p><strong>Edit:</strong> Set a bit or word address by its format;</p><p><strong>Option:</strong> Set address options related to frame, enter “register address option” interface, specifically browse the following “register address option” interface;</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| 7      | Data interactive configuration | <p>There are two interactive modes of the touch screen. One is that the touch screen actively sends frames, and the device receives and processes and feeds back. The other, on the contrary, passively receives frames from the device for processing and feedback;</p><p>Send after receiving: if this item is selected, the interaction of the touch screen will act as a passive party, and the touch screen will receive the CAN frame first and send feedback. Unchecked items interact in the opposite way;</p><p>Feedback mode: feedback mode includes no response, confirm response and data response;</p><p>No response: the device or touch screen will not receive feedback;</p><p>Confirm response: the device or the touch screen will receive feedback with confirmation, which could be used to compare the data parts. If this function is used, the 20 addresses before and after this address should not be used. All addresses of cata10-cata30 could not be used with the reply confirmation function of cata20;</p><p>Data response: the device or touch screen will receive feedback with data, and the data to be separated from the feedback frame should be set to store in the register address;</p><p>response ID: if the address wants to receive data on a frame with a different ID, set this, check "different from sender", and enter a different ID in the following input box. Without this setting, the screen will receive and process a frame with the same ID as the sender;</p><p>Response timeout: sets whether the response frame timeout;</p> |
| 8      | Control address                | <p>If ticked, enable sending when the value of the corresponding control bit number (address) is non-0.</p><p>Control bit: CtrlBit register range 0~255, if the control bit is ON, can instruction will run normally. Otherwise, it doesn't run;</p><p>Manually send: a manually send tick indicates only one send;</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 9      | Flag configuration             | Communication control for each frame. Display OFF when communication is normal, and ON when communication is abnormal;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 10     | Note                           | Fill the text to explain the meaning of the frame;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| 11     | Data assign                    | Preview the display in this table based on the address and the corresponding number of digits;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 12     | Current operation display      | Display the description of current operation;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| 13     | Add                            | Add a new frame;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 14     | Save frame                     | Save the configured frame format;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 15     | Cancel                         | Cancel the frame configuration;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

4\) Set CAN address (Read or write operation);

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9IyBlhUq4KMn_NO%2F5.png?generation=1575525853653685\&alt=media)

| **No.** | **Item**                         | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1       | Current address                  | Displays the register type and register address set by the user in the data access interface                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 2       | Trigger                          | <p>Two operations, "read" and "write," are based on on-screen registers</p><p>If "read" is selected, the register address is reading device data in a manner of sending frames set by the user in a loop.</p><p>If "write" is selected, the screen data of the register address will be written into the device. The writing mode is that the user makes a write operation on the screen, which will trigger the sending of a frame set by the user.</p>                                                                                                                                                                                                                                                                                                                                               |
| 3       | Data operation                   | <p>The read and write operations in the trigger conditions are set accordingly.</p><p>If the trigger condition is a read operation, this section needs to set the position and length of the data to be obtained at the current address in the frame.</p><p>If the trigger condition is a writing operation, there are two situations:</p><p> If the "add writing data to the frame" option is not selected, the frame set by the user will be sent directly when the user writes on the screen.</p><p> Select the "add the written data to the frame" option, and when the user writes on the screen, the program will insert the data in the frame set by the user and send the written data to the frame set by the user according to the data insertion position and length set by the user.</p> |
| 3       | Position and length input format | <p>If the register type is a bit address, the decimal point is required to represent the bits in the byte. For example, 1.1 represents the first bit of the first byte of 8 bytes in the data frame, and the length is in bits, and so on.</p><p>If the register type is word address, the integer only needs to represent the byte, such as 1, which represents the first byte of 8-byte data in the data frame, and the unit of length is byte, and so on.</p>                                                                                                                                                                                                                                                                                                                                       |
| 4       | Add                              | Add current configuration                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 5       | Close                            | Close the configuration window to exit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

**Multiple packages settings**

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9Izz-C4ekVIIpoo%2F6.png?generation=1575525853693406\&alt=media)

1\) Check \[Multiple packages supported] to open \[Multiple package data] window, as below show.

2\) Select Multiple package type

 Not Multiple packages

 J1939 Multiple packages

 Customized Multiple packages

3\) Click \[Edit Receive data] for \[Receive] settings

 Start code+ Total length (J1939)

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J-9NcTnOFxjjGY%2F7.png?generation=1575525853695346\&alt=media)

As set above set, J1939 command is received by the HMI, only when its length is 25 bytes, and the start code is 0x57, 0x1B;

 Start code + Data max length (J1939)

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J0OHdmomWq2S1y%2F8.png?generation=1575525853640810\&alt=media)

As set above set, J1939 command is received by the HMI, only when its length less than 50 bytes, and the start code is 0x57, 0x1B;

 Data max length (J1939)

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J1Q3AX341S9-_0%2F9.png?generation=1575525853665282\&alt=media)

As set above set, J1939 command is received by the HMI, only when its length less than 50 bytes.

 Customized multiple package

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J2B567Qvz0gtrk%2F10.png?generation=1575525853711398\&alt=media)

As set above, It is received by the HMI, when the first frame starts with 0X57 0X1B, and the sum of the data lengths of multiple frames is equal to 79 bytes.

4\) Click \[Edit Send data] for \[Send] setting

 J1939

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J3Gf-VSBDWYQNc%2F11.png?generation=1575525853639748\&alt=media)

\[Data] is all data to be sent.

Since the frame of the J1939 frame contains the number of the data packet, so the data sent is: the first byte (number) + 7 bytes of data. If it is less than 7 bytes, it is sent in the actual number of bytes.

 Customized multiple package

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J4Lu8yf7s-DgXH%2F12.png?generation=1575525853636715\&alt=media)

\[Data] is all data to be sent.

As set above, fist frame length is 2 bytes, and others are sent with 6 bytes for every frame, if the last frame is less than 6 bytes, send according to the actual length.

**Communication cable**

![](https://3950998874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpi-series-user-manual%2F-LvJcqGbIvY9B8CCKvWL%2F-LvJe9J5TIINh82eSxYt%2F13.png?generation=1575525853680371\&alt=media)

✎**Note:**

The address interval between each frame need to be more than a word address;
