capl - Getting a list of all active messages in a CAN Bus -
i'm learning use capl
on canoe
, need create gateway filters messages between 2 can buses.
for first part need create way toggle transmission bus 1 bus 2 , vice versa (already done).
then have able select specific message of buses send on other bus. of must don graphically panel , i'm using checkboxes toggle of part 1 , dropdown lists message filter.
do know of way list of active (rx/tx) messages in bus last, say, 10 seconds? (i know must use timer call update function)
you can subscribe messages bus defining on message
event handler. called each message (subject filter condition have specified). can create gateway retransmitting messages using output
.
for example, graphical panel can set variable my_id
id of message want relay bus 1 bus 2. write:
on message can1.* { message can2.* msg; if((this.dir == rx) && (this.id == my_id)) { msg = this; output(msg); } }
the additional condition this.dir == rx
necessary if want relay same message bus 1 bus 2 , vice versa. prevent retransmitting same message indefinitely.
Comments
Post a Comment