Creating configurable parameters in dll

조회 수: 3 (최근 30일)
LukeO
LukeO 2018년 4월 6일
답변: L A 2018년 9월 10일
I have a simulink model that I’m compiling into a dll using 2011b to be imported into NI VeriStand software.
I can compile the dll with no issues but the parameters when i import into veristand are only readable and I cannot change them, if I want to change the parameters I have to recompile the dll which isn’t acceptable.
I’m trying to do this for blocks such as gains, integrator and saturation. Is there anyway I can compile the dll so that I can change the parameters without having to compile the dll again?
Thanks,
Luke

채택된 답변

Alessandro Bertucci
Alessandro Bertucci 2018년 4월 24일
Hi Luke,
I dind't use the 2011b version of Matlab for model export but I think that the process I'm suggesting will work anyway.
To change gains you have use the multiplication block and a constant instead of the gain block, you'll see that the constant will be recognized by Veristand as a model parameter and it will allow you to change it in runtime.
For the saturation you could use the dynamic saturation block with the constant as mentioned above.
In regards to the integration I don't know what you want to do, you can reset, specify the initial condition, again, with a constant, and that should to the trick.
Let me know if this helped.
Regads.
AB
  댓글 수: 1
LukeO
LukeO 2018년 4월 24일
Hi Alessandro,
Thanks for the reply. Apologies but I have managed to sort it now. I created simulink parameters for all the parameters I want to configure and changed the storage class to “SimulinkGlobal”.
Turns out the error I was making was in VeriStand but the above method allows me to configure them now.
Thanks, Luke

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

추가 답변 (1개)

L A
L A 2018년 9월 10일
Hello Luke, regarding your question on compiling dll's, I would like to ask, whether you could use integrators in your simulink model? I have noticed, that the simulink integrator block, does not update correctly in Labview with the Model Interface Toolkit; as if it doesn't keep the last value. Any suggestion is appreciated. Best, Lysandros

카테고리

Help CenterFile Exchange에서 Simulink Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by