Sending a character string ?

5 ビュー (過去 30 日間)
Stéphan Clark
Stéphan Clark 2022 年 1 月 30 日
コメント済み: Stéphan Clark 2022 年 2 月 5 日
Is it possible to send a character string (non-numeric) in a field? Of course, no numerical analysis would be possible and it would not be possible to plot the data in a graphic, but I would need that as sort of a log file for special events.
  3 件のコメント
Stéphan Clark
Stéphan Clark 2022 年 1 月 30 日
Hi,
Using the simple REST interface with a GET, I'd like to send a string rather that just a number in a data field, for instance, field1. The sent string could be stored by the ThingSpeak server in a file or otherwise for further processing. From what I can see, it only seems possible to send numbers (or dates). Am I missing something ?
Christopher Stapels
Christopher Stapels 2022 年 1 月 31 日
編集済み: Christopher Stapels 2022 年 1 月 31 日
You can send strings. As you said, the automatic field plots wont work but string data is accepted. To read the data in MATLAB, use thingSpeakRead(...'outputformat','timetable') to get the string data. When you read with the REST API, no modification is required for the string data.

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

回答 (2 件)

Stéphan Clark
Stéphan Clark 2022 年 2 月 4 日
編集済み: Stéphan Clark 2022 年 2 月 4 日
Thank you Christopher.
I was hoping there would already be a way to easily read those strings (alike there is for viewing numerical data in graphics, in a simple text file or something). If it's not the case, then I'll have not other solution than to dig into your suggestion.

Christopher Stapels
Christopher Stapels 2022 年 2 月 4 日
Write the data to the status field (...&status=myStatus... ), and then set 'show status" in your channel settings.
  1 件のコメント
Stéphan Clark
Stéphan Clark 2022 年 2 月 5 日
Sounds like a reasonnable workaround. I'll try that.
Thank you.

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

コミュニティ

その他の回答  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