Jump to content

Using a Shared Library (VxWorks compiled C code)


Recommended Posts

I am looking to write a dll that performs some math operations for a RT system on cRIO 9012. The C (dll) code is compiled in using the GNU tool chain for VxWork.

I figured to start small with a basic dll and once I had that working and was comfortable expand on it. I am running into a couple hiccups though.

Here is the dll file

#include <stdio.h>   #include <stdlib.h>   #include <math.h>      extern "C"    {	   double testDLL(double arg_A, double arg_B)	   {		   return(arg_A + arg_B);	   }   } extern "C" double testDLL(double arg_A, double arg_B);

and here is the test vi program I wrote

post-5846-1238515688.jpg?width=400

When I right click on the call library function on the block diagram and configure the parameters, they are set as follows.

return type has the type "Numeric"

arg1 has the type "Numeric" and data type "Signed 32-bit Integer" and pass by "Value"

arg1 has the type "Numeric" and data type "Signed 32-bit Integer" and pass by "Value

What I don't understand is what the return type is the same as arg 1.

Any insights?

Thanks in advance.

-fillalph

Link to comment
QUOTE
When I right click on the call library function on the block diagram and configure the parameters, they are set as follows.
You say "they are set as follows." Does this mean that LV filled in those values for you or you configured them this way? I ask because that configuration is obviously wrong. The data type for your return type and both args should be double, not integer.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.