thingspeakwrite - data table to field X in channel | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

8   +   6   =  

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
thingspeakwrite - data table to field X in channel
No permission to create posts
May 14, 2020
4:24 am
Avatar
barekpl
New Member
Members
Forum Posts: 1
Member Since:
May 14, 2020
sp_UserOfflineSmall Offline

Hello,

I've got problem with thingspeakwrite function,
I've read documentation here: https://www.mathworks.com/help/thingspeak/thingspeakwrite.html, but there is no information about my issue, moreover I spend some time searching it in other places, and there is no response 🙁
My issue:
I've got data table like this:

dataTable =
10x1 timetable
cleanTimeStamps cleanWeatherData
____________________ ________________
14-May-2020 08:01:15 18.69
14-May-2020 08:02:16 18.56
14-May-2020 08:03:17 18.62
14-May-2020 08:04:18 18.75
14-May-2020 08:05:19 18.19
14-May-2020 08:06:19 18.19
14-May-2020 08:07:20 18.87
14-May-2020 08:08:21 18.19
14-May-2020 08:09:22 18.81
14-May-2020 08:10:23 18.75

I need to put this to field X in channel, where X is not 1.
I know that it is easy to put this to field 1, it can be done like this:
thingSpeakWrite(channelId, [dataTable],'WriteKey',writeAPIKey);
or this:
thingSpeakWrite(channelId, cleanWeatherData, 'Timestamp', cleanTimeStamps, 'WriteKey', writeAPIKey);
where dataTable = timetable(cleanTimeStamps,cleanWeatherData);

But is it possible to write it to field 3?

Have a nice day,
Bart

May 19, 2020
3:08 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 861
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

There is a fields name value pair.
Try this:

thingSpeakWrite(channelId, cleanWeatherData, 'Timestamp', cleanTimeStamps, 'WriteKey', writeAPIKey,'fields',[3]);

You can also write null values to the first two columns of your data table and it will write the data you are interested in to field 3.

FYI, MATLAB answers is the preferred location for ThingSpeak Community support.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
29 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

briskpanda, Dejw0089, Yassine Ben Salah, anis, 43994554AKS, suda

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457