VNT empty timetable as result of receive J1939 Channel

8 次查看(过去 30 天)
Hello,
I'm trying to use Vehicle Network Tools with J1939 communication.
As a first step I've tried code from example with some modifications (changed path to .dbc file, changed bus speed to 250k)
db = canDatabase('sourcedatabasefile.dbc')
chan = j1939Channel(db,'Vector','VN1610 1',1)
chan.configBusSpeed(250000)
start(chan)
pgrp = receive(chan,Inf)
stop(chan)
Unfortunately as a result I'm receiving empty timetable pgrp.
I've tried the same, but with configuring canChannel:
chan = canChannel('Vector','VN1610 1',1)
chan.configBusSpeed(250000)
start(chan)
rx = receive(chan,Inf)
stop(chan)
and rx is a timetable with raw CAN data.
Can anyone help if I'm missing something in my code or reason of receiving empty output is somewhere else?

回答(1 个)

Ayush
Ayush 2025-7-16
编辑:Ayush 2025-7-16
Hi Greg,
I understand that you are encountering an empty timetable because your "J1939" channel isn't decoding any parameter groups and it's only receiving raw CAN frames. The "J1939" channel wrapper expects valid, decodable "J1939" frames defined in your DBC. If none match, "receive(chan, Inf)" function returns empty output.
The "canChannel" works because it returns raw CAN frames regardless of content, so I hope you understand the cause of the issue mentioned above.
You can read more about "j1939" channel parameters in the official documentation: https://www.mathworks.com/help/vnt/ug/j1939parametergrouptimetable.html
Hope it helps!
  1 个评论
GreG
GreG 2025-7-24
Hi Ayush,
If I will read frames by canChannel and then decode them by j1939ParameterGroupTimetable everything works ok and I receive "data" timetable with correct J1939 data.
db = canDatabase('sourcedatabasefile.dbc')
chan = canChannel('Vector','VN1610 1',1)
chan.configBusSpeed(250000)
start(chan)
rx = receive(chan,Inf);
data = j1939ParameterGroupTimetable(rx,db);
stop(chan)
It is for me confusing why frames are not decoded correctly by j1939Channel, but it works in postprocessing with j1939ParameterGroupTimetable.
Do you have any idea?
I'm trying to record J1939 frames which are defined in my DBC, I'm using the same DBC in postprocessing and also different software with same DBC decodes frames correctly.

请先登录,再进行评论。

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by