Thursday, March 11, 2010

Contrasting implementers



It was an interesting week for BACnet questions. The first e-mail came from a former sales colleague asking about Multi-state objects (MSOs). He saw a display of somebody's MSO object showing a State_Text property as an array with elements 1 to 4, but with state values from 0 to 3. This didn't look right to him, and I confirmed that. In fact the standard itself says, "The Present_Value property shall always have a value greater than zero." (12.20.4, Present_Value)

Perhaps the language here is too vague if an implementer made this mistake (and it has happened before.) In this case, though, I know nothing about the software displaying this so I can only hope that maybe somebody had mis-programmed the display.

But the other e-mail painted quite a contrast. It noted that the author had difficulty understanding "9.5.6.5 DONE_WITH_TOKEN " in the MS/TP Master node machine, to wit:

At Page 89, the "SendToken" item, "If FrameCount is greater than or equal to Nmax_info_frames and TokenCount is less than Npoll-1 and SoleMaster is FALSE, or if NS is equal to (TS+1) modulo (Nmax_master +1)," , the last part, which I put underline, is difficult to understand for me. The expression confuses me logically. The "or" is refer to Which condition/conditions ?

Here the implementer is really trying to be careful. And I admit I have not looked at this state machine in years, so it took me a while to work it out. Finally I determined it was correct -- everything before the comma is one condition, what follows is another. (The test is to determine whether or not to send a Poll For Master frame -- if the Token hasn't been around Npoll times since the last poll OR if there is a Master node with a MAC address one higher than this node, don't poll.)

IMHO it's always better to ask if you're not certain; it's better than putting erroneous implementations in the field.

AND always have the device tested by a BACnet testing lab!

No comments:

Post a Comment