But I want a few more conditions than this,and trying to make the simple one a SWITCH from above or a few tries similar doesn’t work, gives me Switch does not work with multiple arguments or similar…Also, what is the ,1 for end of line 1…I tried the link to the manual it doesn’t work, and speaking of, where is the manual mentioned often in training…
Do you want a result of 1 if either of your first conditions is true and 2 if neither is true? If so, what you have should work, assuming the relative tag paths are correct.
Or do you want a result of 1 if the first condition is true and a result of 2 if the second condition is true? There are multiple ways to do this, depending on what result you want if both conditions are true or both are false. Here's an example using if that ignores the second condition if the first condition is true:
// Return 1 if first condition is true (regardless of second condition).
if({[.]…/CTR_VAC_ROLL_A_MODE}>0, 1,
// Return 2 if first condition is false and second condition is true.
if({[.]…/CTR_VAC_ROLL_B_MODE_TENSION}>0, 2,
// Return zero if neither is true.
0
)
)
A simpler way to get the same result would use binEnum:
// Returns index of first true condition:
// 0 indicates both conditions false.
// 1 indicates first condition true, regardless of second condition.
// 2 indicates second condition true and first condition is false.
binEnum(({[.]…/CTR_VAC_ROLL_A_MODE}>0,{[.]…/CTR_VAC_ROLL_B_MODE_TENSION}>0)
Use switch or case to get different results for different values of a single tag/property. Use binEnum (to get index of first true condition) or binEnc (to get a single value representing state of all conditions) for multiple true/false conditions.