Page 1 of 1

Comparing Two Values in a Calculation Component.

Posted: Fri Jun 14, 2024 6:11 pm
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!

Re: Comparing Two Values in a Calculation Component.

Posted: Fri Jun 14, 2024 6:13 pm
by mnfisher
You can use '=='

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

Martin

Re: Comparing Two Values in a Calculation Component.

Posted: Fri Jun 14, 2024 6:16 pm
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!