mqtt library incompatible with simulink

3 Ansichten (letzte 30 Tage)
Kyle Huggins
Kyle Huggins am 12 Sep. 2018
Beantwortet: Kyle Huggins am 12 Sep. 2018
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.

Akzeptierte Antwort

Kyle Huggins
Kyle Huggins am 12 Sep. 2018
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/

Weitere Antworten (0)

Communitys

Weitere Antworten in  ThingSpeak Community

Kategorien

Mehr zu Read Data from Channel finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by