.. first line of object.rst template
.. first line of pou-object.rst template
.. first line of fun-object.rst template
.. _`.fld-FinderOpta.fld-Functions.fld-Send.MQTT_SendTopicBinary`:


.. index::
   single: MQTT_SendTopicBinary

.. _`MQTT_SendTopicBinary`:

``MQTT_SendTopicBinary`` (FUN)
------------------------------

FUNCTION MQTT_SendTopicBinary : WORD




This function publishes a binary payload to the specified MQTT topic.

The first ``payload_size`` bytes of ``payload`` are published. The output
``sent`` is set to ``TRUE`` when the publish operation has been completed.





InOut:
    +--------+--------------------------+------------------------+--------------------------------------------------------------+
    | Scope  | Name                     | Type                   | Comment                                                      |
    +========+==========================+========================+==============================================================+
    | Return | ``MQTT_SendTopicBinary`` | ``WORD``               | Status code returned by the runtime (0 means "no errors").   |
    +--------+--------------------------+------------------------+--------------------------------------------------------------+
    | Inout  | ``id``                   | ``WORD``               | Operation identifier used by the runtime.                    |
    +--------+--------------------------+------------------------+--------------------------------------------------------------+
    | Input  | ``topic``                | ``STRING(127)``        | MQTT topic name.                                             |
    +        +--------------------------+------------------------+--------------------------------------------------------------+
    |        | ``payload``              | ARRAY [0..244] OF BYTE | Binary payload buffer to publish.                            |
    +        +--------------------------+------------------------+--------------------------------------------------------------+
    |        | ``payload_size``         | ``WORD``               | Number of bytes to publish from ``payload``.                 |
    +        +--------------------------+------------------------+--------------------------------------------------------------+
    |        | ``qos``                  | ``WORD``               | Quality of Service level.                                    |
    +        +--------------------------+------------------------+--------------------------------------------------------------+
    |        | ``flags``                | ``WORD``               | Publish options: 0-none, 1-retain.                           |
    +--------+--------------------------+------------------------+--------------------------------------------------------------+
    | Output | ``sent``                 | ``BOOL``               | ``TRUE`` when the publish operation has completed completed. |
    +--------+--------------------------+------------------------+--------------------------------------------------------------+







.. last line of fun-object.rst template
.. last line of pou-object.rst template
.. last line of object.rst template



