This function retrieves the digital state associated with the passed string. Only those digital states within the range of the passed point are checked.

C format

int32 pipt_digcodefortag (

int32 pt,

int32 PIPTR * digcode,

char PIPTR * digstring);





Point does not exist


Digital state string not found within range of tag


Point is not a digital tag


pt (passed)

Point number

digcode (returned)

Positive digital state code

Dig String (passed)

Digital state string; search is not case-sensitive.

Usage Notes

PI2 digital state strings are 12 characters long. Thus, only the first 12 characters of digstring will be used. PI3 uses all characters passed in digstring, which is limited to 79 characters plus a null terminator in the API.

PI3 systems will only search the state set specified in the point definition for the tag.

Enabling Operational Intelligence