Main Content

ThingSpeak Write

Publish data to Internet of Things using ThingSpeak

  • ThingSpeak Write block

Libraries:
Simulink Support Package for Apple iOS Devices / Communication

Description

The ThingSpeak Write block publishes input data from target hardware to the ThingSpeak cloud server.

ThingSpeak is a web service for Internet of Things applications. It provides real-time data collection, data processing, visualizations, apps, and plugins.

For more information on how to use ThingSpeak, see ThingSpeak Apps, Plugins, or Tutorials.

Ports

Input

expand all

nth field input signal, specified as a numeric scalar.

For example, if you set the Number of fields parameter to 2, the block enables two 2 input ports with port names field1 and field2, respectively. The block publishes the inputs received on field1 and field2 ports to field1 and field2 of the ThingSpeak channel, respectively.

This port is unnamed if the Number of fields parameter is 1. The block publishes the input received on this unnamed port to field 1 of the specified ThingSpeak channel.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean

Location data, specified as a three-element numeric vector of the form [latitude, longitude, altitude].

Dependencies

To enable this port, set the Location source parameter to Input port.

Data Types: single | double

Parameters

expand all

Main

Specify the ThingSpeak channel to which you want to write data. Use the ID from your channel on the ThingSpeak website.

Specify the write API key of the ThingSpeak channel. Use the API key from your channel in ThingSpeak.

Set the number of fields of the ThingSpeak channel to which you want to send data.

Specify the time interval at which the input data is updated on the ThingSpeak channel.

Optional

Select this parameter to send the location information of your device to the ThingSpeak channel.

Select the source of the location data.

  • Block dialog — Specify the location using the Location (latitude, longitude, altitude) parameter.

  • Input port — Specify the location using the location input port.

Use decimal degrees notation to specify latitude and longitude. Use meters to specify altitude. For example:

  • The lowest human-sized point underground, the TauTona Mine in Carletonville, South Africa, is [-26.416111,27.4275,-3900].

  • The highest point measured from sea level, the summit of Mount Everest in Nepal, is [27.988056,86.925278,8848].

Specify the location information as a three-element numeric vector of the form [latitude, longitude, altitude] to update on the ThingSpeak channel.

Dependencies

To enable this parameter, set the Location source parameter to Block dialog.

Version History

Introduced in R2016b