Hoping for a nudge, I want to return tag data for a specific path. The example below works in the Designer. Tag paths are BasicTagPath
and values are BasicQualifiedValue
. But, when I bind the results (using script transform) in a custom prop within Perspective everything seems to lose their type. For example the value is not a QV, it is the actual value or None/null if bad quality.
results = [tag for tag in system.tag.browse(tagPath, {"valueSource":"opc", "recursive":True})]
What am I missing?
Anything assigned to a Perspective property is coerced into a type that is JSON compatible, or with a thin wrapper, because that's how they have to travel to the browser. And has been this way from day one.
This is one of the motivations for sessionVarMap()
, pageVarMap()
, and viewVarMap()
, as implemented in my Integration Toolkit module. You can bring values into Perspective through those maps, and the Perspective side will be coerced, but a script can retrieve the values in their original jython/java glory.
(Though, having the equivalent of page custom properties was also a consideration. Two birds with one stone, and all that.)
Hey Phil, just to make sure I'm understanding, BasicTagPath
and/or BasicQualifiedValue
are not JSON compatible types?
Thank you. Good info to know.