Table of Contents
String Error
Outputs the error message string corresponding to a given error code.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Strings')Description
The String Error block outputs the error message string corresponding to a given error code. It does not stop the model but simply outputs the string at its output port. The string that is output always has the maximum length specified in the Maximum length parameter.
The error code is supplied at its input and must be a standard QUARC error code, as output by any of the QUARC blocks that produce an error output. Note that QUARC error codes are negative values. If the input is non-negative then the String Error block outputs the value of the Default string parameter.
At present, the error messages are only output for the current locale.
The String Error block also supports a variable-size output string. To generate a variable-size output string, check the Use variable-size output option. If the output is variable-size, then its width will be equal to the length of the string currently output (including the null terminator). If that length exceeds the maximum length specified in the Maximum length parameter then it is truncated to the maximum length. See Variable-Size Signals for more information on variable-size signals.
Input Ports
err
The QUARC error code for which to retrieve the error message.
Output Ports
str
The error message corresponding to the error code as a string. Strings are represented as a null-terminated
vector of UTF-8 characters or uint8
values whose length is determined by the Maximum length
parameter. The string is always null-terminated. If the Use variable-size output option is checked
then this output is variable-size.
Data Type Support
This block outputs the string as a null-terminated vector of UTF-8 characters or uint8
values. The output
may be a variable-size signal. Refer to Variable-Size Signals
for more information on variable-size signals.
Parameters and Dialog Box
Default string (tunable offline)
The default string to output when the input is not an error code i.e. when the value at the err port is non-negative.
Maximum length
The maximum length of the output string in code units (bytes), including the null-terminator. The output will be a vector of this length.
Use variable-size output
Enabling this option causes the str output to be variable-size. In this case, the size of the output varies with the length of the string, including the null terminator. If this option is not checked then the output is a fixed-size vector equal to the Maximum length. See Variable-Size Signals for more information on variable-size signals.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.