Chapter 6 Applied Instructions
6-175
Device number
Function
range
Description
MV
REAL
MV
The MV is withing the range
between the MV_MIN and
the MV_MAX.
Example:
1. Before the instruction PID is executed, the setting of the parameters should be complete.
2. When X0.0 is ON, the instruction is executed. When M1 is ON, the PID algorithm is
implemented. When M1 is OFF, the MV is 0, and the MV is stored in D200. When X0.0 is
switched OFF, the instruction is not executed, and the previous data is unchanged.
Additional remark:
1. The instruction can be used several times, but the registers specified by I_MV~I_MV+5 can
not be the same.
2. I_MV occupies 12 registers. I_MV used in the instruction PID in the above example occupies
D122~D133.
3. The instruction PID only can be used in the cyclic task and the interval interrupt task. When the
instruction PID is used in the interval interrupt task, the sampling time is the same as the
interval between the timed interrupt tasks.
4. When the instruction is scanned, the PID algorithm is implmented according to the sampling
time, and the MV is refreshed. When the instruction is used in the interrupt task, the sampling
time is the same as the interval between the timed interrupt tasks. The PID algorithm is
implemented according to the interval between the timed interrupt tasks.
5. Before the PID algorithm is implemented, the process value used in the instruction PID has to
be a stable value. When users need the input value in the module to implement the PID
algorithm, they have to notice the time it takes for the analog input to be converted into the
digital input.
The PID algorithm:
1. When PID_MODE is set to 0 or 2, the PID control mode is the automatic control mode.
2. When PID_MODE is set to 1, the PID control mode is the automatic tuning mode. After the
tuning of the parameter is complete, PID_MODE is set to 0. The PID control mode becomes
the automatic control mode.