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.

Comapration of hours
#1
Hi

I am a little novice in this programming through lua.

I need to compare the current time with a specific time to start a device.

How can 3-byte communication objects be compared?

The code used but does not work for me is the following:


Code:
hora = grp.getvalue('33/0/1')--,dt.time)

log (hora)
value = grp.getvalue('33/1/21')--,dt.time)

log (value)

if hora == value then
  log ("esto funciona")
  total = hora + value
  log (total)
else
  log("ERROR")
end
 and I get the following error


Code:
Event for Hora Actual (33/0/1) 28.01.2020 16:00:34
* table:
[day]
  * number: 2
[minute]
  * number: 0
[second]
  * number: 0
[hour]
  * number: 0
[min]
  * number: 0
[sec]
  * number: 0
Event for Hora Actual (33/0/1) 28.01.2020 16:00:34
* table:
[day]
  * number: 2
[minute]
  * number: 0
[second]
  * number: 0
[hour]
  * number: 0
[min]
  * number: 0
[sec]
  * number: 0
Event for Hora Actual (33/0/1) 28.01.2020 16:00:34
* string: ERROR
Can someone please help me?

Thank you
Reply


Messages In This Thread
Comapration of hours - by juanbautista@domoviri.es - 28.01.2020, 15:02
RE: Comapration of hours - by Daniel - 28.01.2020, 15:28
RE: Comapration of hours - by Daniel - 28.01.2020, 17:10
RE: Comapration of hours - by Daniel - 28.01.2020, 18:48
RE: Comapration of hours - by admin - 28.01.2020, 18:59
RE: Comapration of hours - by admin - 29.01.2020, 08:10

Forum Jump: