How can I set an AFAttribute value to Null?

Discussion created by PIAdminUnison on Mar 31, 2014
Latest reply on Mar 31, 2014 by PIAdminUnison

Hi All,
I have an AFAttribute on an EventFrame template, which is set to be of type "Single".  The values I am placing in there are numeric, but sometimes the values for that attribute is Null coming from the field.  When I have a null value, I don't write to the attribute in my code, so it ends up with the default value of zero.  So here is my question.  What is the best way to store a value that is numeric 95% of the time but 5% it is null?  If it was a PI tag, I would use a system digital state for the null value, but because it has no Data Reference and expecting a single, I can't do this approach.  I was thinking maybe storing it as a string, but not sure if that is the best approach.  Any suggestions would be appreciated.