Vehicle data acquisition simulation using Vehicle Network Toolbox in Simulink
Show older comments
I have created a sensor data acquisition model on simulink using Vehicle network toolbox blocks. I have used a used defined function block for converting the int8 data coming form SARADC block into an unsigned 8 bit vector such that I can feed the same to CAN PACK block for transmssion. The matlab code used in user-defined function block for conversion is attached. The same error showed up when I put a Bus to vector converter in the path between user defined function block and CAN pack block.
The error shown was-
Simulink cannot determine sizes and/or types of the outputs for block 'ADC_CANmodel/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Another thing I tried was putting an integrated matlab function block between ADC and CAN pack block, giving the same converter function to it and setting output dimension of block to be 8 and MATLAB function as converter function file name.
This showed an error-
Invalid input signal width, data type or input port is not connected. The data type of input signal must be UINT8 with a maximum signal width of 8.
An error occurred while propagating data type 'double' from 'ADC_CANmodel/Interpreted MATLAB Function', output port 1.
Please help me where am I going wrong. Please help as soon as possible.
Answers (0)
Categories
Find more on Vehicle Network Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!