From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.dll output dimension

Hello,

 

Im trying to implement a state observer (EKF) designed in Matlab, and compilled into a shared library (.dll). I was able to import the library using the import shared library tool and implement it in my code.

 

However, the dimensions of the outputs are not correct. My outputs are all 1D arrays, and the outputs are 2x bigger than they should be (i.e. 44 instead of 22, etc).

 

Here is my function prototype:

 

extern void EKF_Labview(real_T x[22], real_T P[484], const real_T u[4], const real_T z[9], real_T Accel_Q, real_T Moment_Q, real_T df_Q, real_T dm_Q, real_T bw_Q, real_T Pos_R, real_T Att_R, real_T Gyro_R, const struct_T Param, real_T State[12], real_T Dist[6]);

 

Where X,P is an input/output, and Dist/State an output.

 

Is this working as intended? What am i missing?

 

Thanks,

Alex

0 Kudos
Message 1 of 2
(2,079 Views)

Hi Alex,

 

what exactly do you mean with your outputs have the doubled dimension? Do arrays have a size doubled as expected or are the values in the arrays doubled as expected or do you have to many arrays given back?

 

By the way, have you checked your Matlab-Code for any bugs?

 

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 2 of 2
(2,031 Views)