LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global MATLAB variable persistence within a MATLAB Session

Hello Forum - I have an issue accessing a global variables from across different Call MATLAB Function nodes (CMF) that share the same MATLAB session.  I haven't been able to get it to work and with the lack of documentation on this node I am not sure if this should work.
I am following the rules for the CMF nodes and following the guidance of MATLAB colleagues.

LabVIEW

1) Open MATLAB Session called

2) CMF specifying write.m with no return type defined. Wire session in and out

3) CMF specifying read.m with string return type defined. Wire session in and out

4) Close MATLAB Session

 

MATLAB

1) declaring a global var and defining var = 'set_here'  in the first write.m script.

2) declaring a global var and reading return_string = var and in the read.m script.

 

>> Error: MATLAB call returned the following error: Expected: string, but got: unknown type.

 

Troubleshooting steps taken:

1) Verified the Session is the same

2) Verified that the read() function does return a string

 

Should the global variable var persist in the MATLAB session?

0 Kudos
Message 1 of 1
(81 Views)