Wiki source code of CODESYS

Version 2.1 by Joe on 2026/03/19 09:46

Hide last authors
Joe 2.1 1 = CODESYS V3/WECON LX6C =
Wecon 1.1 2
Joe 2.1 3 Supported Series: LX6C Series, AC60 Series
Wecon 1.1 4
5 **HMI Settings**
6
7 |**Items**|(% style="width:426px" %)**Settings**|(% style="width:488px" %)**Note**
Joe 2.1 8 |Protocol|(% style="width:426px" %)CODESYS V3/ WECON LX6C|(% style="width:488px" %)
Wecon 1.1 9 |Connection|(% style="width:426px" %)Ethernet|(% style="width:488px" %)
10 |Port No.|(% style="width:426px" %)11740|(% style="width:488px" %)
11 |Username|(% style="width:426px" %) |(% style="width:488px" %)Need to be same as the PLC setting
12 |Password|(% style="width:426px" %) |(% style="width:488px" %)Need to be same as the PLC setting
13
14 {{info}}
15 ✎Note: CODESYS V3 protocol doesn't support online simulation.
16 {{/info}}
17
18 **How to import the tags**
19
20 * Program PLC_PRG;
21
22 (% style="text-align:center" %)
23 [[image:codesys2.png]]
24
25 * Add Symbol Configuration: Right click the Application, add Symbol Configuration into Device list;
26
27 (% style="text-align:center" %)
28 [[image:codesys1.png]]
29
30 * Check PLC_PRG and its tags, click Build, then click Generate Code;
31
32 (% style="text-align:center" %)
33 [[image:codesys3.png]]
34
35 * After generate successfully, a xml file would be generated inside the directory of the project;
36
37 (% style="text-align:center" %)
38 [[image:codesys4.png]]
39
Joe 2.1 40 * Create the HMI project and select the CODESYS V3~/~/WECON LX6C;
Wecon 1.1 41
42 (% style="text-align:center" %)
43 [[image:codesys5.png]]
44
Joe 2.1 45 (% style="text-align:center" %)
46 [[image:WECON LX6C.png]]
47
48
Wecon 1.1 49 * Configure the PLC IP and port number, enable or disable the username and password according to the actual situation;
50
51 (% style="text-align:center" %)
52 [[image:codesys6.png]]
53
54 * Import the xml file;
55
56 (% style="text-align:center" %)
57 [[image:codesys7.png]]
58
59 * After import successfully, the tags would show on the Tag Manager;
60
61 (% style="text-align:center" %)
62 [[image:codesys8.png]]
63
64 **Note:** If using the string data type, the length of the manipulation character in the PI software is the length of the string in the codesys software plus one.(The maximum length is 81)
65
66 (% style="text-align:center" %)
67 [[image:1740736152481-994.png]]
68
69 (% style="text-align:center" %)
70 [[image:1740736211615-727.png]]
71
72 **Support Variable Type**
73
74 |=Data Type|=(% style="width: 289px;" %)PIStudio Data Format|=(% style="width: 650px;" %)Range
75 |=BOOL|(% style="width:289px" %)Bit|(% style="width:650px" %)0~~1
76 |=BYTE|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
77 |=WORD|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
78 |=DWORD|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex |(% style="width:650px" %)0~~4294967295
79 |=SINT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-128~~127
80 |=USINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
81 |=INT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-32768~~32767
82 |=UINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
83 |=DINT|(% style="width:289px" %)32-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-2147483648~~2147483647
84 |=UDINT|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~4294967295
85 |=REAL|(% style="width:289px" %)32-bit Floating|(% style="width:650px" %)-3.402823466E+38~~3.402823466E+38
86 |=LREAL|(% style="width:289px" %)64-bit Double|(% style="width:650px" %)-1.7976931348623158E+308~~1.79769313 48623158E+308
87 |=DATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2106-02-07
88 |=TIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0D0H0M0S0MS~~49D17H2M47S295MS
89 |=LDATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2554-07-21
90 |=LTIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0NS~~213503D23H34M33S709MS551US615NS
91 |=DATE_AND_TIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-1-1-0:0:0~~2106-02-07-06:28:15
92 |=TIME_OF_DAY|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0:0:0~~23:59:59.999
93 |=STRING|(% style="width:289px" %)STRING|(% style="width:650px" %)