How to use StringInit Component to push a value in ROM ?

Discuss PC Developer and Web Developer projects and features here.
Post Reply
User avatar
Nico595
Posts: 95
http://meble-kuchenne.info.pl
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 18 times
Been thanked: 4 times

Flowcode v10 How to use StringInit Component to push a value in ROM ?

Post by Nico595 »

Hello,

I need to push user value in a ROM array to save mqtt username and password in the C code. I tried with StringInit Component but when I push a new value in "Str0", this variable is not saved when I restart the Pc App.

This function is it possible without design a txt file ?

1 - I set the box with the Str0 string.
2 - I enter a new string and save in Str0.
3 - I read the string from Str0.

It's ok, I have my new string in step 3 but the new string is lost if I restart the Pc App. I start with the string of step 1, registered in the Str0 parameter.



Capture d’écran 2025-05-09 134918.png
Capture d’écran 2025-05-09 134918.png (156.55 KiB) Viewed 1437 times


Thank you for your advices.

medelec35
Matrix Staff
Posts: 1954
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 626 times
Been thanked: 656 times

Re: How to use StringInit Component to push a value in ROM ?

Post by medelec35 »

Hello.
If you want to use properties to store and load values, then you can use the Property Manager (Component Libraries > Storage > Utility).
It will crate a file for you, so all the hard work is removed.
Alternatively, if you attach your project, I can see if there is a better way of achieving desired results.
Martin

User avatar
Nico595
Posts: 95
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 18 times
Been thanked: 4 times

Re: How to use StringInit Component to push a value in ROM ?

Post by Nico595 »

Hello Martin,

It's probably a perfect tool to save the variables in a .cfg file but have you an example or a method ? What is the good syntax to use the RegisterProperty Function ?

The config.cfg file is not wrote with a Save.

Capture d’écran 2025-05-09 181335.png
Capture d’écran 2025-05-09 181335.png (40.56 KiB) Viewed 1372 times



Thank you :)

medelec35
Matrix Staff
Posts: 1954
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 626 times
Been thanked: 656 times

Re: How to use StringInit Component to push a value in ROM ?

Post by medelec35 »

If you attach your project, I will see what I can do with it.
Martin

User avatar
Nico595
Posts: 95
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 18 times
Been thanked: 4 times

Re: How to use StringInit Component to push a value in ROM ?

Post by Nico595 »

I finally used the CSV Read Write Component to save and read variables in a config.cfg.
As this data content is password and username, I will encrypt the data before the save.

Thank you for your help.

Post Reply