Comparing Two Values in a Calculation Component.

Use this section to discuss your embedded Flowcode projects.
Post Reply
jay_dee
Posts: 197
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 75 times
Been thanked: 54 times

Comparing Two Values in a Calculation Component.

Post by jay_dee »

Hi,
I wish to compare two Byte values in a Calculation Component and a True/False being saved to a variable.
I dont think we have a comparitor style term like ==
My brain has gone blank! A little nudge anyone.

MyVar = ( 0xFC == Value)
If I did a bit wise AND, would I not get a value back based on any bits that match?
Thanks in advance.

P.S. I was avoidig using a series of Decision boxes as it was becoming very unwieldly!

mnfisher
Valued Contributor
Posts: 1453
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 707 times

Re: Comparing Two Values in a Calculation Component.

Post by mnfisher »

You can use '=='

So .x = (.y == .z) will set .x to true if .y equals .x (also < > <= >=)

Martin

jay_dee
Posts: 197
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 75 times
Been thanked: 54 times

Re: Comparing Two Values in a Calculation Component.

Post by jay_dee »

Sorry..my bad. Thanks Martin!!
I must have keyboard thump'd wrong.
The expression is now being accepted.
Ctrl_Side = (CAN_RxData_A[0]==0xFF)

Friday Code is much like a Friday built car.... never the best!

Post Reply