Point staling based on data quality from field device
- Last UpdatedApr 24, 2025
- 1 minute read
Protocol drivers set the isQuestionable flag in the hash_datum data structure before calling the krunch_data API. This applies to all protocol drivers that support field-driven questionable data quality.
/* Data structure for cacheing of all IOspec'ed items */
typedef struct hash_datum {
struct hash_datum *next; /* ptr to next item in list */
int rtu; /* Rtu slot number */
int dbnum; /* Database number */
int ptnum; /* Point number in database */
pntIOSpec iospec; /* Iospec for this point */
analogtype anatype;/* Analog input type */
rateintype intype; /* Rate input type (if rate) */
rateintype ratetype; /* Rate type (if RTYP_BOTH) */
unsigned char bitnum; /* Bit number in CMX status pnt */
unsigned char bitno; /* Bit # in rtu data word */
oas_boolean_t inremstat; /* is bit in RTU status word */
unsigned char bitwidth; /* # bits ( >0 if status bit) */
unsigned char straptype; /* strap type (used by tank) */
int usr1; /* for use by protocol r/w */
unsigned char usr2[16];/*for use by protocol r/w */
unsigned char usr3; /* for use by protocol r/w */
pntname usr4; // for application usage
internaltime lastKrunchTime; /* Time of last krunch*/
oas_boolean_t isQuestionable; //centerpoint bsap (BSAPFLG)
} hash_datum;
Sample Open Platform Communications (OPC) Protocol Driver for OASyS Code
if ((qualityFlag & OPC_QUALITY_MASK) == OPC_QUALITY_GOOD)
{
phdatum->isQuestionable = OAS_FALSE;
}
else
{
phdatum->isQuestionable = OAS_TRUE;
}