In thingspeak , how can I visualize two or more channels on one page so I can view different fields from different nodes at a time ?

35 visualizaciones (últimos 30 días)
I'm working on a project that contains several distributed nodes. I assigned one channel for each node. my question is " how can I visualize the data coming from different channels on one page?
  3 comentarios
Alaa
Alaa el 27 de Jul. de 2022
Editada: Alaa el 27 de Jul. de 2022
Thank you Mr.Stapels
You are right . this is first time to work on MATLAB.
Kindly, can you guide me to the "provided template code" you mentioned and any available previous similar projects?
also, I'm planning to buy a student license. can I get "automatically refresh" with this type of license?
Regards,
Christopher Stapels
Christopher Stapels el 2 de Feb. de 2023
Yes, paid licenses allow you to create visualizations that automatically refresh.

Iniciar sesión para comentar.

Respuestas (3)

Christopher Stapels
Christopher Stapels el 28 de Jul. de 2022
In the tabs on the top of the ThingSpeak site, Click on Apps > MATLAB Visualizations then click the green 'New' button, and you will see choices for template code. You can do the same thing to get MATLAB analysis template code as well. The apps are similar, but you need the visualizations app to do visualizations and you can only use code writte in the analysis app for a trigger in React or TimeControl.
For other great examples, see the doc, and click the examples tab. There is an example relating to each of the template codes, for example this one on multi-day visualizations.
  3 comentarios
Christopher Stapels
Christopher Stapels el 2 de Feb. de 2023
To read multiple channels, change the channel id in the thingSpeakRead function. The multi day visualizations does in fact help answer this question in that it shows you how to make consecutive calls to thingSpeakRead, and shows a way to assemble the data. If you take that example and use consecutive reads with different channel id's (and perhaps different field id's), you will have what you indicated in your question. If you are still stuck, please consider starting a new question and describing your issue in detail.
ynit
ynit el 29 de Mayo de 2023
hi, i'm quite new to thingspeak. i would just like to ask how often does it read data from other channels and write data to another channel?

Iniciar sesión para comentar.


loli
loli el 14 de Mayo de 2023
Editada: loli el 14 de Mayo de 2023
% Replace the placeholders with your ThingSpeak channel IDs
channelID1 = 12345; % Channel 1 ID
channelID3 = 67890; % Channel 3 ID
channelID4 = 98765; % Channel 4 ID
% Replace the placeholders with your ThingSpeak read API keys
readAPIKey1 = 'YOUR_READ_API_KEY1';
readAPIKey3 = 'YOUR_READ_API_KEY3';
readAPIKey4 = 'YOUR_READ_API_KEY4';
% Read the data from channel 3
[data3, time3] = thingSpeakRead(channelID3, 'ReadKey', readAPIKey3);
% Read the data from channel 4
[data4, time4] = thingSpeakRead(channelID4, 'ReadKey', readAPIKey4);
% Combine the data from channel 3 and channel 4
combinedData = [data3, data4];
combinedTime = [time3, time4];
% Write the combined data to channel 1
thingSpeakWrite(channelID1, combinedData, 'WriteKey', readAPIKey1, 'TimeStamp', combinedTime);
here i write a code To show channel 4 and channel 3 data in channel 1 on ThingSpeak, you can use MATLAB code or the ThingSpeak API. Here's an example of how you can achieve this using MATLAB code:
i hope you can get it ..
  2 comentarios
ynit
ynit el 29 de Mayo de 2023
hi, i'm quite new to thingspeak. i would just like to ask how often does it update and write data to channel 1?
Christopher Stapels
Christopher Stapels el 30 de Mayo de 2023
Editada: Christopher Stapels el 30 de Mayo de 2023
@ynit Perhaps start a new thread or question. Then you can describe specifically what you mean and we can help you best.

Iniciar sesión para comentar.


loli
loli el 14 de Mayo de 2023
% Replace the placeholders with your ThingSpeak channel IDs
channelID1 = 12345; % Channel 1 ID
channelID3 = 67890; % Channel 3 ID
channelID4 = 98765; % Channel 4 ID
% Replace the placeholders with your ThingSpeak read API keys
readAPIKey1 = 'YOUR_READ_API_KEY1';
readAPIKey3 = 'YOUR_READ_API_KEY3';
readAPIKey4 = 'YOUR_READ_API_KEY4';
% Read the data from channel 3
[data3, time3] = thingSpeakRead(channelID3, 'ReadKey', readAPIKey3);
% Read the data from channel 4
[data4, time4] = thingSpeakRead(channelID4, 'ReadKey', readAPIKey4);
Channel ID must be a positive integer.
% Combine the data from channel 3 and channel 4
combinedData = [data3, data4];
combinedTime = [time3, time4];
% Write the combined data to channel 1
thingSpeakWrite(channelID1, combinedData, 'WriteKey', readAPIKey1, 'TimeStamp', combinedTime);

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre Read Data from Channel en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by