LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

myrio - global variable in .m file

I'm using ode_rk45 in mathscript and I'm using global variables in my differential equations.

In Labview Simulation the keyword "global" is working fine but in MyRio its generating an error.

This is the function I'm using ode_rk45 to solve it :

 

function dzAdt = lorenzT(t, y)
               global A;
               global B;
               dzAdt=zeros(3,1);
               dzAdt(1)= A*cos(y(3))  ;  
               dzAdt(2)= B*sin (y(3)) ;
               dzAdt(3)=A;

And this is my main program code :

 

 

global A;
global B;
A = 5;
B = 6;
[t,y] = ode_rk45('LorenzT',[1 ;3],[0.1 ; 0.2 ; 0.5])

 

Is there any way to use my A and B values in the differential equations ?

0 Kudos
Message 1 of 3
(2,757 Views)

Hi youssef007

 

Could you be more specific with the error you are seeing with the myRIO.

 

0 Kudos
Message 2 of 3
(2,694 Views)

Hi Rairiki, here is the error :

Error in function global at line 1:  This function is not supported on the current hardware target.

 

this error is pointed on the line 1 on :

global A;
0 Kudos
Message 3 of 3
(2,661 Views)