Digital State Sets and Bit Flags
a common data type encountered are Double Integers as bit flags, where different combinations of each bit of the binary representation of the double integer corresponds to a state. PI's Digital State Sets do not handle these well.
First, it requires that even unused states are created in the set . . . annoying, but not a total hindrance (there is another idea posted pertaining to this particularly)
Second, digital state sets have a maximum of 16383, which is only 14 bits, which is only sufficient for single integer (8 bit) flagging techniques.
JAMES VOLL commented
@Kenneth, in a bit flagging methodology the interger representation will be something like 0=None, 1=Run, 2=RunFwd, 4=RunRev, 8=Starting, 16=Stopping, 32=No Power, 64=Error, 128=Interlocked. This set of values is going to be different for different devices . . . uses are not going to be able to tell/remember what 8 means . . . it needs to be in a digital set.
The digital set will unfortunately contain 128 items in it even though only 9 values are being used.
We have numerous examples where a 16 bit method is being used (my above comment about being limited to 14 bits) . . . 16 bit example would be something like
-one Status out of 27 possibles Integer=655560 Bit Flags- 1010 0000 0000 1100 1000
Again a user is not going to really know/remember what 655560 means compared to the other 26 options
Kenneth Barber commented
Why do you need to use a digital state set? Why not an integer type?