Cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Equals operator in logic expressions

Further to my post of a few weeks ago about expressions for logic behavior, I have a related query, regarding the use of the Equals operator.

 

If I edit and expression in the GUI, and type an expression such as "enEntry1 = 0", it evaluates to a 1 or a zero depending on whether the expression is true or false.

 

However, if I insert a TxPlcExpressionOperator.IsEqualTo into the expression, although it is displayed the same in the expression builder, the resulting logic (as displayed in Control => Edit Logic Resource) is blank, and the actual behavior corresponds with this blank state.

 

I have tried inserting the IsEqualTo operator twice (c-style), bracketing in various ways, the use of inverted commas on the operands (as these are displayed in many circumstances on the GUI logic editor), but without success. I have some work-arounds (editing the gmPLC.xml file which stores the behavior), but if there is a way to make the API match the GUI behavior, it would be simpler, neater, more maintainable etc.