Hi Ben
I would like to write the component propertis at the beginning of the Excel file.
Append string works with a text, but not with the build in function created string.
Does it work the way I program it?
Write component property to sd-card
-
- Valued Contributor
- Posts: 849
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 169 times
- Been thanked: 197 times
Write component property to sd-card
- Attachments
-
- 2024-09-10_15-07-51.PNG (44.02 KiB) Viewed 1005 times
-
- Valued Contributor
- Posts: 849
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 169 times
- Been thanked: 197 times
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Write component property to sd-card
Hello,
Hmm this one is a little tricky as you can't directly reference component properties.
One trick would be to do the following.
1) Click on a blank area of the panel to select the panel and in the properties window create properties to hold the values
2) Add a macro to the Compile Start event and to the Simulation Start event, this can be the same macro for both events
3) Inside the Compiler Start macro copy the value of the property you want to your local property
4) Reference the local properties in your program as you would variables
That should work.
I've included an example.
Let us know how you get on.
Hmm this one is a little tricky as you can't directly reference component properties.
One trick would be to do the following.
1) Click on a blank area of the panel to select the panel and in the properties window create properties to hold the values
2) Add a macro to the Compile Start event and to the Simulation Start event, this can be the same macro for both events
3) Inside the Compiler Start macro copy the value of the property you want to your local property
4) Reference the local properties in your program as you would variables
That should work.
I've included an example.
Let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 849
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 169 times
- Been thanked: 197 times
Re: Write component property to sd-card
Hi Ben
I have tried but I probably only get the index of the switch and not the text of the property
I have tried but I probably only get the index of the switch and not the text of the property
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Write component property to sd-card
Hello,
GetValue returns the property value, if instead you want the label string then use the GetListItem function to get the label assigned to the value.
GetValue returns the property value, if instead you want the label string then use the GetListItem function to get the label assigned to the value.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 849
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 169 times
- Been thanked: 197 times
Re: Write component property to sd-card
Hi Ben
Yes this way is perfect.
Unfortunately working only in the simulation. I cannot compile to hex. There is a fail.
Yes this way is perfect.
Unfortunately working only in the simulation. I cannot compile to hex. There is a fail.
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Write component property to sd-card
Hello,
Compiling now. Could be the sim event macro is missing a return value and the ESP32 compiler is complaining about that.
Just add a calculation saying .Return = 1
Compiling now. Could be the sim event macro is missing a return value and the ESP32 compiler is complaining about that.
Just add a calculation saying .Return = 1
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 849
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 169 times
- Been thanked: 197 times
Re: Write component property to sd-card
Hi Ben
I add but still fail compile to hex. Sim is always ok
I add but still fail compile to hex. Sim is always ok