Getting error: "Invalid combination of start bit, signal size, and byte order", when packing message in big endian format using vehicle network toolbox
2 次查看(过去 30 天)
显示 更早的评论
I am trying to transmit a 4 byte can message in big endian format using the vehicle network toolbox using the code below.
message = canMessage(0x123, false, 4);
pack(message, 0x12345678, 31, 32, 'BigEndian');
But when i run it i get the error below when packing the message.
Error using can.Message/pack
Invalid combination of start bit, signal size, and byte order.
Error in canDebug (line 2)
pack(message, 0x12345678, 31, 32, 'BigEndian');
I have tried fixing the issue using the following changes, all errornous:
message = canMessage(0x123, false, 4);
pack(message, 0x12345678, 32, 32, 'BigEndian');
Error using pack
Expected STARTBIT to be a scalar with value < 32.
Error in can.Message/pack (line 614)
validateattributes(startBit, {'numeric'}, ...
Error in canDebug (line 2)
pack(message, 0x12345678, 32, 32, 'BigEndian');
message = canMessage(0x123, false, 4);
pack(message, 0x12345678, 0, 32, 'BigEndian');
Error using can.Message/pack
Invalid combination of start bit, signal size, and byte order.
Error in canDebug (line 2)
pack(message, 0x12345678, 0, 32, 'BigEndian');
0 个评论
回答(1 个)
Muskan
2024-2-21
The start bit and the byte order are not independent. You can further refer to the following MATLAB Answer for a better understanding:
I hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vehicle Network Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!