Unrecognized variable name 'Field5' - working in other channels but not this one? (I am very new to this!)

2 views (last 30 days)
% Channel ID to read data from readChannelID = 117***; % Temperature Field ID TemperatureFieldID = 3;
% Channel Read API Key % If your channel is private, then enter the read API % Key between the '' below: readAPIKey = 'N7G********EMYID';
% TODO - Replace the [] with channel ID to write data to: writeChannelID = 182***; % TODO - Enter the Write API Key between the '' below: writeAPIKey = '5M8********5L2F'; %Temperature field to write to
[tempC, timeStamp] = thingSpeakRead(readChannelID, 'Fields', TemperatureFieldID, 'numMinutes', 1440, 'ReadKey', readAPIKey);
% Calculate the mimium temperature [minTempC, minTempIndex] = min(tempC);
% Choose the timestamp at which the maximum temperature was measured timeMinTemp = timeStamp(minTempIndex);
display(minTempC, 'Minimum Temperature for the last 24 hours is');
% Write the maximum temperature to another channel specified by the % 'writeChannelID' variable
display(['Note: To successfully write data to another channel, ',... 'assign the write channel ID and API Key to ''writeChannelID'' and ',... '''writeAPIKey'' variables above. Also uncomment the line of code ',... 'containing ''thingSpeakWrite'' (remove ''%'' sign at the beginning of the line.)'])
% Learn more about the THINGSPEAKWRITE function by going to the Documentation tab on % the right side pane of this page.
thingSpeakWrite(writeChannelID, minTempC, 'timestamp', timeMinTemp, 'fields', 6, 'Writekey', writeAPIKey);
  1 Comment
Vinod
Vinod on 18 Apr 2017
Looking at the code above, there is no reference to Field5. It appears you are writing to Field6.
I'm not sure if your question is resolved. Please add a comment if you need help.

Sign in to comment.

Answers (0)

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Prepare and Analyze Data in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!