LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing array to call library function running on VxWorks (cRIO)

Hello,

I am using a cRIO 9012 running VxWorks.
I have a Call library function VI in my application and I want to pass arrays of doubles to this function.
The problem is that I can not access the values in the array.

Here is the source code of my function:
/****/
#include "D:\\Programme\\National Instruments\\LabVIEW 8.5\\cintools\\extcode.h"
double avg_num(double *in1, double *out1)
{
    double ret;
    ret = in1[0] + out1[0];
    return ret;
}
/****/

The value of in1[0] and out1[0] is always.

When passing no arrays but single values, all is fine. But since my application is more complex than this example, I need to pass arrays.
The block diagram and parameter specification is as shown in the attached screenshots.

I am compiling the source code with the Gcc 6.3 which is available here:
http://zone.ni.com/devzone/cda/tut/p/id/5694

What am I doing wrong?
Or is passing arrays not supported on cRIO?
Maybe the makefile needs to be modified?

Thank you.

Best regards,

Christian



Download All
0 Kudos
Message 1 of 2
(2,691 Views)
I guess I have solved the problem.
The key was to set the parameter "Minimum size" for all function parameters to <None>.
Having this, I can read the passed arrays. I do not know why this works but at the moment, it is ok for me.

Thank you all.
0 Kudos
Message 2 of 2
(2,676 Views)