Jump to content

Issue with TimeData node causing logic to be executed twice in specific edge conditions.


Recommended Posts

The problem is an edge condition where the logic is invoked TWICE (should only be once) if, and only if, the minute being checked is 59 AND another test accompanies it to verify that the hour is not 23.

I setup four test to verify this (see attached Test.jpg, Test1.jpg, Test2.jpg, Test3.jpg) two of the tests trigger at two minutes before the hour and they both work properly.  The other two tests trigger at one minute before the hour and one of these fails (see attached Test2.jpg)

You can see this in the attached Results.jpg file.  All variables in the attached Results.jpg file were initialized to zero before running this test.  Notice how variable TEST2 was incremented TWICE, and the last modified time is 12:00:07.  TEST2 was incremented once at 11:59:07, and then again at 12:00:07.  This should not be happening in my opinion.

Results.jpg

Test.jpg

Test2.jpg

Test3.jpg

Test4.jpg

Link to comment

While I can replicate this phenomenon, I am not clear on why it is happening.  In checking both the code and my local logs, the Node Server only updates the minute value once each time the minute changes.  I can't explain why the program is triggered on the 00 minute of the next hour.  Try reversing the order of the hour and minute conditions in the program and see if it makes any difference. Also, you can try changing your shortPoll value to 60 from the default of 30.

 

:

Link to comment

I'm glad that you are able to reproduce the problem.  I have reported it so that it can be resolved and avoid this issue for other users.  I have already fixed the problem I was having by triggering on 'minutes' = '58' (instead of '59) which works just as well for what I need.  Please take as much time as you need to resolve this issue - it is not holding me up at this time.

Link to comment
17 hours ago, AGinsburg01 said:

I'm glad that you are able to reproduce the problem.  I have reported it so that it can be resolved and avoid this issue for other users.  I have already fixed the problem I was having by triggering on 'minutes' = '58' (instead of '59) which works just as well for what I need.  Please take as much time as you need to resolve this issue - it is not holding me up at this time.

It turns out, after running your sample program overnight, that it doesn't replicate this every hour, only periodically, with no pattern I can discern.  I'm thinking it has something to do with timing related to when the Node Server was started (how close to the change of the actual minute), which then may cause some logic confusion in the ISY.  There is nothing in the Node Server code that would make it trigger differently from one minute to the next, nor is there any dependency on the hour changing.  

Are you able to use the built-in time/date functions of the ISY for this?  The Node Server only changes the display of the minute on the next shortPoll after the minute actually changes, which may be up to 59 seconds late, depending upon when in the minute the Node Server was last started.

Link to comment

That is interesting that it does not occur every hour, I had assumed it would because all of my (albeit limited) testing showed it to occur every time.

It is certainly possible that it is some sort of interaction with the ISY, or possibly a bug in the ISY itself.  If so, it is quite possible that it may be causing issues in all nodes (not just TimeData.)   If you believe that it is this sort of "tip of the iceberg" issue, I suggest possibly escalating this up to the Universal Devices support team to see if they can help track it down.

To answer your question, I am not aware of any ISY built-in time/date functions.  They only support comparing a full time/date value, not a piece of the value.  This is why Michel (UD support) recommended your TimeData node to me years ago.  Until this moment it has been working perfectly for me.

Link to comment

Thanks, that is a great idea!  I originally started using the TimeData node MANY years ago with the ISY994.  At that time, these system variables did not exist, and I was directed to use the TimeData node - which has been working great for all these years.

I never realized these were now available in the system!  I will definitely give these a try.

Link to comment

It appears to me that the system time values can be used as RValues only.  In other words, it doesn't appear that I could do something like the following:

    if [Current Minute] is 0 minute

In order to do this using, the method you described, I would have to setup a program that runs every minute and assign the system minute value to a variable which I could then use.  But in order to do this I would need an event that updates every minute - which is what the TimeData node provides.  So, this is a chicken and egg situation.

I can see where this works for you because you are using time values that only change once a day, so you can trigger on a specific time of day and update the variables.

Unless I'm missing something, and you can use these system time values as LValues, I think I'm better off sticking with the TimeData node.

Link to comment

I sent right when you did.  I see now.  Impressive.  

I may be out of my lane in this, but why couldnt you assign minutes to your variable using below screen shot.  Then use counters to calculate.

Granted it probably could be done programmatically in ISY/eisy, but much easier using Timedata.

Screenshot 2023-07-16 152925.jpg

Link to comment

Yes, you could do something like that.  However, this is basically recreating logic that is already built into the TimeData node.  Since I have been using TimeData successfully for over a decade now, it would be my preference for the author to simply resolve this issue.  This is undoubtedly affecting other TimeData users as well (I can't imagine I'm the only user!)

Additionally, I use other nodes as well, and am concerned that this may be a deeper issue in the node framework that could affect other nodes I use.  So, I would prefer that the actual problem is tracked down and resolved so it doesn't affect other users or nodes.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...