This should be a simple one.
I'm trying to use a boolean value in a CPT instruction to either add a value or not. This is the statement:
Local:7:I.Ch0Data + (RETARD_FOIL * HMI_FOIL_GAIN * ERROR_ABS)
Where Local:7:I.Ch0Data is an INT, RETARD_FOIL is the BOOL in question and HMI_FOIL_GAIN & ERROR_ABS are REALs.
When I try to compile it, I get an 'invalid expression or tag' error. When I replace the BOOL with a 1, the expression is accepted.
Why isn't the BOOL being evaluated as a 1 or 0? How can I get it to add HMI_FOIL_GAIN * ERROR_ABS if the BOOL is true but not if it's false, using a CPT instruction. I know I can do it other ways but I'd like to know what I'm doing wrong in the CPT.
I'm trying to use a boolean value in a CPT instruction to either add a value or not. This is the statement:
Local:7:I.Ch0Data + (RETARD_FOIL * HMI_FOIL_GAIN * ERROR_ABS)
Where Local:7:I.Ch0Data is an INT, RETARD_FOIL is the BOOL in question and HMI_FOIL_GAIN & ERROR_ABS are REALs.
When I try to compile it, I get an 'invalid expression or tag' error. When I replace the BOOL with a 1, the expression is accepted.
Why isn't the BOOL being evaluated as a 1 or 0? How can I get it to add HMI_FOIL_GAIN * ERROR_ABS if the BOOL is true but not if it's false, using a CPT instruction. I know I can do it other ways but I'd like to know what I'm doing wrong in the CPT.