Jump to content

Odd program behavior, possible IoP execution bug?


Recommended Posts

Posted (edited)

@Michel Kohanim

The program in question is below, it is one of a family of programs that decide what season it is out there. This is very old code, and has been executing uneventfully on the ISY for years. It has recently been moved to the Polisy.

The program itself is set as disabled and all the variables are non-state. The program is triggered to run 15 minutes after the hour, every hour, by another supervisor program. The situation is late night (in the 11pm to 5am timeframe), and our Spring time.

Variable values, these are all "integer" (not state) variables ...

$uu_Temperature = 1.8
$uu_Feels_Like = 1.8

These are from a weather station.

 

$sx_S_AM = 5   (top limit of "Spring" in this timeframe)
$sx_SF_AM = -3   (bottom limit of "Spring" in this timeframe)

These are constants, I have them in variables so they are easy to change, as they occur in other statements as well.

 

Time is in the 11pm to 5am timeframe.

 

Clearly the final OR statement is true, and the program should execute THEN. It doesn't. It has happened twice. I tried to run it manually, it went false and executed the ELSE. When all of the possible seasons execute ELSE, I get an alert, it means the system doesn't know what season it is, and that should never happen normally.

The first night I went in, made a trivial change to the program, saved it, and then went in and changed it back to the same and resaved it. So two saves, but the program code remained the same. On forcing that program to run again, it then ran normally and executed the THEN as expected! There was no temperature change in that time frame, or anything else.

 

I did something similar tonight. Once again when the statement was restored to exactly what it was (after two saves), it ran as expected.

That is hard to explain, unless there is some underlying system issue.

Or, perhaps it was just the passage of time, combined with an issue with the over midnight time block logic?

 

I bring it to your attention, and for comment.

* Orest

 

spring/fall.check - [ID 00AD][Parent 0038][Not Enabled]

If
        (
             From     5:00:00AM
             To      11:00:00AM (same day)
         And $uu_Temperature <= $sx_S_AM
         And $uu_Temperature > $sx_SF_AM
         And $uu_Feels_Like > $sx_SF_AM
        )
     Or (
             From    11:00:00AM
             To       5:00:00PM (same day)
         And $uu_Temperature <= $sx_S_Day
         And $uu_Temperature > $sx_SF_Day
         And $uu_Feels_Like > $sx_SF_Day
        )
     Or (
             From     5:00:00PM
             To      11:00:00PM (same day)
         And $uu_Temperature <= $sx_S_Eve
         And $uu_Temperature > $sx_SF_Eve
         And $uu_Feels_Like > $sx_SF_Eve
        )
     Or (
             From    11:00:00PM
             To       5:00:00AM (next day)
         And $uu_Temperature <= $sx_S_Night
         And $uu_Temperature > $sx_SF_Night
         And $uu_Feels_Like > $sx_SF_Night
        )
 
Then
        Wait  10 seconds
        $_season_spring_fall  = $xc_true
        $_season_spring_fall Init To $xc_true
        Run Program 'spring/fall.notify' (If)
 
Else
        $_season_spring_fall  = $xc_false
        $_season_spring_fall Init To $xc_false
 
 

 

Edited by oskrypuch
Posted (edited)

Is the program actually running Else or is your resultant flag just indicating it ran Else?

I wondered about your True/False constants. If they have lost their values.

What version of IoP are you running?

 

Edited by larryllix
Posted (edited)

That is a good point, if we are looking for something odd. The next time this happens, likely tonight, I will check the date stamps on the variables, to prove that the ELSE clause actually ran. The program itself does date stamp correctly.

But, because it would have been Spring/Fall on the prior running of the program, and subsequent to it running errantly Spring/Fall is false (all season states are false then), it does suggest the ELSE clause ran.

The true/false constants are initialized on startup:

$xc_true = -1

$xc_false = 0

and are used widely throughout many lines of code. They are never assigned any other value.

FWIW, I have five season states, Summer Hot, Summer, Spring/Fall, Winter, Winter Cold. These are set based on the outside temperature and the time of day, and checked once an hour. I then use those season variables in a variety of ways, in particular to run my thermostats. Because of their wide use, I monitor/alert the season states for validity, there can only be one set, and there must be one set, so I caught the issue immediately.

* Orest

Edited by oskrypuch
Posted (edited)

A little warmer today, so will likely hit Summer season state by the time we hit 11pm, if so,  it won't test out tonight.

All the observed temp variables are one digit precision. The limit constants on the temps were zero decimal precision, changed them to one digit decimal precision, just on spec. Just in case IoP is doing the comparisons differently, but that is a reach.

* Orest

Edited by oskrypuch
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...