Effacer les filtres
Effacer les filtres

Bulk update with thingSpeakWrite to a specified field

1 vue (au cours des 30 derniers jours)
Manfred
Manfred le 4 Mai 2023
Commenté : Manfred le 4 Mai 2023
In the thingSpeakWrite documentation is an example, how to upload a table of data
....
thingSpeakWrite(writeChannelID,dataTable,'WriteKey',writeAPIKey);
This works, but the data are uploaded in Field1. How can i specifie the field - for example field 5?
thingSpeakWrite(writeChannelID,'Fields',[5],dataTable,'WriteKey',writeAPIKey);
or
thingSpeakWrite(writeChannelID,'Fields',[5],'Values',dataTable,'WriteKey',writeAPIKey);
did not work.

Réponse acceptée

Christopher Stapels
Christopher Stapels le 4 Mai 2023
Modifié(e) : Christopher Stapels le 4 Mai 2023
myDates=datetime(2023,1,1):days(1):datetime(2023,1,10)
nullVec=string.empty(10,0);
myNums=1:10;
myTimeTable=table(myDates',nullVec,nullVec,nullVec,nullVec,myNums')
thingSpeakWrite(nnnnnnnnn,myTimeTable,'writeKey','xxxxxxxxxxxxxxxx')

Plus de réponses (1)

Christopher Stapels
Christopher Stapels le 4 Mai 2023
Make your data table with the first four columns of null values.
  1 commentaire
Manfred
Manfred le 4 Mai 2023
Modifié(e) : Manfred le 4 Mai 2023
i tryed
dataField = [null,null,null,null,1;null,null,null,null,2;null,null,null,null,3;null,null,null,null,4;null,null,null,null,5;null,null,null,null,6;null,null,null,null,7;null,null,null,null,8;null,null,null,null,9;null,null,null,null,10];
and
dataField = [,,,,1;,,,,2;,,,,3;,,,,4;,,,,5;,,,,6;,,,,7;,,,,8;,,,,9;,,,,10];
and got the Error:
"Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters."

Connectez-vous pour commenter.

Communautés

Plus de réponses dans  ThingSpeak Community

Catégories

En savoir plus sur ThingSpeak dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by