Wiki source code of 11 PID Control Instruction

Version 2.1 by Iris on 2025/09/17 17:54

Hide last authors
Iris 2.1 1 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|(((
2 **Offset**
3
4 **modification**
5 )))|(((
6 **Pulse**
7
8 **extension**
9 )))
10 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
11 |(% rowspan="4" %)PID|Parameter 1| | | | | | | | | | | | | | | | |●|●|●| | | | | | |
12 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | | |
13 |Parameter 3| | | | | | | | | | | | | | | | |●|●|●| | | | | | |
14 |Parameter 4| | | | | | | | | | | | | | | | |●|●|●| | | | | | |
15
Wecon 1.1 16 == **PRUN/Octal digit transmission (16-bit data)** ==
17
18 ----
19
20 PRUN(P)
21
22 After processing the device numbers of (s) and (d) with specified digits as octal numbers, transfer the data.
23
24 -[PRUN (s) (d)]
25
26 Content, range and data type
27
28 |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)**|=**Custom variable type**
29 |(s)|Digit specification*1|-|BIN16 bit|ANY16|~-~-
30 |(d)|Transfer target device number*1|-|BIN16 bit|ANY16|~-~-
31
32 Device used
33
Iris 1.2 34 |=(% style="width: 64px;" %)**Instruction**|=(% style="width: 128px;" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=**Pulse expansion**
35 |(% style="width:64px" %) |(% style="width:128px" %) |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|(% style="width:32px" %)**HSC(bit)**|(% style="width:94px" %)**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|(% style="width:41px" %)**SD**|(% style="width:42px" %)**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
36 |(% colspan="1" rowspan="2" style="width:64px" %)PRUN|(% style="width:128px" %)Parameter 1| | | | | | | | |(% style="width:32px" %) |(% style="width:94px" %) |●| |●| | | | | |(% style="width:41px" %) |(% style="width:42px" %) | | | | |●|●
37 |(% style="width:128px" %)Parameter 2| | | | | | | | |(% style="width:32px" %) |(% style="width:94px" %) | |●|●| | | | | |(% style="width:41px" %) |(% style="width:42px" %) | | | | |●|●
Wecon 1.1 38
39 Function
40
41 • Octal digit device→ decimal digit device
42
43 (% style="text-align:center" %)
44 [[image:1709790843788-781.png]]
45
46 • Decimal digit device → octal digit device
47
48 (% style="text-align:center" %)
49 [[image:1709790863850-104.png]]
50
51 Error code
52
53 |=**Error code**|=**Content**
54 |4085H|When the specified device range for reading exceeds the range of the corresponding device
55 |4086H|When the specified device range for writing exceeds the range of the corresponding device
56
57 Example
58
59 (% style="text-align:center" %)
60 [[image:1709790902188-165.png]]
61
62 As shown in the above ladder diagram: X0~~X17 takes the value of octal digits and pass it to the devices corresponding to M.
63
64 (% style="text-align:center" %)
65 [[image:1709790924438-346.png]]
66
67
68 == **TRH/Wet and dry bulb temperature and humidity conversion** ==
69
70 ----
71
72 [[image:file:///C:\Users\ADMINI~~1\AppData\Local\Temp\ksohtml13328\wps3.png]]TRH
73
74 This command completes the conversion of dry bulb temperature, wet bulb temperature and corresponding humidity.
75
76 -[TRH (d1) (s) (d2) (n)]
77
78 Content, range and data type
79
80 |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)**|=**Custom variable type**
81 |(d1)|Humidity|0~~100|Single-precision floating point|ANYREAL_32|REAL
82 |(s)|Dry bulb temperature|-|Single-precision floating point|ANYREAL_32|REAL
83 |(d2)|Wet bulb temperature|-|Single-precision floating point|ANYREAL_32|REAL
84 |(n)|Mode|0 to 1|Signed BIN 32 bit|ANY32|DINT
85
86 Device used
87
88 |=**Instruction**|=**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=**Pulse expansion**
89 | | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
90 |(% colspan="1" rowspan="4" %)TRH|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
91 |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
92 |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
93 |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|
94
95 Function
96
97 There are two modes to choose from (n):
98
99 Mode 0: Calculate the corresponding humidity by wet bulb temperature and dry bulb temperature.
100
101 Mode 1: Calculate the corresponding wet bulb temperature by dry bulb temperature and humidity.
102
103 The conversion process formula is as follows:
104
105 Assuming that the wet bulb temperature is A, the dry bulb temperature is B, and the corresponding current humidity is C, which meet the following conditions:
106
107 (% style="text-align:center" %)
108 [[image:1709791199711-348.png||height="101" width="342"]]
109
110
111 Precautions
112
113 ·The wet bulb temperature is not greater than the dry bulb temperature. When they are the same, the humidity reaches the maximum value 100%.
114
115 ·The unit of dry and wet bulb temperature is (^^o^^C).
116
117 ·The general value range of dry bulb is between 0~~100^^o^^C, and the command does not judge its range, so pay special attention when using this command.
118
119 Error code
120
121 |=**Error code**|=**Content**
122 |(% rowspan="4" %)4084H|When the value specified in (n) exceeds the following range. 0 to 1
123 |The value specified in (d1) exceeds the following range. 0 to 100
124 |A negative value is specified in (s).
125 |A negative value is specified in (d2).
126 |4085H|The output result of (d1)(s)(d2)(n) in the read application command exceeds the device range.
127 |4086H|The output result of the write application command (d1) and (d2) exceeds the device range.
128
129 Example
130
131 (% style="text-align:center" %)
132 [[image:1709791591456-917.png]]
133
134 Dry and wet bulb temperature/humidity conversion table
135
136 (% style="text-align:center" %)
137 [[image:1709791607332-438.png]]