Hello all,
I'm making templates in Ignition and needed help with the scripting.
Pretty basic-On a motor's template, I want it to have three possible colors: green for running, red for stopped, and yellow for in alarm.
I've created custom properties on the template: running, alarm, motor_color, running_color, stopped color, and alarm_color.
I have two scripts on the binding property for "motor_color" that I want to combine:
IF ({Root Container.MOTOR_RIGHT.RUNNING},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_RUNNING},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_STOPPED})
IF ((!{Root Container.MOTOR_RIGHT.RUNNING} && {Root Container.MOTOR_RIGHT.ALARM}),{Root Container.MOTOR_RIGHT.MOTOR_COLOR_ALARM},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_RUNNING})
Each of the scripts work individually, but what is the syntax to combine the two? Scripting is something i'm very weak in.
The first script just moves the "motor_color_running" to the displayed "motor_color".
The second script turns the motor yellow if it's not running and in alarm.
I'm making templates in Ignition and needed help with the scripting.
Pretty basic-On a motor's template, I want it to have three possible colors: green for running, red for stopped, and yellow for in alarm.
I've created custom properties on the template: running, alarm, motor_color, running_color, stopped color, and alarm_color.
I have two scripts on the binding property for "motor_color" that I want to combine:
IF ({Root Container.MOTOR_RIGHT.RUNNING},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_RUNNING},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_STOPPED})
IF ((!{Root Container.MOTOR_RIGHT.RUNNING} && {Root Container.MOTOR_RIGHT.ALARM}),{Root Container.MOTOR_RIGHT.MOTOR_COLOR_ALARM},{Root Container.MOTOR_RIGHT.MOTOR_COLOR_RUNNING})
Each of the scripts work individually, but what is the syntax to combine the two? Scripting is something i'm very weak in.
The first script just moves the "motor_color_running" to the displayed "motor_color".
The second script turns the motor yellow if it's not running and in alarm.