Hello!
I'm new to Ignition, and I'm working on my first project with it. I'm attempting to use Perspective to design an HMI for a simple project. As part of this HMI, I want each device/sensor on the HMI to display a special indicator in the event of an alarm. I'd like this indicator to dynamically change based on the priority of the associated alarm, as seen in The High Performance HMI Handbook:
I've created and uploaded the desired icons to my gateway, and I can use them in the designer without issue:
I have this view which serves as a motor faceplate, with a parameter for motor name. I tried using an expression binding to dynamically change the path of the icon based on the highest priority alarm on the given motor. The following expression does not work:
EDIT
This is the case statement format provided kindly by @ michael.flagler. Unfortunately, it still does not work, and returns a 'Bad_NotFound' error.
case(true,
isAlarmActiveFiltered("[default]Testbench_Controller_Tags/Motors/" + {view.params.motorName} + "/*","*","*",4,4,0,1,0), "alarmIcons/Alarm-Priority-1",
isAlarmActiveFiltered("[default]Testbench_Controller_Tags/Motors/" + {view.params.motorName} + "/*","*","*",3,3,0,1,0), "alarmIcons/Alarm-Priority-2",
isAlarmActiveFiltered("[default]Testbench_Controller_Tags/Motors/" + {view.params.motorName} + "/*","*","*",2,2,0,1,0), "alarmIcons/Alarm-Priority-3",
isAlarmActiveFiltered("[default]Testbench_Controller_Tags/Motors/" + {view.params.motorName} + "/*","*","*",1,1,0,1,0), "alarmIcons/Alarm-Priority-4",
0)
This expression structure seems to work in other expressions I've tried elsewhere, and I've confirmed that I can dynamically change the icon path with an expression binding through other methods. For example, this expression works properly if I manually assign the parameter.
if({view.params.highestAlarm}=4,'alarmIcons/Alarm-Priority-4','alarmIcons/Alarm-Priority-3')
I'm not quite sure why this isn't working, or if there is a better way to go about achieving the desired functionality. I've considered stacking all the icons in an embedded view and just setting visibility based on alarm priority, but to the best of my knowledge, my issue lies with how I'm trying to get the alarm priorities.
I'd appreciate it if anyone could give me some guidance on how to achieve this.
Thanks for your time!