This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Get object name
#5
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:
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 ?
Reply


Messages In This Thread
Get object name - by tomnord - 04.06.2021, 08:35
RE: Get object name - by admin - 04.06.2021, 08:42
RE: Get object name - by tomnord - 04.06.2021, 09:19
RE: Get object name - by admin - 04.06.2021, 10:14
RE: Get object name - by tomnord - 04.06.2021, 11:33
RE: Get object name - by admin - 04.06.2021, 12:42
RE: Get object name - by tomnord - 04.06.2021, 12:49
RE: Get object name - by admin - 04.06.2021, 13:46

Forum Jump: