Skip to content

MQTT ClassType methods

Consider that MQTT ClassType method support is actually an experimental feature. It is only supported at B&R Platform now.

Activation

Set MQTT mode to server at configuration page.

mqtt-mode

Consider that MQTT channel stays connected while "PLC connected" is disabled. To stop MQTT server, change again to MQTT mode "None".

Usage

  • Declare a TypeClass instance at a controller interface structure

Simple Method

Simple methods have no arguments and no return value declared.

For easy use at Service Ui, there is no dialog required to execute method.

simple-method

Click to Execute button to call method at PLC runtime. Method execution is done while button is flashed green shortly.

Methods with Return values

If declared method supports a return value. Dialog representation is used for this method. In this case button Text is "Open" instead of "Execute".

return-method

Press Execute button at dialog to start method execution. Return value is displayed after successful execution at dialog footer.

Methods with Arguments

Methods with arguments are actually not supported with B&R Platform. This feature will be supported with next B&R JSON library release.

method-with-argument

Fill in argument form fields and press execution button afterwards. Warning (yellow) Button shows failed execution of method at PLC, since feature is not supported now.

Time context

Calling of PLC method from Service Ui is async. Method execution thread at PLC is the same than controller function block is assigned too. This gives the advantage for PLC developper to ignore multi threading issues while writing a class.