Hello I'm trying to write down a code like this:
on message *
{
if(this.receiver == "BCM")
{
write("The message %s will be received by the BCM", this.ID)
}
}
But the problem is there is no attribute "receiver" or "receivers" for a message. Even though if I open the message in "CANdb++ Editor" just like the image bellow, it shows a list of receivers for the message "BODY1":
I'm using CANalyzer 8.5 SP7.
I've tried to search if there is a way to access this atribute from the Database without any success
I'm not clear where you are trying to run this code, or what language you are using, but should try something like cantools in python. If you are looking to just check and attribute of a message that you either recorded or received. Embedded applications may require a little more work, depending on the Dbc libraries you have available.
Using cantools you can load the DBC. Then either decode can frames, which applies the attributes to your message, or just loop through the DB object and make a list of all the IDs that include that attribute.
It's also possible to just open DBC in something like excel, and if you use " as your cell delimiter it will give you a column of just the receivers. Then you can filter on that column for BCM, and you will have a rough list of all the receiver signals.
The DBC format always follows: BO_ XXX MSG: 8 Sender SG_ Signal : 1|1@1+ (1.0,0.0) [0.0|1.0] "" RECEIVERS
So you could use that " before the receiver list to split and filter on, even if you just read the raw text file.