CAN Bus Filter & Masks?

Status
Not open for further replies.

zmanultra

Member level 2
Joined
Mar 20, 2004
Messages
48
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,288
Location
Australia
Activity points
524
cansetfilter

hi there,
i have 4 node, node A node B and node C and a master node alpha

node alpha is the one that wants to recive messaged from NODE A and B only

say for example NODE A has a msg id of 0x020 and NODE B has a msg id of 0x030

how do i make the master node only filter msgs comming only from those two nodes?
should id do this ????
#define my_can_id_a 0x020
#define my_can_id_a 0x030

CANSetFilter(CAN_FILTER_B1_F1, my_can_id_a, CAN_STD_MSG);
CANSetFilter(CAN_FILTER_B1_F2, my_can_id_a, CAN_STD_MSG);
CANSetFilter(CAN_FILTER_B2_F1, my_can_id_b, CAN_XTD_MSG);
CANSetFilter(CAN_FILTER_B2_F2, my_can_id_b, CAN_XTD_MSG);
CANSetFilter(CAN_FILTER_B2_F3, my_can_id_b, CAN_XTD_MSG);
CANSetFilter(CAN_FILTER_B2_F4, my_can_id_b, CAN_XTD_MSG);

i dont know if this right, im the worst

how do i check if the msg recived was from these two nodes?
please help im a beginer with the can bus
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…