Processing J1939 BAM messages with VNT

7 次查看(过去 30 天)
I'm trying to use the Vehicle network tool box to capture and process a transport protocol multi packet message.
The message is sent over BAM or broad cast, and i've created blocks to capture when RTS message goes out, but is there a method of captureing the disperate values across a set of packets and present the final thing in an array, or is it dump to the workspace and let some other script figure it out.

采纳的回答

Shivam Lahoti
Shivam Lahoti 2023-10-20
Hi Charles,
From what I can understand, you want to process a multi-packet transport protocol over the J1939 communication channel and want to capture the disparate values across a set of packets.
The vehicle Network toolbox provides several blocks that could be used to receive packets from different communication protocols, Since the transport protocol is over the J1939 communication channel VNT has a J1939 Receive block. The J1939 Receive block receives a J1939 message from the configured CAN device. Please look at the following documentation to understand the J1939 receive block.
Along with this have a look at the following documentation’s function segment to understand the different functions available to process the transport protocol.
For example, to receive all the available parameter groups from the bus by specifying a count of Inf.:
db = canDatabase('MyDatabase.dbc')
chan = j1939Channel(db,'Vector','CANCaseXL 1',1)
start(chan)
pgrp = receive(chan,Inf)
I hope this helps.
Regards,
Shivam Lahoti.
  1 个评论
Charles Coulton
Charles Coulton 2023-10-20
Thank you! The programatic example is great. I have since found out that DBC files if they define a message as multipacket, will receive the message even if it comes in as a single packet. It does mean that you have to watch for the TP packets and use that to process what you got from multipacket parser it is much more flexiable than it seems on the outset. But that is likely more a function of the limitations of the DBC spec than of MATLAB or simulink.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vehicle Network Toolbox 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by