TalkBack Read
Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.
Libraries:
Simulink Support Package for Raspberry Pi Hardware /
Internet Of Things
Description
The TalkBack Read block reads command(s) from a TalkBack ID on the ThingSpeak TalkBack server. The block reads the commands in the TalkBack server queue in the first-in first-out (FIFO) order and are removed from the queue once executed.
Ports
Output
Command string — String command read by the block
scalar
String command read by the block from the TalkBack server, returned as a string scalar.
Dependencies
To enable this port, set Command Type to
String
.
Data Types: string
Ascii command — ASCII command read by the block
vector
ASCII command read by the block from the TalkBack server, returned as a vector.
Dependencies
To enable this port, set Command Type to
ASCII vector
.
Data Types: uint8
Status — Status of TalkBack command(s)
0
| 1
| 2
| 3
Status of the last command executed by the TalkBack server. The block outputs the
status on the Status depending on the option you select in the
TalkBack API parameter. For example, if the
TalkBack API parameter is set to Last
executed command
, the output would indicate the status for the
Last executed command
option.
0
— Indicates a failure in TalkBack command execution or an empty TalkBack queue.1
— Indicates successful TalkBack command execution.2
— Indicates the command string is truncated.3
— Indicates the command is appended with zeros only when the Command Type parameter is set toASCII vector
.
Data Types: int8
Parameters
TalkBack API — Operation to be performed on TalkBack command
Execute next command
(default) | Last executed command
Select the operation to be performed on the TalkBack command in the TalkBack queue.
Execute next command
— The block asks the TalkBack server to execute the next command in the TalkBack queue. The block reads this command and outputs a string or an ASCII vector depending on the option you set in the Command Type parameter. If no command is present in the TalkBack queue, the block outputs zeros when you set the Command Type parameter toASCII vector
and null when you set the Command Type parameter toString
.Last executed command
— The block asks the TalkBack server to output the last executed command in the TalkBack queue. The block reads this command and outputs it as a string or an ASCII vector depending on the option you set in the Command Type parameter. If no command is present in the TalkBack queue, the block outputs zeros when you set the Command Type parameter toASCII vector
and null when you set the Command Type parameter toString
.
TalkBack ID — TalkBack app identification number
123456 (default) | positive integer
Enter the identification number of the TalkBack app. This identification number is autogenerated by the TalkBack server. To find the TalkBack ID for your TalkBack channel:
On the ThingSpeak website, select Apps > TalkBack.
Click New TalkBack.
Add a new command to the TalkBack queue and copy the TalkBack ID.
Open the TalkBack Read block in your Simulink® model and paste the value in the TalkBack ID parameter.
API key — Autogenerated API key for TalkBack channel
ABCDEFGHIJKLMNOP (default) | character vector | string scalar
Enter the 16-digit API key for the specific instance of TalkBack that allows you to read from a TalkBack channel. This API key is autogenerated by the TalkBack server. To find the API key for your TalkBack channel:
On the ThingSpeak website, select Apps > TalkBack.
Click New TalkBack.
Add a new command to the TalkBack queue and copy the 16-digit API key.
Open the TalkBack Read block in your Simulink model and paste the value in the API key parameter.
Command Type — Type of command output added to TalkBack queue
String
(default) | ASCII vector
Select the type of TalkBack command output to be added to the TalkBack queue.
String
— TalkBack command in string format.ASCII vector
— TalkBack command in ASCII format.
Command Length — Length of command
1 (default) | 255
Enter the length of the command in the TalkBack queue. If the name of the command is less than the value entered in this parameter, the command is appended with zeros to match the length. If the name of the command is more than the value entered in this parameter, the length is truncated to the value entered in this parameter.
Print diagnostic messages — Save TalkBack server response to log file
off (default) | on
Select this parameter to save the response from the TalkBack server to a log file
for each read request. Identify this request with a header named
TALKBACK_DIAG_MSG:
. The name of the log file has the format
<model_name>.log
.
Sample time — Time interval at which block reads data
5 (default) | scalar
Enter the time interval (in seconds) at which the block reads data from the TalkBack
channel. When you set this parameter to -1
, Simulink determines the best sample time for the block based on the block's context
within the model.
Version History
Introduced in R2021b
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)