2 of 2 people found this helpful
You won't be able to output any String value to an attribute expecting a DateTime object, including whitespace such as " ". You could look at changing the value type of your output attribute to String, and then change your expression logic to convert the DateTime result of the FindEQ function to its string representation:
If(Capacity="Full") Then String((FindEq('Acid Level','*-36h','*', TagMax('Acid Level','*-36h','*')-0.04))) Else(" ")
Should you need to convert this string representation of date/time back to a DateTime object for use elsewhere in an Analysis, you can use the ParseTime() function.
3 of 3 people found this helpful
If you are unable to change the output tag type and want display a message you could use your original statement and output: Else DigState("No Sample")
That will force the tag to write a value from the "system" distal set.
John - Thanks for the suggestion! I ended up using the code you suggested with the use of the string() function. It ended up working for a couple of my tags, but for a different user defined tag the following is outputted to PI Visionwhen it outputs (correctly) the following in PI AF when I use the "evaluate" function
The value type is string because I converted the "then" output in the code to a string. Do you know why it would be converting the string time value to a numerical value?
1 of 1 people found this helpful
It looks like the PI Point type might not be a string. Can you confirm that PI Point is a string. The "Value Type" in AF is different than the PI Point type.