Expressions with multiple global variables

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
tfuk
Posts: 3
Joined: Wed Nov 27, 2019 5:50 am

Expressions with multiple global variables

Post by tfuk »

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
Attachments
screenshot
screenshot
ix expression.png (43.86 KiB) Viewed 6178 times

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: Expressions with multiple global variables

Post by Russ C. »

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
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

tfuk
Posts: 3
Joined: Wed Nov 27, 2019 5:50 am

Re: Expressions with multiple global variables

Post by tfuk »

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.

Post Reply