12-12-2008 09:15 AM
Hi,
I have followed the instructions in this tutorial:
http://zone.ni.com/devzone/cda/tut/p/id/5694
and used windriver workbench to create a shared library for use with our LabVIEW code on the crio. I am unsure however, as to how to put it on the crio and then configuring the call library function node. Are we really able to connect and access the crio's file system via an FTP program and if so, what settings do we use to connect? Also, I understand that I have to configure the call library function node blind, but should I leave the library path blank then wire a constant with the "/.../ni-rt/system/mysharedlib.so" path?
12-15-2008 03:41 PM
As far as the Call Library Function Node goes, if by configuring it "blind" you mean you have to manually add the inputs/outputs with their respective parameters (data type, pass by value, etc), then the answer is yes. You do have to manually add them.
You can wire a constant to the Path In input for the Call Library Function Node. To get the Path In input to display, you must put a check in the Specify Path On Diagram checkbox located in the Function tab of the Call Library Function properties.
12-15-2008 06:14 PM
You will need to FTP to the cRIO to place your library file there. Any FTP program will worked, I've used the FTP software built into Measurement and Automation Explorer (MAX) as well as FileZilla. As far as settings, the transfer type should be FTP, the user name and password is blank or anonymous, and you should just enter the IP address of the cRIO FRC.
To access the FTP client in MAX, right-click on your cRIO FRC under the Remote Systems heading and select File Transfer. This KnowledgeBase has some more explaination as well as some pictures. It is meant for a different cRIO than the cRIO FRC, but the FRC version works the same way. Your code will go in the ni-rt/system directory.
12-16-2008 09:19 AM
You can also FTP in the Windows Explorer by typing: ftp://my-crio-name-or-ip-address
When you configure the call library function node, the node won't be able to parse the function prototypes from the VxWorks library. You have to enter the function prototype information by hand. On a normal DLL, the prototype information is contained in the DLL, so on a Windows environment the node will have a list of all the functions you can call.
Regards,
JeremyB
Applications Engineer
National Instruments
12-16-2008 02:30 PM
Do I have to even specify a path at all? That document made it sound like all I had to do was drop the library into the ni-rt or ni-rt/system folder and after specifying the function name, the call library function node would know to look there.
12-16-2008 04:55 PM
You can just specify the library name for the function you are calling. You can enter only the library name if the library is in the search path of the system, otherwise enter the entire path if the library is not in the search path of the system (check out the LabVIEW Help document for more information).
12-17-2008 07:22 AM
I made an attempt last night at getting this working last night with limited success. It was easy enough putting the shared library into the /ni-rt/system folder but I had no success getting it to run. At first, LabView gave the error that there was no path specified for the call library function node so I wired in the path constant "/ni-rt/system/test.so". This fixed the error and my program ran but the call library function node returned an error code #7 (library not found) to the error indicator I placed on the front panel. I changed the path constant to just "test.so" and still received the error when I ran the program again. I finally just emptied the path constant and got the program to run without error. However, when I did get it running successfully I got no output from my library. It might have just been incorrect parameters or a misspelled function name. The function is just a test function that multiplies to integers and returns the result to try getting external code working with LabView on the CRIO. Its just one file, test.cpp, that I compiled into the shared library for the CRIO using windriver workbench following the instructions in the tutorial mentioned above. The code is as follows:
//test.cpp
extern "C"
{
unsigned int multiply(unsigned int a, unsigned int b)
{
return a*b;
}
}
12-17-2008 11:04 AM
Try specifying the path starting with "/c/" (without the quotes). You have the specify a path to the library, I'm surprised you aren't getting an error with no path wired in. Also, have you specified the return type (default is void)?
Regards,
JeremyB
Applications Engineer
National Instruments
12-24-2008 09:24 PM
Ok, I have a few more questions. I realized that I didnt follow the tutorial to the letter when I got started. I made a shared library project rather than a Vxworks downloadable kernal module project. I re-made my project as I a downloadable kernal module as instructed but when I went to find the .so file I couldn't find it in the workspace directories. I then noticed that in my project explorer under binaries, was my project binary only as a .out file instead of a .so file. Is this the correct file to be putting into the ni-rt/system folder? Our teams mentor has the hardware this holiday break and I have to send compiled libraries for him to test so I can't try these out for myself. Has anyone gotten this succsessfully working on their CRIO?