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.

Binary Alert Message
#1
Dear,

Perform a message alert for temperature and everything is perfect, as the example below:

Value = event.getvalue()
if Value <= 15 then
  Alarm_text = table.concat({'Tmep too low', Value, '°C'})
  alert(Alarm_text)
elseif Value <= 30 then
  Alarm_text = table.concat({'Tmep too high', Value, '°C'})
  alert(Alarm_text)
end


The problem is that I try to have an alert when the group address 0/4/2 is in logical value "1", making allusion that it is a failure of a bomb and it does not work for me, here I leave the program and the screen of the program , I hope you can help me.

value = event.getvalue()
if Value <= 1 then
  Alarm_text = table.concat({'TERMICO BOMBA 1'})
  alert(Alarm_text)
end


Greetings.

Attached Files Thumbnail(s)
   
Reply
#2
In second script you have two different variables: value and Value.
Reply
#3
if value is boolean, try one of these:
if value then
if not value then
or use true or false instead of 1 and 0
Reply
#4
(10.03.2017, 11:41)leondias Wrote: if value is boolean, try one of these:
if value then
if not value then
or use true or false instead of 1 and 0

thansks leondias, 

Make the change to true and work perfectly.

value = event.getvalue()
if value == true then
  Alarm_text = table.concat({'FALLA TERMICO BOMBA 1'})
  alert(Alarm_text)
end

regards

(10.03.2017, 06:53)admin Wrote: In second script you have two different variables: value and Value.

Change the "V" to "v" and change the "1" logic to true and work perfectly

thanks   Big Grin
Reply


Forum Jump: