10-10-2018 05:09 AM
Hello,
I wan't to get the code of my Matlab node programatically in the run-time mode just for displaying it.
Thank for all,
Solved! Go to Solution.
10-10-2018 06:17 AM
Hi,
I don't know if this is the best way, but as soon as you have a reference to the formula node, you can read the Formula Expression property. To get the reference, some scripting might be necessary.
cheers!
10-10-2018 07:00 AM
thank you Peter,
But it cannot work in run time mode.
10-10-2018 07:23 AM
Hi taoufiksmires,
the Matlab script doesn't change at runtime so you can copy the text at edit time to a string constant!
Or: place the matlab code in a m-script-file. You can load that file using ReadTextFile to display it in a string indicator…
10-10-2018 07:35 AM
Or, use a sub panel! Oh yeah, we don't do that often but the sub panel can show the block diagram. Sized properly just the m node can be shown. And you can get the bounds at runtime.
10-10-2018 08:06 AM
@taoufiksmires wrote:
thank you Peter,
But it cannot work in run time mode.
I'm not sure, I understand. I ran it and it worked and as GerdW said, the script doesn't change at runtime.
Can you please tell me what you want to do, that doesn't work?
10-10-2018 08:12 AM
thanks to you guys . It's good , Before i build the application i save my script in a file and i read it after.