LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Code Of Matlab Node

Solved!
Go to solution

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,

Matlab to textMatlab to text

0 Kudos
Message 1 of 7
(2,910 Views)

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.

Get Formula Expression.png

cheers!



Remember Cunningham's Law
Message 2 of 7
(2,891 Views)

thank you Peter,

But it cannot work in run time mode.

 

0 Kudos
Message 3 of 7
(2,883 Views)
Solution
Accepted by taoufiksmires

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(2,880 Views)
Solution
Accepted by taoufiksmires

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.


"Should be" isn't "Is" -Jay
Message 5 of 7
(2,876 Views)
Solution
Accepted by taoufiksmires

@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?



Remember Cunningham's Law
Message 6 of 7
(2,861 Views)

thanks to you guys . It's good , Before i build the application i save my script in a file and i read it after. 

0 Kudos
Message 7 of 7
(2,853 Views)