Project

General

Profile

String Processing Block

How this block appears in a Simulink model?

Function: sprintf

appearance_sprintf.PNG

Function: sscanf

appearance_sscanf.PNG

Function: strlen

appearance_strlen.PNG

Function: strcmp

appearance_strcmp.PNG

Function: strncmp

appearance_strncmp.PNG

Function: strextract

appearance_strextract.PNG

What can be configured?

Function: sprintf

Configuration Parameter Selectable Option/Value Description
Format Enter the format of the output string.
Buffer size Enter the size of the output buffer.
Enable output status Check--Uncheck Return the number of success parameters.
Sample time (sec) -1 (inherited or specify Specify the sample time.

Function: sscanf

Configuration Parameter Selectable Option/Value Description
Format Enter the format of the output string.
Buffer size Enter the size of the output buffer.
Enable output status Check--Uncheck Return the number of success parameters.
Sample time (sec) -1 (inherited or specify Specify the sample time.

Function: strlen

Configuration Parameter Selectable Option/Value Description
Sample time (sec) -1 (inherited or specify Specify the sample time.

Function: strcmp

Configuration Parameter Selectable Option/Value Description
Buffer size Enter the size of the buffer.
Sample time (sec) -1 (inherited or specify Specify the sample time.

Function: strncmp

Configuration Parameter Selectable Option/Value Description
Buffer size Enter the size of the buffer.
Sample time (sec) -1 (inherited or specify Specify the sample time.

Function: strextract

Configuration Parameter Selectable Option/Value Description
Begin delimiter Enter the starting point.
End delimiter Enter the end point.
Buffer size Enter the size of the buffer.
Sample time (sec) -1 (inherited or specify Specify the sample time.

When to use this block?

This block is used to do string processing available in C programming.

How does this block work?

The following functions are available in this block,

sprintf

Sends formatted output to a string pointed to. It will take the inputs and put it in a single string in the format user has specified.

sscanf

Reads formatted input from a string.

strlen

Calculate the length of the string.

strcmp

Compares the two strings provided. This function return values that are as follows,
  1. if Return value < 0 then it indicates str1 is less than str2.
  2. if Return value > 0 then it indicates str2 is less than str1.
  3. if Return value = 0 then it indicates str1 is equal to str2.

strncmp

Parameters,
  1. S1 = This is the first string to be compared.
  2. S2 = This is the second string to be compared.
  3. Num = the maximum number of characters to be compared.
This function return values that are as follows,
  1. if Return value < 0 then it indicates str1 is less than str2.
  2. if Return value > 0 then it indicates str2 is less than str1.
  3. if Return value = 0 then it indicates str1 is equal to str2.

strextract

This function extracts the string between begin delimiter and end delimiter.

Demo

WIFI demo

Previous : Memory Block
Next : Camera Data Receiver Block

Also available in: PDF HTML TXT