EXAMPLE 1 |
||
A flowmeter is connected to the pulse counter input 1 which yields 4600 impulses per liter. In variable memory 1 enter the expression that transforms the pulses acquired in the period (of 1 minute) into liters: V12=$P13/4600.0 MEMORY VARIABLE 1 ESPRESSION = PULSE COUNTER 1 PERIOD / 4600.0 In variable memory 2 enter the expression that transforms the total pulses into liters: V22=$P12/4600.0 MEMORY VARIABLE 2 ESPRESSION = PULSE COUNTER 1 TOTAL / 4600.0 At the incoming call of an active user, he hangs up the call without answering and composes an SMS message containing the current flow rate and total consumption data to be sent in response to the phone number of the last caller. |
||
|
|
CAE CALL FROM USER |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ATH |
|
|
AT+SMS=$N20,"$V11 l/min - $V21 liters total" |
|
|
|
|
|
|
|
|
|
|
trigger event is the receipt of a telephone call from an active user. The first action contains the command that hangs up the call. The second action contains the command that sends an SMS message to the number of the last caller (recalled with the TAG $N20) with the text: |
EXAMPLE 2 |
||
A flowmeter is connected to the pulse counter input 1 which yields 4600 impulses per liter. In variable memory 2 enter the expression that transforms the pulses acquired in the period (of 1 minute) into liters: V22=$P12/4600.0 MEMORY VARIABLE 2 ESPRESSION = PULSE COUNTER 1 TOTALI / 4600.0 We sold 10,000 liters of water to a farmer, so once the quantity purchased by the customer has been reached, shut-off the valve driven by output 2. |
||
|
|
V2 MEMORY VARIABLE 2 |
|
$V21>10000 MEMORY VARIABLE 2 VALUE > 99999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
out2=0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
trigger event is the change in value of variable 2. The first condition to check is that the delivered quantity of water defined in liters in variable 2 is greater than 99999. The first action turns output 2 off. |
||
The value of the total pulses counted is returned at the end of the |
EXAMPLE 3 |
||
A machine is connected to the COM port which periodically sends a string containing data on the working time of the components to ensure preventive maintenance: SPINDLE:354 var1=$D19#:2 MEMORY VARIABLE 1 EXPRESSION = 2nd PART OF LAST TEXT RECEIVED FROM CONSOLE SEPARATED BY ':' Extract the numeric data from the string and save it in the value of variable 1 to send an SMS message when the usage limit of 500 hours is reached. |
||
|
|
SCH**00 SCHEDULED AT **:00 |
|
$V11}500 MEMORY VARIABLE 1 VALUE } 500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AT+SMS=tec,"maintenance required: $V11 hours" |
|
|
|
|
|
|
|
|
|
|
|
|
|
TRIGGER EVENT occurs every hour at minute 00 (**00). The first condition to check is that the value of the variable V1 has exceeded 500. We use the threshold operator } because we want this condition to occur only the first time and not repeat at every subsequent hour, as would happen using the comparison operator >. The first action contains the command that sends all users belonging to the tec group a message similar to: |