Difference between revisions of "Component: IoT Made Easy (Comms: IoT/Cloud)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Comms: IoT/Cloud
 
| Comms: IoT/Cloud
 
|}
 
|}
  
  
 +
==IoT Made Easy component==
 +
A component designed to simplify MQTT comms allowing for multiple data streams to be dealt with in a simple manner. Deals with translating values to and from the broker from topic strings into  message IDs and numeric values. Works with lots of different MQTT brokers.
 +
 +
==Detailed description==
  
==[[File:Component Icon 2740a93b_32a9_48d1_8fc3_089d13b50bb5.png|Image]] IoT Made Easy component==
+
''No detailed description exists yet for this component''
A component designed to simplify MQTT comms allowing for multiple data streams to be dealt with
 
in a simple manner. Deals with translating values to and from the broker from topic strings into
 
message IDs and numeric values. Works with lots of different MQTT brokers.
 
  
 
==Examples==
 
==Examples==
 +
 +
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
  
Line 26: Line 27:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>ErrorAsString</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''<span style="color:red;">No additional information</span>''
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ErrorAsString'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Error
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishString'''
 +
|-
 +
| colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | TopicID
 +
|-
 +
| colspan="2" | The topic ID to publish data to&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data string to publish&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Error''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTopicID'''
 +
|-
 +
| colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect'''
 +
|-
 +
| colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadInteger'''
 +
|-
 +
| colspan="2" | Get the Payload of the last received (Read) packet as a signed long value&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>PublishString</tt></u></span>===
 
Publishes data to the selected topic ID using a data string.
 
  
Returns none zero if successful
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LastError'''
 +
|-
 +
| colspan="2" | Returns the last error&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''TopicID''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::The topic ID to publish data to
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
 +
|-
 +
| colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|<- STRING]] ''Data''
 
::Data string to publish
 
::''This parameter may be returned back to the caller''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disconnect'''
 +
|-
 +
| colspan="2" | Disconnects from the MQTT server and the network&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishFloat'''
 +
|-
 +
| colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | TopicID
 +
|-
 +
| colspan="2" | The topic ID to publish data to&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data to publish&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetTopicID</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Compares the topic ID of the last received message with enabled IDs.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Ping'''
 +
|-
 +
| colspan="2" | Ping packet is sent to the server and checks for a reply.  If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active.  Returns non-zero value if successful &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Returns the topic ID received.
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishInteger'''
 +
|-
 +
| colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | TopicID
 +
|-
 +
| colspan="2" | The topic ID to publish data to&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data to publish&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadFloat'''
 +
|-
 +
