OpenCAN

Last modified by Jett on 2024/10/23 20:40

OpenCAN

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

The protocol only use in the device have CAN pin.Such as PI8000 and PI3070i-A.

✎Note:Our J1939 protocol setting is similar to OpenCAN.If you need connect to J1939 device,please set the setting as OpenCAN.

HMI Settings

ItemsSettingsNote
ProtocolOPENCAN 
ConnectionCAN port 
Baud rate250000 

CAN frame setting in HMI

Click [OpenCAN setting] button in communication setting window;

12.PLC Protocol_html_e866b9e56e19785d.png

Click [Add] to create a new frame;

12.PLC Protocol_html_3a6f4e2141763c8f.png

NoItemsDescription
1Addadd a frame related to register address
2InsertSelect 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
3Frame managerThis list shows some of the main parameters for each frame that the user adds
4ModifyModify the frames in frame management
5CopyCopy one frame to another
6DeleteRemove 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.
7EmptyAll frames in the list are cleared
8BrowseDisplays configuration files in XML format in IE
9OKComplete the configuration of the frame and exit

Set CANBUS frame in setting windows

12.PLC Protocol_html_7c83130820321ef.png

NoItemsDescription
1IDSet the ID of a can frame in hexadecimal format;
2ID assignsplit the ID by PF, PS, and SA;
3Frame typeSelect Standard frame or Extended Frame;
4Frame formatSelect between data frame and remote Frame;
5DataSet 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;
6Use address

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;

Edit: Set a bit or word address by its format;

Option: Set address options related to frame, enter “register address option” interface, specifically browse the following “register address option” interface;

7Data interactive configurationThere 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;
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;
Feedback mode: feedback mode includes no response, confirm response and data response;
No response: the device or touch screen will not receive feedback;
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;
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;
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;
Response timeout: sets whether the response frame timeout;
8Control addressIf ticked, enable sending when the value of the corresponding control bit number (address) is non-0.
Control bit: CtrlBit register range 0~255, if the control bit is ON, can instruction will run normally. Otherwise, it doesn't run;
Manually send: a manually send tick indicates only one send;
9Flag configurationCommunication control for each frame. Display OFF when communication is normal, and ON when communication is abnormal;
10NoteFill the text to explain the meaning of the frame;
11Data assignPreview the display in this table based on the address and the corresponding number of digits;
12Current operation displayDisplay the description of current operation;
13AddAdd a new frame;
14Save frameSave the configured frame format;
15CancelCancel the frame configuration;

Set CAN address (Read or write operation);

12.PLC Protocol_html_7e9f9b25eb6ae8ce.png

No.ItemDescription
1Current addressDisplays the register type and register address set by the user in the data access interface
2TriggerTwo operations, "read" and "write," are based on on-screen registers
If "read" is selected, the register address is reading device data in a manner of sending frames set by the user in a loop.
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.
3Data operationThe read and write operations in the trigger conditions are set accordingly.
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.
If the trigger condition is a writing operation, there are two situations:
  • 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.
  • 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.
Position and length input formatIf 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.
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.
4AddAdd current configuration
5CloseClose the configuration window to exit

Multiple Packages Settings

12.PLC Protocol_html_107e0f6b1a90afff.png

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

Select Multiple package type

  • Not Multiple packages
  • J1939 Multiple packages
  • Customized Multiple packages

Click [Edit Receive data] for [Receive] settings

  • Start code+ Total length (J1939)

12.PLC Protocol_html_3c360c6b5aca51bf.png

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)

12.PLC Protocol_html_74496b2a68cfcdde.png

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)

12.PLC Protocol_html_98cea3e7cbd8f05d.png

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

  • Customized multiple package

12.PLC Protocol_html_4635bbe4d7999db0.png

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.

Click [Edit Send data] for [Send] setting

  • J1939

12.PLC Protocol_html_a4769e44331ca732.png

[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

12.PLC Protocol_html_78546f765d6f3deb.png

[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.

Cable Wiring

12.PLC Protocol_html_fccede84efcbdc22.png

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