-
-
June 19, 2025 at 3:42 pm
yair.oros
SubscriberHi!
I hope you're having a great day.I'm currently using a "case" block in SCADE Suite to provide text values to a "Text Display" widget in Rapid Prototyper. This widget requires an input of type "char^255". However, the strings I want to display range from 4 to 10 characters long.
I understand that I need to null-terminate the string with '\0' or someting like that, so that it works properly, but I haven’t been able to get the syntax right, and the result after "Check" is "Source Code error".
Here’s what I’ve tried using the word "Vacio" as an example:
"Vacio\0"
("Vacio\0")
('v', 'a', 'c', 'i', 'o', '\0')
concat("Vacio", '\0')
I also attempted to reduce the expected size of the array in Rapid Prototyper, but that didn’t work either.
Do you have any suggestions or best practices for handling this kind of string formatting?
Thanks a lot in advance for your help!
-
June 23, 2025 at 9:33 am
Romain Andrieux
Ansys EmployeeHello,
The NULL string in SCADE Suite is represented in hexadeciamal format:\x0A\x00
I would recommand to store them as constant:
First in SCADE Suite: Tools -> Options -> Set ‘Display Char Arrays as String'
Create a constant for each of string, (you can also create a constant to represent the max string length):
Your model could look like this:
Then in RapidPrototyper you can plug your input to the Text Display widget input:.
The “Text Display” Widget itself doe not accept a reduced length, but you could modify the widget so it can accept it, I can show you how to do it if you need to.
Let me know if that answers your question.
Regards,Romain Andrieux
The ANSYS SCADE Support Team
9 Rue Michel Labrousse / Toulouse , 31100, France
Phone : +33 5 34 60 90 50
https://forum.ansys.com/forums/forum/discuss-simulation/embedded-software/
https://download.ansys.com/Embedded%20Software%20Products
-
June 28, 2025 at 3:03 pm
yair.oros
SubscriberThank you Romain! Your help was really useful.
I achived activate the text display!At one point, I lost the text in the simulation for both the LED and the text display. I only saw the"text" one line above the "legend", as shown in the image.
For the LED, I added a '\x0D' (carriage return), and that solved the issue.
However, the "text" still appears one line above the "legend" — this also happened before I added the '\x0D'.
Do you know what could be causing this extra line?
Or do you think I should change the character size (currently set to 255)? -
June 30, 2025 at 1:05 pm
Romain Andrieux
Ansys EmployeeHello,
I made a mistake in my previous message, \x00 is the end of string char to use, not \x0A !
Also to help when creating aray of string in the Suite Model you can set the following in the .etp Properties-> Layout:
Check the "Fill end of of string with padding character" option and set it to \x00, this way when creating a constant, it will be filled with NULL chars:
Hope this helps !
Regards
Regards,
Romain Andrieux
The ANSYS SCADE Support Team
9 Rue Michel Labrousse / Toulouse , 31100, France
Phone : +33 5 34 60 90 50
https://forum.ansys.com/forums/forum/discuss-simulation/embedded-software/
-
- You must be logged in to reply to this topic.
-
3467
-
1057
-
1051
-
918
-
896
© 2025 Copyright ANSYS, Inc. All rights reserved.