mqtt library incompatible with simulink

3 ビュー (過去 30 日間)
Kyle Huggins
Kyle Huggins 2018 年 9 月 12 日
回答済み: Kyle Huggins 2018 年 9 月 12 日
I'm attempting to leverage the mqtt library here within simulink to allow publication of information to an external interface that another component will read from (e.g., a locally hosted artemis queue that supports mqtt, which another component reads from and acts upon).
There are a few issues:
1) try/catch is not supported in simulink
2) the library mentioned above does not support simulink compilation. See below error
P-file 'C:\Users\Kyle Huggins\Documents\MATLAB\simulink_additions\mqqt\+mqttio\@Mqtt\Mqtt.p' is not authorized for compilation. To support compilation, please consider using 'coder.allowpcode' in this file. When the file defines a MATLAB class, 'coder.allowpcode' should be added to the class constructor.
P-code function 'Mqtt.p' produced an error.
Component:MATLAB Function | Category:Coder error
The 'matlab.mixin.CustomDisplay' class does not support code generation.
P-code function 'Mqtt.p' produced an error.
Component:MATLAB Function | Category:Coder error
Parsing failed.
Function 'mqtt.m' (#346.5133.5139), line 129, column 7:
"mqttio"
Launch diagnostic report.
Since that is p-code, I'm unable to modify it to support compilation. I'm aware that there are thingspeak blocks that are available via the android toolbox, but this appears to support writing to channels on the thingSpeak domain. I'm interested in writing to a local queue, and am not doing anything related to IoT flavored applications.
Is there a possible solution given the current setup, or should I work on some other means of linking in external applications? Or is there a more appropriate method to go about this?
Please see attached file for a reproduction of the issue. Requires mqtt and a local mqtt compatible messaging service such as apache artemis.

採用された回答

Kyle Huggins
Kyle Huggins 2018 年 9 月 12 日
Solved by making creating a matlab wrapper that called the function I wanted and made it extrinsic, a la https://blogs.mathworks.com/simulink/2014/01/08/simulink-and-matlab-objects/

その他の回答 (0 件)

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeRead Data from Channel についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by