Wiki source code of 11 PID Control Instruction

Version 1.2 by Iris on 2025/09/16 14:39

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