Wiki source code of OpenCAN

Version 8.1 by Hunter on 2023/08/24 18:12

Show last authors
1 = {{id name="HOpenCAN"/}}**OpenCAN** =
2
3 OpenCan is based on CAN2.0 standard; OpenCAN protocols that could be configured autonomously to accept and send frames.
4
5 This protocol is only available in PI8000 series HMI.
6
7 **HMI Settings**
8
9 |**Items**|**Settings**|**Note**
10 |Protocol|OPENCAN|
11 |Connection|CAN port|
12 |Baud rate|250000|
13
14 **CAN frame setting in HMI**
15
16 Click [OpenCAN setting] button in communication setting window;
17
18 {{id name="I12.PLCProtocol_html_e866b9e56e19785d.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_9fa0e3a15fe03541.png||alt="12.PLC Protocol_html_e866b9e56e19785d.png" height="503" width="600"]]
19
20 Click [Add] to create a new frame;
21
22 {{id name="I12.PLCProtocol_html_3a6f4e2141763c8f.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_e45cfd2ef2eb8ad0.png||alt="12.PLC Protocol_html_3a6f4e2141763c8f.png" height="315" width="600"]]
23
24 |**No**|**Items**|**Description**
25 |1|Add|add a frame related to register address
26 |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
27 |3|Frame manager|This list shows some of the main parameters for each frame that the user adds
28 |4|Modify|Modify the frames in frame management
29 |5|Copy|Copy one frame to another
30 |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.
31 |7|Empty|All frames in the list are cleared
32 |8|Browse|Displays configuration files in XML format in IE
33 |9|OK|Complete the configuration of the frame and exit
34
35 Set CANBUS frame in setting windows
36
37 {{id name="I12.PLCProtocol_html_7c83130820321ef.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_db28b6546e2bdaf3.png||alt="12.PLC Protocol_html_7c83130820321ef.png" height="507" width="600"]]
38
39 |**No**|**Items**|**Description**
40 |1|ID|Set the ID of a can frame in hexadecimal format;
41 |2|ID assign|split the ID by PF, PS, and SA;
42 |3|Frame type|Select Standard frame or Extended Frame;
43 |4|Frame format|Select between data frame and remote Frame;
44 |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;
45 |6|Use address|(((
46 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;
47
48 **Edit:** Set a bit or word address by its format;
49
50 **Option: **Set address options related to frame, enter “register address option” interface, specifically browse the following “register address option” interface;
51 )))
52 |(% rowspan="8" %)7|(% rowspan="8" %)Data interactive configuration|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;
53 |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;
54 |Feedback mode: feedback mode includes no response, confirm response and data response;
55 |No response: the device or touch screen will not receive feedback;
56 |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;
57 |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;
58 |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;
59 |Response timeout: sets whether the response frame timeout;
60 |(% rowspan="3" %)8|(% rowspan="3" %)Control address|If ticked, enable sending when the value of the corresponding control bit number (address) is non-0.
61 |Control bit: CtrlBit register range 0~~255, if the control bit is ON, can instruction will run normally. Otherwise, it doesn't run;
62 |Manually send: a manually send tick indicates only one send;
63 |9|Flag configuration|Communication control for each frame. Display OFF when communication is normal, and ON when communication is abnormal;
64 |10|Note|Fill the text to explain the meaning of the frame;
65 |11|Data assign|Preview the display in this table based on the address and the corresponding number of digits;
66 |12|Current operation display|Display the description of current operation;
67 |13|Add|Add a new frame;
68 |14|Save frame|Save the configured frame format;
69 |15|Cancel|Cancel the frame configuration;
70
71 Set CAN address (Read or write operation);
72
73 {{id name="I12.PLCProtocol_html_7e9f9b25eb6ae8ce.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_3c2b23a39850a5bf.png||alt="12.PLC Protocol_html_7e9f9b25eb6ae8ce.png" height="446" width="600"]]
74
75 |**No.**|**Item**|**Description**
76 |1|Current address|Displays the register type and register address set by the user in the data access interface
77 |(% rowspan="3" %)2|(% rowspan="3" %)Trigger|Two operations, "read" and "write," are based on on-screen registers
78 |If "read" is selected, the register address is reading device data in a manner of sending frames set by the user in a loop.
79 |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.
80 |(% rowspan="5" %)3|(% rowspan="3" %)Data operation|The read and write operations in the trigger conditions are set accordingly.
81 |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.
82 |If the trigger condition is a writing operation, there are two situations:(((
83 * 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.
84 * 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.
85 )))
86 |(% rowspan="2" %)Position and length input format|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.
87 |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.
88 |4|Add|Add current configuration
89 |5|Close|Close the configuration window to exit
90
91 **Multiple Packages Settings**
92
93 {{id name="I12.PLCProtocol_html_107e0f6b1a90afff.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_3a7f30ae2fe9ae3e.png||alt="12.PLC Protocol_html_107e0f6b1a90afff.png" height="341" width="600"]]
94
95 Check [Multiple packages supported] to open [Multiple package data] window, as below show.
96
97 Select Multiple package type
98
99 * Not Multiple packages
100 * J1939 Multiple packages
101 * Customized Multiple packages
102
103 Click [Edit Receive data] for [Receive] settings
104
105 * Start code+ Total length (J1939)
106
107 {{id name="I12.PLCProtocol_html_3c360c6b5aca51bf.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_efec23bcbcc42ec3.png||alt="12.PLC Protocol_html_3c360c6b5aca51bf.png" height="340" width="426"]]
108
109 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;
110
111 * Start code + Data max length (J1939)
112
113 {{id name="I12.PLCProtocol_html_74496b2a68cfcdde.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_e0450564901bac01.png||alt="12.PLC Protocol_html_74496b2a68cfcdde.png" height="340" width="426"]]
114
115 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;
116
117 * Data max length (J1939)
118
119 {{id name="I12.PLCProtocol_html_98cea3e7cbd8f05d.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_9a0eaf954341bf3d.png||alt="12.PLC Protocol_html_98cea3e7cbd8f05d.png" height="340" width="426"]]
120
121 As set above set, J1939 command is received by the HMI, only when its length less than 50 bytes.
122
123 * Customized multiple package
124
125 {{id name="I12.PLCProtocol_html_4635bbe4d7999db0.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_67f78feb18459ef4.png||alt="12.PLC Protocol_html_4635bbe4d7999db0.png" height="395" width="367"]]
126
127 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.
128
129 Click [Edit Send data] for [Send] setting
130
131 * J1939
132
133 {{id name="I12.PLCProtocol_html_a4769e44331ca732.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_d2fa5717cc3349c4.png||alt="12.PLC Protocol_html_a4769e44331ca732.png" height="280" width="463"]]
134
135 [Data] is all data to be sent.
136
137 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.
138
139 * Customized multiple package
140
141 {{id name="I12.PLCProtocol_html_78546f765d6f3deb.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_f97dea6a36adf244.png||alt="12.PLC Protocol_html_78546f765d6f3deb.png" height="280" width="463"]]
142
143 [Data] is all data to be sent.
144
145 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.
146
147 **Cable Wiring**
148
149 {{id name="I12.PLCProtocol_html_fccede84efcbdc22.png"/}}[[image:xwiki_PIStudio_12.PLC+protocols_WebHome_da79ae27acf95368.png||alt="12.PLC Protocol_html_fccede84efcbdc22.png" height="111" width="391"]]
150
151 **✎Note:** The address interval between each frame need to be more than a word address;