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 ビュー (過去 30 日間)
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 件のコメント
Alaa
Alaa 2022 年 7 月 27 日
編集済み: Alaa 2022 年 7 月 27 日
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 2023 年 2 月 2 日
Yes, paid licenses allow you to create visualizations that automatically refresh.

サインインしてコメントする。

回答 (3 件)

Christopher Stapels
Christopher Stapels 2022 年 7 月 28 日
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 件のコメント
Christopher Stapels
Christopher Stapels 2023 年 2 月 2 日
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 2023 年 5 月 29 日
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?

サインインしてコメントする。


loli
loli 2023 年 5 月 14 日
編集済み: loli 2023 年 5 月 14 日
% 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 件のコメント
ynit
ynit 2023 年 5 月 29 日
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 2023 年 5 月 30 日
編集済み: Christopher Stapels 2023 年 5 月 30 日
@ynit Perhaps start a new thread or question. Then you can describe specifically what you mean and we can help you best.

サインインしてコメントする。


loli
loli 2023 年 5 月 14 日
% 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);

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeRead Data from Channel についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by