Main Content

TalkBack Read

Read command(s) from TalkBack ID on ThingSpeak TalkBack server

Since R2021b

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • Raspberry Pi TalkBack Read icon

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

expand all

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 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 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 to ASCII vector.

Data Types: int8

Parameters

expand all

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 to ASCII vector and null when you set the Command Type parameter to String.

  • 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 to ASCII vector and null when you set the Command Type parameter to String.

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:

  1. On the ThingSpeak website, select Apps > TalkBack.

  2. Click New TalkBack.

  3. Add a new command to the TalkBack queue and copy the TalkBack ID.

  4. Open the TalkBack Read block in your Simulink® model and paste the value in the TalkBack ID parameter.

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:

  1. On the ThingSpeak website, select Apps > TalkBack.

  2. Click New TalkBack.

  3. Add a new command to the TalkBack queue and copy the 16-digit API key.

  4. Open the TalkBack Read block in your Simulink model and paste the value in the API key parameter.

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.

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.

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.

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