フィルターのクリア

Programatically parametrize and 'refresh' CAN Pack and Unpack blocks

2 ビュー (過去 30 日間)
Ansh Gandhi
Ansh Gandhi 2020 年 7 月 13 日
回答済み: Ansh Gandhi 2020 年 9 月 8 日
I am trying to automate some processes and programatically create a model that contains CAN Pack and Unpack blocks.
When I parametrize the mask parameters in the script, the output is as attached in the image (Message Name and dbc appear correctly, is there a way to -
  1. Emulate mask button press 'OK' or 'Apply' so the input ports are generated without human intervention? OR
  2. Pass the mask params to underlying S-func so it updates the block?
mdlname = 'Trial_VCCU';
new_system(mdlname);
open_system(mdlname);
x = 100;
y = 100;
msgname = 'VCVCCU_ChargeToVehicle';
file = 'C:\repos\VECU IO\EV_CAN.dbc';
canmsglib = 'canmsglib/';
unpack = [canmsglib 'CAN Unpack'];
pack = [canmsglib 'CAN Pack'];
msgpack_hndle = add_block(pack, [mdlname '/' msgname '_Pack']);
set_param(msgpack_hndle, 'Position',[x, y, x+1000, y+600],...
'DataFormat', 'CANdb specified signals', 'CANdbFile', file, 'MsgList', msgname);
Current ouput - A.
Preffered output - B.
Thanks in advance!
Have referred to this but would prefer another solution if it has been found-
https://www.mathworks.com/matlabcentral/answers/294355-how-can-i-click-on-ok-or-apply-button-programmatically

採用された回答

Ansh Gandhi
Ansh Gandhi 2020 年 9 月 8 日
Solved this in an ad hoc way in the end by using the java keypress events in the script.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by