필터 지우기
필터 지우기

How to find the check sum of the model currently built on a target computer?

조회 수: 5 (최근 30일)
Liam Vanderschaaf
Liam Vanderschaaf 2022년 1월 6일
댓글: Jon Lobo 2022년 12월 19일
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
else
slbuild(app.CntrlMdl);
end
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.
Thank you!
  댓글 수: 2
Liam Vanderschaaf
Liam Vanderschaaf 2022년 1월 7일
Forgot to mention this in the original post, but a try/catch system does not catch the error for some reason.
Jon Lobo
Jon Lobo 2022년 12월 19일
Hi Liam,
I'm assuming you are using Simulink Real-Time and there is a checksum mismatch between real-time application on the target and model on the host. Can you tell me which release you are using?
I'm assuming the app you are designing opens the Simulink model for your user and connects/starts the real-time application for them? Is that correct?
-Jon

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Real-Time Simulation and Testing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by