In this example we will deal with a water tank,
which is a typical case of remote installation with needs for remote control
and immediate notification of the persons in charge if something goes wrong.
To implement the needed functionality we will use both the ready-made functions
and the "GAT Automation Language" provided by the GAT device.
The scenario of this application is as follows:
The tank is equipped with a level sensor
with voltage output in the range of 0,0 to 10,0V for water level in the range of 0,0 to 2,5m.
The sensor output is connected to Input #1 of the GAT device.
There is also a water pump used to fill the tank
and a drain valve, used for watering.
These two are controlled by the relay outputs of the GAT device.
The functionality provided is as follows:
-
The GAT device is used to measure the water level in the tank
and control the drain valve and filling pump,
according to some water level presets
which can be set by the administrator.
There are 3 water level presets:
* The level "Upper" is the maximum level
at which the filling pump stops working.
* The level "Fill" is lower than the level "Upper",
and is where the filling pump starts working.
* The level "Lower" is the minimum allowed water level
at which the GAT device will close the drain valve if it's open
and send to the administrator a warning message, like below:
2022/09/16,18:13:26
WATER-TANK #1 LEVEL:0.12m
WATER LEVEL LOW ! -
The adminstrator can setup / query the above mentioned water levels via messages.
The administrator can send a message to setup all three water levels, like below:
LEVEL
UPPER 240
FILL 160
LOWER 15
The above message sets the "Upper", "Fill" & "Lower" levels
to 2.40, 1.60 & 0.15 meters respectivelly.
The administrator can query the water level parameters,
by sending the following message:
LEVEL
The administrator can change only some of the water level parameters, like:
LEVEL FILL 160
In all cases, when the message is starting with the word "LEVEL",
the device answers with a message like below:
2022/09/06,18:14:21
WATER-TANK #1 LEVEL:1.25m
LEVEL SETUP:
UPPER=2.40m
FILL=1.60m
LOWER=0.15m - The administrator can control or query the pump automation state with messages.
He can activate the pump automation by sending the message:
PUMP AUTO ON
He can stop the pump automation by sending the message:
PUMP AUTO OFF
He can query the pump automation state by sending the message:
PUMP AUTO
In all cases, when the message is starting with the words "PUMP AUTO",
the device answers with a message like below:
2022/09/06,18:27:43
WATER-TANK #1 LEVEL:1.50m
PUMP AUTOMATION IS ON - The administrator can control or query the drain valve state with messages.
He can start watering, by sending the message:
DRAIN ON 15
With the above message the drain valve will open and stay so for 15 minutes.
This duration will be stored by the device as parameter.
After this, the administrator can send a message like:
DRAIN ON
and the device will open the drain valve again for 15 minutes.
The administrator can close the drain valve immediatelly, by sending the message:
DRAIN OFF
The administrator can query the current state of the drain valve, by sending the message:
DRAIN
In all cases, when the message is starting with the word "DRAIN",
when the valve is active the device answers with a message like:
2022/09/06,18:29:23
WATER-TANK #1 LEVEL:1.50m
DRAIN VALVE ON, duration: 5 minutes
and when the valve is off the device answers with a message like:
2022/09/06,18:30:34
WATER-TANK #1 LEVEL:1.50m
DRAIN VALVE OFF - The administrator is able to check the GAT device with an unanswered telephone call.
If the device is functioning properly, it will answer with a telephone call to the administrator.
The above descripted functionality is implemented with the following "GAT Application Program":
; Water-Tank example with Automation Program ;~ Telephone Numbers list with 1 clients ;~ Inputs ;~ Outputs ;~ Extras ;~ FPwizard end ;-------------------------------- M( ;Main module, executed every 10msec |
This application program is uploaded to the device with about 10 successive messages,
while it needs about 8 seconds to upload locally via USB and 2..3 minutes to upload via SMS to a remote device.
* * *
This application program is a demostration of the features of the GAT Automation Program,
which you can use as template for your application.