String Processing Block¶
How this block appears in a Simulink model?¶
Function: sprintf¶
Function: sscanf¶
Function: strlen¶
Function: strcmp¶
Function: strncmp¶
Function: strextract¶
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,- if Return value < 0 then it indicates str1 is less than str2.
- if Return value > 0 then it indicates str2 is less than str1.
- if Return value = 0 then it indicates str1 is equal to str2.
strncmp¶
Parameters,- S1 = This is the first string to be compared.
- S2 = This is the second string to be compared.
- Num = the maximum number of characters to be compared.
- if Return value < 0 then it indicates str1 is less than str2.
- if Return value > 0 then it indicates str2 is less than str1.
- 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¶
Previous : Memory Block
Next : Camera Data Receiver Block