Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling VxWorks .out library functions on the cRio-9022 with Labview

We have purchased a cRIO-9022 controller (VxWorks 6.3) and are using Labview Realtime 2009. I compiled a .out file using workbench and loaded and executed it fine directly in VxWorks through the console. Now i am trying to call this same function directly through Labview. I placed the .out file into the ni-rt/system folder on the cRIO. I then created a "Call Library Function Node" in a very simple block diagram and specified the function call name in the configuration. I created a stub DLL file with one function prototype as i saw in one of the KB articles and placed that in a ni-rt/system folder on the host (relative to where my main VI was located). When i attempt to deploy, i receive the non-descriptive error: "LabVIEW:  Failed to load shared library object_mod_name.*:function_name:C on RT target device.". The other thing i am noticing is that i don't see where my object module is getting loaded into memory. By placing the .out file into the ni-rt/system folder should it automatically get loaded into memory when VxWorks starts up?
0 Kudos
Message 1 of 12
(5,359 Views)

Hello jejackson,

 

It sounds like you have set the path to your .out as ni-rt/system/blah.out in the Call Library Function Node.  Is that correct?

 

I suspect if you drop the ni-rt/system from the path in your call library node, things will start working.  You should still copy the .out to ni-rt/system.

 

If that doesn't help, please post some more information (including your project and shared libraries if possible) and I'll be happy to help.

 

Thanks,

 

Sebastian

0 Kudos
Message 2 of 12
(5,330 Views)
Thank you for reply. I think the problem was a combination of not placing the .dll file into the correct path as you stated and that the function I was referencing in the Library Function Node was loading into VxWorks as a C++ function. After surrounding the VxWorks program code with the ' extern "C" ' block it was able to load and execute properly.
0 Kudos
Message 3 of 12
(5,318 Views)

I have the same kind error message as you.   So  can tell me where you put your DLL file(the path) to solve the problem? And I think I have make some mistake to making DLL. Can  you  post me a simple  file for making DLL which can be used in CRIO 9022. Thank you. 

0 Kudos
Message 4 of 12
(4,668 Views)

Hi zymale,

 

This KnowledgeBase article will help you check the validity of your DLL.

http://digital.ni.com/public.nsf/allkb/0BF52E6FAC0BF9C286256EDB00015230

 

Here is a developer zone article about using shared libraries on a cRIO.

http://zone.ni.com/devzone/cda/tut/p/id/5694

 

These documents should help you get going.

 

Good luck!

Regards,

Mike Altmann
Product R&D
NI
0 Kudos
Message 5 of 12
(4,650 Views)

Hi MAltmann,

I have already read  those documents . I use the DLL Checker to check my DLL.It is ok.When I create a project in NI 9004  calling .out library using the method introduced in those documents, it works well. But when I use the same project VI file and method in another NI 9074 project, there is a mistake.

The error message picture is attached.

0 Kudos
Message 6 of 12
(4,645 Views)

Hi zymale,

 

If you open up your call library function node and look at the path of the VI it should be a path on the cRIO.  For example c:\ni-rt\system\yourfunction.out.  This path is where you should place your library on the cRIO.

Regards,

Mike Altmann
Product R&D
NI
0 Kudos
Message 7 of 12
(4,637 Views)

Thank you for your reply.I have put  my " .out library " in the path just like you providing. Do you mean I have also put the VI using  call library function node in the path just like c:\ni-rt\system\yourfunction.vi ?

0 Kudos
Message 8 of 12
(4,633 Views)

Sorry I have make a mistake,so I have to reply again. Thank you for your reply. I have put  my " .out library " in the path just like you providing  on  the CRIO. Do you mean I have also put the VI using  call library function node in the path just like c:\ni-rt\system\yourfunction.vi   on my computer?

0 Kudos
Message 9 of 12
(4,632 Views)

Sorry I have make a mistake,so I have to reply again. Thank you for your reply. I have  already put  my " .out library " in the path just like you providing  on  the CRIO. Do you mean I have also  to  put the VI using " call library function node"  in the path just like c:\ni-rt\system\yourfunction.vi   on my computer?

0 Kudos
Message 10 of 12
(4,619 Views)