Perspective - best way to transform two or more properties (avoiding script transform)

I am using Ignition 8.1.50 with Perspective module.

I know that in transforms is better to use map/expressions rather than scripts, but I want to understand if is possible to create a logic like this without a script transform

So basically whenever one of the two properties change, the transform logic will be evaluated to produce the result.

Thanks

A nested if expression should work. Expressions re-evalutate if any of the referenced items change value.

if(
	{view.params.FamilyName} = "", "none", 
if(
	{view.params.Available}, "solid", 
	"dashed"
))

If everything you are monitoring is a boolean, you can use binEnc and a case statement to make it a bit cleaner.

5 Likes

You can also use an outlandish form of case. it works and is less characters than nexted ifs:

case(True
	,{view.params.FamilyName} = "", "none"
	,{view.params.Available}, "solid"
	,"dashed"
)
3 Likes