CAN Packing and unpacking blocks - how do I set parameters programmatically?
Show older comments
There seems to be some private weirdness about the CAN Packing and unpacking blocks, as supplied with MATLAB R2009b, when used to interface with a CAN database file.
The blocks don't appear to have any mask parameter callbacks or block callbacks. There is an Init routine, of course, but that simply assumes that the SignalInfo parameter has already been filled in with signals from a selected message. However, just setting the parameters from an m-file doesn't do the trick. There is magic which happens when 'Apply' or 'OK' are clicked after choosing a specific message from a CAN database, but it's not clear what it is.
I want to automate the adding of CAN packing and unpacking blocks to a model, but just adding the block and setting the parameters doesn't seem to do the trick. I need to perform the equivalent of clicking on 'Apply' to fill in the SignalInfo parameter with the signals in the selected message - but how do I do that? As it is, I have to halt my script, click on 'Apply', and resume the script. Ugh!
Accepted Answer
More Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!