Wiki source code of CODESYS

Version 1.1 by Hunter on 2023/08/24 18:47

Hide last authors
Hunter 1.1 1 = CODESYS V3 =
2
3 Supported Series: LX6C Series, All PLC with CODESYS V3 Ethernet
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 **How to import the tags**
15
16 * Program PLC_PRG;
17
18 (% style="text-align:center" %)
19 [[image:codesys2.png]]
20
21 * Add Symbol Configuration: Right click the Application, add Symbol Configuration into Device list;
22
23 (% style="text-align:center" %)
24 [[image:codesys1.png]]
25
26 * Check PLC_PRG and its tags, click Build, then click Generate Code;
27
28 (% style="text-align:center" %)
29 [[image:codesys3.png]]
30
31 * After generate successfully, a xml file would be generated inside the directory of the project;
32
33 (% style="text-align:center" %)
34 [[image:codesys4.png]]
35
36 * Create the HMI project and select the CODESYS V3;
37
38 (% style="text-align:center" %)
39 [[image:codesys5.png]]
40
41 * Configure the PLC IP and port number, enable or disable the username and password according to the actual situation;
42
43 (% style="text-align:center" %)
44 [[image:codesys6.png]]
45
46 * Import the xml file;
47
48 (% style="text-align:center" %)
49 [[image:codesys7.png]]
50
51 * After import successfully, the tags would show on the Tag Manager;
52
53 (% style="text-align:center" %)
54 [[image:codesys8.png]]
55
56 **Support Variable Type**
57
58 |=Data Type|=(% style="width: 289px;" %)PIStudio Data Format|=(% style="width: 650px;" %)Range
59 |=BOOL|(% style="width:289px" %)Bit|(% style="width:650px" %)0~~1
60 |=BYTE|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
61 |=WORD|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
62 |=DWORD|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex |(% style="width:650px" %)0~~4294967295
63 |=SINT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-128~~127
64 |=USINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~255
65 |=INT|(% style="width:289px" %)16-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-32768~~32767
66 |=UINT|(% style="width:289px" %)16-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~65535
67 |=DINT|(% style="width:289px" %)32-bit Signed/Binary/BCD/Hex|(% style="width:650px" %)-2147483648~~2147483647
68 |=UDINT|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0~~4294967295
69 |=REAL|(% style="width:289px" %)32-bit Floating|(% style="width:650px" %)-3.402823466E+38~~3.402823466E+38
70 |=LREAL|(% style="width:289px" %)64-bit Double|(% style="width:650px" %)-1.7976931348623158E+308~~1.79769313 48623158E+308
71 |=DATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2106-02-07
72 |=TIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0D0H0M0S0MS~~49D17H2M47S295MS
73 |=LDATE|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)1970-01-01~~2554-07-21
74 |=LTIME|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0NS~~213503D23H34M33S709MS551US615NS
75 |=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
76 |=TIME_OF_DAY|(% style="width:289px" %)32-bit Unsigned/Binary/BCD/Hex|(% style="width:650px" %)0:0:0~~23:59:59.999
77 |=STRING|(% style="width:289px" %)STRING|(% style="width:650px" %)