Temperature Alarm with SMS
Ta treść nie jest jeszcze dostępna w Twoim języku.
In this example, a program is described that reads the temperature measured by OB-215, and when the temperature exceeds -15 degrees for more than 10 minutes, sends an SMS and starts logging the temperature values. In text 11 - MODBUS ID of the OB-215 device; 6 - address of the register from which the temperature is read.
!META* PROTOCOLVERSION 9# the program will run every 15 seconds* UPDATE 15
!DEVICES* * WRHANY 120 120* 11 WRHSINGLE 4
!PARAMS0 11 UINT16 H 6# alarm flag - temperature rise for more than 10 minutes1 * UINT16 H 5000# counter for a delay of 10 minutes2 * UINT16 H 5001
!VARS0 PARAMVAL P01 PARAMVAL P12 PARAMVAL P2# next counter value (15 seconds elapsed)3 VARADDVAL P2 15# temperature limit4 VAL -15# delay counter limit (10 * 60 = 600 seconds)5 VAL 600
!CONDS# temperature above the limit at -15?0 VARGRVAR V0 V4# temperature below the limit?1 NOT C0# the counter has reached the limit of 10 minutes?2 VARGEVAR V1 V53 NOT C2# increase the counter if it is not overfilled and the temperature is outside the limit?4 AND C0 C3# crash flag set?5 VARNEVAL V2 0
!STRS# SMS text into which the current and limit temperatures will be inserted0 OB-215 (11) – avaria, tmp *V0* > *V4*
!PHONES# below can be specified phone number for receiving SMS0 01234567
!ACTS0 PARAMWRVAL P1 01 PARAMWRVAL P2 02 PARAMWRVAL P1 13 PARAMWRVAR P2 V34 SENDSMS H0 S05 PARAMCOMMENT P0 S0
!REACTS* C1 REPEAT A0* C1 REPEAT A1* C2 REPEAT A2* C4 REPEAT A3* C5 ACT A4* C5 REPEAT A5#END