Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Latching triggers skip first event
I just assumed all fields would start in error state until they received their first value.  

Typically I create fields by calling SetFields in InitializeSerial.  Should I call SetAllErrStates immediately after SetFields?  Won't the fields briefly exist with default values (thus sending triggers and other possible weirdness)?  Maybe a new SetFields2 should create the fields in error state if you think that is the best route for compatibility reasons.

My fields typically don't get values until Poll is called as I assume the system generally handles the "field in error" state pretty well.  Some drivers could be modified to get values in connect, but it is still a while after the field was created via SetFields.  I suppose the FldDef object could have an initial value...

When do the fields actually get created?  SetFields?  After Connect returns Success?

Ugh -- Bob
Field can't be accessed by the outside world until the driver reports itself in connected state. So it doesn't matter until then. As long as you know you are setting all fields before then, you are good. SetAllErrStates() would just be a safety thing, so that, if you did forget one, it would show in error state instead of just having that default value.

The fields SHOULD have been started in error state. That was a mistake that goes back probably over a decade, and wasn't realized for a very long time. Now it becomes a possibly badly breaking change. So we'll have to slowly correct the drivers over time, using the msgs the drivers now log until they are all cleaned up. Then we can switch over to defaulting to initially in error.
Dean Roddey
Explorans limites defectum
OK, give 5.3.933 a try. I have a reasonably good feeling about this one. Which of course just completely jinxed it.
Dean Roddey
Explorans limites defectum
Okay, 933 seems to have fixed the first change after restart problem.  Yay!

Creating a new trigger still skips the first event, but I'm not overly concerned about that one.

Now just have to modify my drivers to get values before connect returns (or put fields in err state)…

Thanks -- Bob

Possibly Related Threads...
Thread Author Replies Views Last Post
  Event Monitors Dean Roddey 39 18,953 10-12-2015, 05:19 PM
Last Post: Dean Roddey
  RunTmplAction in OnLoad event of template? SamVimes2 5 3,001 09-08-2010, 05:00 AM
Last Post: froop
  change request for event code dialogs... bjkiller 4 2,520 04-07-2010, 02:10 PM
Last Post: bjkiller
  Bind a checkbox to an event's state? SamVimes2 1 1,725 02-13-2009, 06:39 PM
Last Post: Dean Roddey

Forum Jump:

Users browsing this thread: 1 Guest(s)