Перейти до вмісту

Hysteresis Control for TR-101

Цей контент ще не доступний вашою мовою.

In this example, the program controls the hysteresis value on the second channel of the TR-101 device, depending on the temperature on the sensor of the first input of EM-486. In the text 16 – MODBUS ID of the device is TR-101; 47 is the address of register for the hysteresis of the second channel TR-101.

The program uses registers in the field of current user settings 5500-5749. Registers 5500 and 5501 are reserved for the values respectively of the lower and upper temperature limits and the registers 5502 and 5503 are for the hysteresis value to be set in TR-101 if achieving the temperature respectively the lower or upper limits. These registers are read-only. To change them, you should be in configuration mode (see para. 5.3.4), then write the desired values to addresses of the respective editable settings. These addresses are obtained by subtracting 250 from the address current value. Thus, temperature limits are recorded into the registers 5250 and 5251, and the hysteresis – 5252 and 5253. Then, in order for the changes to take effect, you need to give the commands “Save” and “Apply” (for example by writing 4 to the register 120).

!META
* PROTOCOLVERSION 9
# program will run every 20 seconds
* UPDATE 20
* PARAMACTUAL 0
* PARAMLOADRATIO 50
!DEVICES
* * WRHANY 120 120
# TR-101 has MODBUS ID as 16 and can read no less than 100 registers per a query,
# but to record by one register per one query
* 16 WRHSINGLE 100
!PARAMS
# INT16 – registers with sign, as the temperature can be less than 0
0 * INT16 H 5500
1 * INT16 H 5501
2 * INT16 H 150
# UINT16 – as the hysteresis is no less than 0
3 * UINT16 H 5502
4 * UINT16 H 5503
5 16 UINT16 H 47
!VARS
# lower temperature limit
0 PARAMVAL P0
# upper temperature limit
1 PARAMVAL P1
# temperature value
2 PARAMVAL P2
# hysteresis for temperature below lower limit
3 PARAMVAL P3
# hysteresis for temperature above the upper limit
4 PARAMVAL P4
# hysteresis value
5 PARAMVAL P5
!CONDS
# is the temperature higher than the upper limit?
0 VARGEVAR V2 V0
# is hysteresis set for the desired value for the upper limit?
1 VAREQVAR V2 V1
# in other cases - do not change the hysteresis (current value)
2 CONDIS 1
!VARS
# the desired hysteresis is selected from V3 - V5, according to the conditions of C0 - C2
6 VARSSELBYC V3 C0
!CONDS
# is hysteresis set for the desired value?
3 VARNEVAR V5 V6
!ACTS
# record to TR-101 the new hysteresis
0 PARAMWRVAR P5 V6
!REACTS
* C3 REPEAT A0
# program is completed