| colspan="2" | Get the Payload of the last received (Read) packet as a floating point value&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadString'''
 +
|-
 +
| colspan="2" | Get the Payload of the last received (Read) packet as a string value&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Payload
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Size
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>Connect</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Connect to the MQTT Server.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Returns the connected state.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
+
|-
0 if not connected, 1 if successful connection, or already connected.
+
| colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component.&nbsp;
 
+
|-
'''Parameters'''
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
:''This macro has no parameters''
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
 
 
'''Return value'''
 
  
:[[Variable Types|BYTE]]
 
  
 
===<span style="font-weight: normal;"><u><tt>GetPayloadInteger</tt></u></span>===
 
Get the Payload of the last received (Read) packet as a signed long value
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|LONG]]
 
 
 
===<span style="font-weight: normal;"><u><tt>LastError</tt></u></span>===
 
Returns the last error
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Read</tt></u></span>===
 
Read incoming data.
 
 
Returns non-zero if packet received.
 
 
Use GetTopicID and GetPayloadXXX to read the contents.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|UINT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Disconnect</tt></u></span>===
 
Disconnects from the MQTT server and the network
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>PublishFloat</tt></u></span>===
 
Publishes data to the selected topic ID using a floating point value.
 
 
Returns none zero if successful
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''TopicID''
 
::The topic ID to publish data to
 
 
:[[Variable Types|FLOAT]] ''Data''
 
::Data to publish
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Ping</tt></u></span>===
 
Ping packet is sent to the server and checks for a reply.
 
 
 
 
If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active.
 
 
Returns non-zero value if successful
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>PublishInteger</tt></u></span>===
 
Publishes data to the selected topic ID using a signed long integer value.
 
 
Returns none zero if successful
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''TopicID''
 
::The topic ID to publish data to
 
 
:[[Variable Types|LONG]] ''Data''
 
::Data to publish
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetPayloadFloat</tt></u></span>===
 
Get the Payload of the last received (Read) packet as a floating point value
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|FLOAT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetPayloadString</tt></u></span>===
 
Get the Payload of the last received (Read) packet.
 
 
Returns the number of bytes for the Payload
 
 
'''Parameters'''
 
 
:[[Variable Types|<- STRING]] ''Payload''
 
::''This parameter may be returned back to the caller''
 
 
:[[Variable Types|BYTE]] ''Size''
 
::Byte count the Payload buffer
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Starts up the MQTT component - call this after initialising the NetworkComms component.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Host</u></span>
 
  
This property is of type ''Line of text'' and can be referenced with the variable name ''MQTT_Client1::HOST''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Address of MQTT Broker
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Port</u></span>
+
|-
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''MQTT_Client1::PORT''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Host
Port used by MQTT Broker
+
|-
 
+
| colspan="2" | Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)&nbsp;
<span style="font-weight: normal;"><u>Client identifier</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''MQTT_Client1::CLIENT''.
+
| width="90%" | Port
 
+
|-
Client identifier (Maximum length 20 characters)
+
| colspan="2" | Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Network Timeout</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Client identifier
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''MQTT_Client1::TIMEOUT''.
+
|-
 
+
| colspan="2" | Client identifier (Maximum length 20 characters) Must be unique to the broker.&nbsp;
Maximum time in mS to wait for network responses
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
<span style="font-weight: normal;"><u>Keep Alive</u></span>
+
| width="90%" | Network Timeout
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''MQTT_Client1::KEEP_ALIVE''.
+
| colspan="2" | Maximum time in mS to wait for network responses&nbsp;
 
+
|-
The Keep Alive is the maximum time interval that is permitted to elapse  
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Read Timeout
between the point at which the Client finishes transmitting one Control Packet  
+
|-
 
+
| colspan="2" | Time to wait in ms when waiting for incoming messages&nbsp;
and the point it starts sending the next, measured in seconds.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
<span style="font-weight: normal;"><u>Network Component</u></span>
+
| width="90%" | Keep Alive
 
+
|-
This property is of type ''Panel object'' and can be referenced with the variable name ''MQTT_Client1::NETWORK_COMPONENT''.
+
| colspan="2" | The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.&nbsp;
 
+
|-
Pointer to the network communications component providing TCP simulation and abstraction for embedded
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
+
| width="90%" | Network Component
TCP modules.
+
|-
 
+
| colspan="2" | Pointer to the network communications component providing TCP simulation and abstraction for embedded TCP modules.&nbsp;
<span style="font-weight: normal;"><u>Authentication</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''MQTT_Client1::AUTHENTICATION''.
+
| width="90%" | Authentication
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | Selects if the broker is open or if the broker requires a username and password.&nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Number of topics
<span style="font-weight: normal;"><u>Number of topics</u></span>
+
|-
 
+
| colspan="2" | Sets the number of data topics that can be sent or received&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''NumTopics''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
Sets the number of data topics that can be sent or received
+
| width="90%" | Topic String
 
+
|-
<span style="font-weight: normal;"><u>Topic String</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic0''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
| width="90%" | Topic String
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType0''.
+
| colspan="2" | &nbsp;
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
 
+
|-
 
+
| colspan="2" | &nbsp;
<span style="font-weight: normal;"><u>Topic String</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic1''.
+
| width="90%" | Topic String
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType1''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Topic String
 
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Topic String</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic2''.
+
|-
 
+
| colspan="2" | &nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Topic String
 
+
|-
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType2''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
<span style="font-weight: normal;"><u>Topic String</u></span>
+
| width="90%" | Topic String
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic3''.
+
| colspan="2" | &nbsp;
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
 
+
|-
 
+
| colspan="2" | &nbsp;
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType3''.
+
| width="90%" | Topic String
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
<span style="font-weight: normal;"><u>Topic String</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic4''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Topic String
 
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType4''.
+
|-
 
+
| colspan="2" | &nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Topic String
 
+
|-
<span style="font-weight: normal;"><u>Topic String</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic5''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
| width="90%" | Topic String
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType5''.
+
| colspan="2" | &nbsp;
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
 
+
|-
 
+
| colspan="2" | &nbsp;
<span style="font-weight: normal;"><u>Topic String</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic6''.
+
| width="90%" | Topic String
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType6''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Topic String
 
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Topic String</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Topic Type
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic7''.
+
|-
 
+
| colspan="2" | &nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 
+
|-
<span style="font-weight: normal;"><u>Topic Type</u></span>
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType7''.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 
+
|-
''<span style="color:red;">No additional information</span>''
+
|}
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic String</u></span>
 
 
 
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic8''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic Type</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType8''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic String</u></span>
 
 
 
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic9''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic Type</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType9''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic String</u></span>
 
 
 
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic10''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic Type</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType10''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic String</u></span>
 
 
 
This property is of type ''Line of text'' and can be referenced with the variable name ''Topic11''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Topic Type</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TopicType11''.
 
 
 
''<span style="color:red;">No additional information</span>''
 

Revision as of 19:48, 16 November 2021

Author Matrix TSL
Version 1.0
Category Comms: IoT/Cloud


IoT Made Easy component

A component designed to simplify MQTT comms allowing for multiple data streams to be dealt with in a simple manner. Deals with translating values to and from the broker from topic strings into message IDs and numeric values. Works with lots of different MQTT brokers.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png ErrorAsString
 
Fc9-u8-icon.png - BYTE Error
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png PublishString
Publishes data to the selected topic ID using a data string. Returns none zero if successful 
Fc9-u8-icon.png - BYTE TopicID
The topic ID to publish data to 
Fc9-string-icon.png - STRING Data
Data string to publish 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetTopicID
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Connect
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetPayloadInteger
Get the Payload of the last received (Read) packet as a signed long value 
[[File:]] - Return


Fc9-comp-macro.png LastError
Returns the last error 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Read
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png Disconnect
Disconnects from the MQTT server and the network 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PublishFloat
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful 
Fc9-u8-icon.png - BYTE TopicID
The topic ID to publish data to 
[[File:]] - Data
Data to publish 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Ping
Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PublishInteger
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful 
Fc9-u8-icon.png - BYTE TopicID
The topic ID to publish data to 
[[File:]] - Data
Data to publish 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetPayloadFloat
Get the Payload of the last received (Read) packet as a floating point value 
[[File:]] - Return


Fc9-comp-macro.png GetPayloadString
Get the Payload of the last received (Read) packet as a string value 
Fc9-string-icon.png - STRING Payload
 
Fc9-u8-icon.png - BYTE Size
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Starts up the MQTT component - call this after initialising the NetworkComms component. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-10-icon.png Host
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms) 
Fc9-type-21-icon.png Port
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access. 
Fc9-type-10-icon.png Client identifier
Client identifier (Maximum length 20 characters) Must be unique to the broker. 
Fc9-type-21-icon.png Network Timeout
Maximum time in mS to wait for network responses 
Fc9-type-21-icon.png Read Timeout
Time to wait in ms when waiting for incoming messages 
Fc9-type-21-icon.png Keep Alive
The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds. 
Fc9-type-17-icon.png Network Component
Pointer to the network communications component providing TCP simulation and abstraction for embedded TCP modules. 
Fc9-type-16-icon.png Authentication
Selects if the broker is open or if the broker requires a username and password. 
Fc9-type-16-icon.png Number of topics
Sets the number of data topics that can be sent or received 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-type-10-icon.png Topic String
 
Fc9-type-16-icon.png Topic Type
 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations