How to find the check sum of the model currently built on a target computer?
1 view (last 30 days)
I am working on creating an app that will run a desired Simulink model on a target computer. The target computer controls a number of devices used for some experiments we do. The purpose of this app is to enable people unfamiliar with the Simulink model's structure to alter certain parameters as well as run the model on the target computer.
I would like the app to check whether the target computer already has the model built, and build it if the model is not already built. Something along the lines of:
if app.CntrlMdl == 'Model on the Target PC'
%Do nothing as the app is ready to run
app.CntrlMdl is just the name of the model used for controlling the target computer.
The problem is that I don't know how to actually check whether the models are the same. I've found that trying to connect the simulink model to the target PC when the models are different produces the following error:
"The model that you are trying to run in External mode does not match the application running on your target. Checksum test (OPEN_PROTOTCOL) failed. The host model's structural checksum is (a 4×1 uint32 column vector) and the target application's strucural checksum is (a different 4×1 uint32 column vector). Rebuild the model, run it onn your target, and start External mode simulation again."
This error message gave me the idea of comparing the checksum's of the two models. I found a way to get the checksum of the model on the host computer (Simulink.BlockDiagram.getChecksum).
How do I get the checksum of the model on the target computer?
Building the model creates a target object, could that be used?
If you know another way to compare the two models, I'm not picky.