I need to change the filling color of an object based on two Bit tags.
for example, status_L and status_H are two bit tags.
In an older system, the expression (status_H + 2*status_L) is evaluated and the fill color is set according to the table:
0 - gray
1 - Red
2 - Green
3 - gray
Now im trying to do the same thing on iX Developer 2.40 SP4.
Despite the iX's expression builder allowing to insert a global variable on the expression, the global variables are never computed. The variable is only computed in the expression if it is the variable choosen in the fill property. No errors or warnings are generated. It simply doesnt work as expected.
Multiple variables on iX's expression are not allowed?
Or am i missing something to the global variables be evaluated on the expression?
thanks in advance
Expressions with multiple global variables
Expressions with multiple global variables
- Attachments
-
- screenshot
- ix expression.png (43.86 KiB) Viewed 6175 times
Re: Expressions with multiple global variables
Try adding the SystemTagSecond and setting it as the Dynamic tag (instead of the GV102_VA11YZSL tag)
The expression is only evaluated when that assigned tag value is changed, so setting it to the second tag means it will evaluate the expression every second
The expression is only evaluated when that assigned tag value is changed, so setting it to the second tag means it will evaluate the expression every second
Best regards,
Russ
(801) 708-6690
Technical Support
Contact Us
Beijer Electronics AB
http://www.beijerelectronics.us
Russ
(801) 708-6690
Technical Support
Contact Us
Beijer Electronics AB
http://www.beijerelectronics.us
Re: Expressions with multiple global variables
Russ C. wrote:Try adding the SystemTagSecond and setting it as the Dynamic tag (instead of the GV102_VA11YZSL tag)
The expression is only evaluated when that assigned tag value is changed, so setting it to the second tag means it will evaluate the expression every second
Thank you very much for the answer, Russ.
Looks like the values of the global tags inside the expression are not updated (are not inserted in the poll) if it isnt used in some object in the current screen or it isnt an Always Active tag. Putting the variables as Always Active solves this.
I am now evaluating if the expressions are executed on the update of the screen or by change in the variable value. If needed, your trick to use SystemTagSecond to have an always changing variable will be very convenient.
To avoid puting all the state bits as Always Active, another solution is to stack-up the object states and to use the visibility with the state bits (old fashion way). I was trying to avoid this becouse it gets a little messy with the increase in number of states and elements on the screen.