If a boolean variable e.g. LtoR is inverted using NOT function
e.g. LtoR = NOT(LtoR)
then it works in a simulated decision but the generated code
uses bitwise inversion (~) and the resulting value is not equivalent
to false.
CODE GENERATED:
// Flip direction
// Calculation:
// LtoR = NOT (LtoR)
FCV_LTOR = ~(FCV_LTOR)
Inverting a bool inconsistent using NOT (Flowcode 7)
-
- Posts: 2
- http://meble-kuchenne.info.pl
- Joined: Tue Nov 01, 2022 8:59 am
Re: Inverting a bool inconsistent using NOT (Flowcode 7)
LtoR = !(LtoR) works correctly in simulation and generated code.
-
- Valued Contributor
- Posts: 1149
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 285 times
- Been thanked: 412 times
Re: Inverting a bool inconsistent using NOT (Flowcode 7)
Hi
If you do a search for difference between NOT and ! you should get the answer.
This link gives a guide
https://www.tutorialspoint.com/cprogram ... rators.htm
Regards
PS
If you are using Flowcode V7 then please post in that forum.
If you do a search for difference between NOT and ! you should get the answer.
This link gives a guide
https://www.tutorialspoint.com/cprogram ... rators.htm
Regards
PS
If you are using Flowcode V7 then please post in that forum.