Jump to content

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

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(4 intermediate revisions by the same user not shown)
Line 94: Line 94:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect'''
| width="90%" class="mtx-class-macrohead" | '''Connect'''
|-
|-
| colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.  
| colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.  
Line 108: Line 108:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disconnect'''
| width="90%" class="mtx-class-macrohead" | '''Disconnect'''
|-
|-
| colspan="2" | Disconnects from the MQTT server and the network 
| colspan="2" | Disconnects from the MQTT server and the network 
Line 122: Line 122:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ErrorAsString'''
| width="90%" class="mtx-class-macrohead" | '''ErrorAsString'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 141: Line 141:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadFloat'''
| width="90%" class="mtx-class-macrohead" | '''GetPayloadFloat'''
|-
|-
| colspan="2" | Get the Payload of the last received (Read) packet as a floating point value 
| colspan="2" | Get the Payload of the last received (Read) packet as a floating point value 
Line 155: Line 155:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadInteger'''
| width="90%" class="mtx-class-macrohead" | '''GetPayloadInteger'''
|-
|-
| colspan="2" | Get the Payload of the last received (Read) packet as a signed long value 
| colspan="2" | Get the Payload of the last received (Read) packet as a signed long value 
Line 169: Line 169:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadString'''
| width="90%" class="mtx-class-macrohead" | '''GetPayloadString'''
|-
|-
| colspan="2" | Get the Payload of the last received (Read) packet as a string value 
| colspan="2" | Get the Payload of the last received (Read) packet as a string value 
Line 193: Line 193:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTopicID'''
| width="90%" class="mtx-class-macrohead" | '''GetTopicID'''
|-
|-
| colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. 
| colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. 
Line 207: Line 207:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component. 
| colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component. 
Line 221: Line 221:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LastError'''
| width="90%" class="mtx-class-macrohead" | '''LastError'''
|-
|-
| colspan="2" | Returns the last error 
| colspan="2" | Returns the last error 
Line 235: Line 235:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Ping'''
| width="90%" class="mtx-class-macrohead" | '''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  
| 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  
Line 249: Line 249:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishFloat'''
| width="90%" class="mtx-class-macrohead" | '''PublishFloat'''
|-
|-
| colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful 
| colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful 
Line 273: Line 273:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishInteger'''
| width="90%" class="mtx-class-macrohead" | '''PublishInteger'''
|-
|-
| colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful 
| colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful 
Line 297: Line 297:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishString'''
| width="90%" class="mtx-class-macrohead" | '''PublishString'''
|-
|-
| colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful 
| colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful 
Line 321: Line 321:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
| width="90%" class="mtx-class-macrohead" | '''Read'''
|-
|-
| colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. 
| colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. 
Line 336: Line 336:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | MQTT Properties
| width="90%" class="mtx-class-propfolder" | MQTT Properties
|-
|-
|-
|-
Line 384: Line 384:
| colspan="2" | Selects if the broker is open or if the broker requires a username and password. 
| colspan="2" | Selects if the broker is open or if the broker requires a username and password. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topics
| width="90%" class="mtx-class-propfolder" | Topics
|-
|-
|-
|-
Line 393: Line 393:
| colspan="2" | Sets the number of data topics that can be sent or received 
| colspan="2" | Sets the number of data topics that can be sent or received 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 0
| width="90%" class="mtx-class-propfolder" | Topic ID: 0
|-
|-
|-
|-
Line 407: Line 407:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 1
| width="90%" class="mtx-class-propfolder" | Topic ID: 1
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_IoTMadeEasy.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_IoTMadeEasy.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

Connect

Connect
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.  
- BYTE Return


Disconnect

Disconnect
Disconnects from the MQTT server and the network 
- BYTE Return


ErrorAsString

ErrorAsString
 
- BYTE Error
 
- STRING Return


GetPayloadFloat

GetPayloadFloat
Get the Payload of the last received (Read) packet as a floating point value 
- FLOAT Return


GetPayloadInteger

GetPayloadInteger
Get the Payload of the last received (Read) packet as a signed long value 
- LONG Return


GetPayloadString

GetPayloadString
Get the Payload of the last received (Read) packet as a string value 
- STRING Payload
 
- BYTE Size
 
- BYTE Return


GetTopicID

GetTopicID
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. 
- BYTE Return


Initialise

Initialise
Starts up the MQTT component - call this after initialising the NetworkComms component. 
- VOID Return


LastError

LastError
Returns the last error 
- BYTE Return


Ping

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  
- BYTE Return


PublishFloat

PublishFloat
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful 
- BYTE TopicID
The topic ID to publish data to 
- FLOAT Data
Data to publish 
- BYTE Return


PublishInteger

PublishInteger
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful 
- BYTE TopicID
The topic ID to publish data to 
- LONG Data
Data to publish 
- BYTE Return


PublishString

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


Read

Read
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. 
- UINT Return


Property reference

Properties
MQTT Properties
LinkTo
 
Host
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms) 
Port
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access. 
Client identifier
Client identifier (Maximum length 20 characters) Must be unique to the broker. 
Network Timeout
Maximum time in mS to wait for network responses 
Read Timeout
Time to wait in ms when waiting for incoming messages 
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. 
Authentication
Selects if the broker is open or if the broker requires a username and password. 
Topics
Number of topics
Sets the number of data topics that can be sent or received 
Topic ID: 0
Topic String
 
Topic Type
 
Topic ID: 1
Topic String
 
Topic Type