How can we read CAN message through Kvaser's CAN Device by Packet Input block in Simulink Desktop Real-Time?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm trying to read IMU output, 8byte, though a Kvaser Leaf Light HS V2. I've installed Kvaser's drivers and i can read data by software supplied with the IMU.
Now, I'd like to read the output data in MATLAB. I've installed Simulink Desktop Real-Time and use the Packet Input block.
Although we can choose a Kvaser's CAN Device in the Packet block's parameter, "Install new board", do we need the Vehicle Network Toolbox?
I noticed that the similar problem is posted in the link bellow, but the posted date is 2015. Is this situation still the same today?
https://jp.mathworks.com/matlabcentral/answers/194604-is-the-kvaser-leaf-light-hs-supported-by-both-vehicle-network-toolbox-and-real-time-windows-target
0 comentarios
Respuesta aceptada
Jan Houska
el 11 de Jul. de 2024
Hello,
to read raw CAN data, Vehicle Network Toolbox should not be needed. You will need to specify the output data types (decode the raw CAN data) manually by entering the data types in the block dialog. Please see the sldrtex_canio shipping example.
If you prefer to use the CAN_MESSAGE or CAN_MESSAGE_BUS data types and the Vehicle Network Toolbox block library to decode the received data, then of course a license of Vehicle Network Toolbox is needed. Please see the sldrtex_canmessage shipping example to see how this can be done.
Good Luck, Jan
3 comentarios
Jan Houska
el 17 de Jul. de 2024
Hello,
the CAN IDs are entered as decimal, not as hexadecimal. Please use the "hex2dec" function to convert, for example, 31A would convert to 794. I cannot tell if your data is Big Endian or Little Endian, but you probably have this one correct. I think everything else is correct as well.
Good Luck, Jan
Más respuestas (0)
Ver también
Categorías
Más información sobre Target Computer Setup en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!