Wiki source code of CODESYS

Last modified by Molly on 2025/02/28 17:50

Show last authors
1 = CODESYS V3 =
2
3 Supported Series: LX6C Series
4
5 **HMI Settings**
6
7 |**Items**|(% style="width:426px" %)**Settings**|(% style="width:488px" %)**Note**
8 |Protocol|(% style="width:426px" %)CODESYS V3|(% style="width:488px" %)
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
40 * Create the HMI project and select the CODESYS V3;
41
42 (% style="text-align:center" %)
43 [[image:codesys5.png]]
44
45 * Configure the PLC IP and port number, enable or disable the username and password according to the actual situation;
46
47 (% style="text-align:center" %)
48 [[image:codesys6.png]]
49
50 * Import the xml file;
51
52 (% style="text-align:center" %)
53 [[image:codesys7.png]]
54
55 * After import successfully, the tags would show on the Tag Manager;
56
57 (% style="text-align:center" %)
58 [[image:codesys8.png]]
59
60 **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)
61
62 (% style="text-align:center" %)
63 [[image:1740736152481-994.png]]
64
65 (% style="text-align:center" %)
66 [[image:1740736211615-727.png]]
67
68 **Support Variable Type**
69
70 |=Data Type|=(% style="width: 289px;" %)PIStudio Data Format|=(% style="width: 650px;" %)Range
71 |=BOOL|(% style="width:289px" %)Bit|(% style="width:650px" %)0~~1
72 |=BYTE|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
73 |=WORD|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
74 |=DWORD|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex |(% style="width:650px" %)0~~4294967295
75 |=SINT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-128~~127
76 |=USINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
77 |=INT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-32768~~32767
78 |=UINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
79 |=DINT|(% style="width:289px" %)32-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-2147483648~~2147483647
80 |=UDINT|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~4294967295
81 |=REAL|(% style="width:289px" %)32-bit Floating|(% style="width:650px" %)-3.402823466E+38~~3.402823466E+38
82 |=LREAL|(% style="width:289px" %)64-bit Double|(% style="width:650px" %)-1.7976931348623158E+308~~1.79769313 48623158E+308
83 |=DATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2106-02-07
84 |=TIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0D0H0M0S0MS~~49D17H2M47S295MS
85 |=LDATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2554-07-21
86 |=LTIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0NS~~213503D23H34M33S709MS551US615NS
87 |=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
88 |=TIME_OF_DAY|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0:0:0~~23:59:59.999
89 |=STRING|(% style="width:289px" %)STRING|(% style="width:650px" %)