Ah, I'm trying to make a script that uses a temperature value and checks if this value is under or over a setpoint that is read from another GA.
If over or under then set alarm GA to true. else false. And I want a delay on sending that is adjustable so that any minor fluctuations are eliminated.
my code so far:
The thing is, that I have 2-300 values to check ?
If over or under then set alarm GA to true. else false. And I want a delay on sending that is adjustable so that any minor fluctuations are eliminated.
my code so far:
Code:
value = event.getvalue()
name = grp.find(event.dst).name
--
--
alarm_Hlim = string.gsub(name, '_PV', '_HAL')
alarm_Htag = string.gsub(name, '_PV', '_AHL')
alarm_Llim = string.gsub(name, '_PV', '_LAL')
alarm_Ltag = string.gsub(name, '_PV', '_ALL')
alarm_delay = string.gsub(name, '_PV', '_AD')
--
--
--High Alarm
if value > alarm_Hlim then
hAlarm == true
else
hAlarm == false
end
--
--
--Low Alarm
if value < alarm_Llim then
lAlarm == true
else
lAlarm == false
end
--Some delay
grp.write('alarm_Htag',hAlarm)
grp.write('alarm_Ltag',lAlarm)
The thing is, that I have 2-300 values to check ?