case
This feature is new in Ignition version 7.8.1
This function acts like the switch statement in C-like programming languages. It takes the value argument and compares it to each of the case1 through caseN expressions. If value is equal to caseX , then case returns valueX . If value is not equal to any of the case1..N , then returnDefault is returned.
Note that case() is similar in functionality to the switch() expression function . The difference between the two is the order in which the parameters are passed.
case( value, case1, return1, case2, return2, ...caseN, returnN, returnDefault )
//The following would return 46 because the value (15) matched case 3, so the third return (46) was returned.case(15, // value1, // case 144, // return 124, // case 245, // return 215, // case 346, // return 3-1) // default //The following would return "Running".case(1, // value0, // case 1"Off", // return 11, // case 2"Running", // return 22, // case 3"Fault", // return 3forceQuality("!BAD STATE!",0)) // default