Introduction

Equality instructions such as the EQ_E (equals instruction), have an enable input. The normal expectation for this kind of instruction is that if the enable variable is FALSE (OFF, not active or zero), the result of the instruction will also be equal to zero or OFF. This is not the case in the IEC standard when using default settings in GX IEC Developer.

Design Constraints

In the example program below, the normal expectation is that when M1 goes off, the output from the first EQ instruction will also go off. Because the output from the first EQ is expected to be off, then the final result M0 is also expected to be off. This is not the default behaviour in the IEC standard and GX IEC Developer.

The actual generated code (see below), shows the SET and RST (reset) instructions have actually been used. If the result of the first EQ instruction was TRUE and on the next scan M1 is FALSE, the input to the second EQ instruction will remain TRUE because the code before it has neither been Set nor Reset.

There are 2 choices to make the system operate as expected.

Option 1 is to deselect the Use SET/RST setting in the Code Generation part of the Options choice of the Extras menu as shown below. This then generates the code shown below.

Option 2 is to rewrite the code using the AND_EQ_M instruction as shown below.

This generation has the same code as shown above.

NOTE: this same default applies to many other equality instructions and several other instructions as shown in the options/code generation settings above.

Further Information

For further information, see the GX IEC Developer software and associated documentation.

[et_pb_divi_related_posts_module _builder_version="3.0.106" header_text="Related Posts" posts_count="5" posts_source="tags" /]