ThingSpeak Write
Publish data to Internet of Things using ThingSpeak
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
fieldn — nth field input signal
numeric scalar
n
th 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 — Location data
three-element numeric vector
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
Channel ID — Channel ID of ThingSpeak channel
123456
(default) | nonnegative scalar
Specify the ThingSpeak channel to which you want to write data. Use the ID from your channel on the ThingSpeak website.
Write API key — Write API key of ThingSpeak channel
no default (default) | character vector
Specify the write API key of the ThingSpeak channel. Use the API key from your channel in ThingSpeak.
Numer of fields — Number of fields of ThingSpeak channel
1
(default) | 2
| 3
| 4
| 5
| 6
| 7
| 8
Set the number of fields of the ThingSpeak channel to which you want to send data.
Update interval (seconds) — Data update interval
60
(default) | nonnegative scalar
Specify the time interval at which the input data is updated on the ThingSpeak channel.
Send location information — Option to send location information
off (default) | on
Select this parameter to send the location information of your device to the ThingSpeak channel.
Location source — Location source
Block dialog
(default) | Input port
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]
.
Location (latitude, longitude, altitude) — Location information
no default (default) | three-element numeric vector
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)