How can I validate Model Configuration Inputs

2 views (last 30 days)
I'm working on a System Target in Simulink Coder and want the user to enter data into a prompt within the model configuration pane. Therefor I added the prompt to the pane using the rtwoptions structure and added an option-callback function. Within this function I check the user input against a regular expression and want to create a standard RTW Options error message with an own message string inside the standard RTW error dialog. Rising the error with the error() function or by throwing an exception results in following behavior:
  • The RWT error dialog opens
  • A message "The code generation option [...] has invalid settings in its callback field [...]
Now the questions * Is this the correct way to validate user inputs? * How can I specify an own error message? * How can I force the user to enter valid data before the compilation?
Thanks in advance.

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!