Using set_param to change parameter DataTypes in Packet Input block does not work.
3 ビュー (過去 30 日間)
古いコメントを表示
Markus Nordstrand
2014 年 10 月 1 日
コメント済み: Markus Nordstrand
2014 年 10 月 9 日
I am using the block Packet Input to receive CAN messages.
I have several of these blocks and I can change the parameter Sampletime by using this command:
set_param('.../.../Packet Input','SampleTime', '0.01')
However, when I want to change the parameter DataTypes it does not work:
set_param('.../.../Packet Input','DataTypes', 'double')
I get this error:
"Non-string expression where a string was expected."
Even though both parameters have the same properties:
>> ans.SampleTime
ans =
Type: 'string'
Enum: {}
Attributes: {'read-write' 'read-only-if-compiled' 'link-instance'}
>> ans.DataTypes
ans =
Type: 'string'
Enum: {}
Attributes: {'read-write' 'read-only-if-compiled' 'link-instance'}
How do I set the DataTypes parameter in the Packet Input block via set_param()?
0 件のコメント
採用された回答
Sandip Kumar
2014 年 10 月 8 日
In order to specify the DataTypes, try using ''double'' instead of 'double'.
Thanks, Sandip, MathWorks
2 件のコメント
Sandip Kumar
2014 年 10 月 8 日
That is a double-single quotes (instead of single quote) , in case it is not clear.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で PLC Code Generation Basics についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!