user14034756
user14034756

Reputation:

Use 'on message' to find message in .byte(1) in CAPL

I need to find for example the message 0x02 for byte(1) in the bus.

When I use

on message 0x02
{
}

Is it like?

on message *
{
   if(this.id==0x02)
   {
   }
}

How can I then use on message for .byte(1)?

Upvotes: 0

Views: 3108

Answers (1)

Shyam
Shyam

Reputation: 682

Your second piece of code is the right way to go.

on message *
{
   if(this.id == 0x02)
   {
      write("%x", this.byte(1));
   }
}

As shown above, you can use .byte(1) even for the this keyword.

Upvotes: 1

Related Questions