11-05-2014 08:55 AM
Solved! Go to Solution.
11-06-2014 03:45 AM
Sorry for the awful, awful formatting. Reposting, hoping this one is more readable (I tried to edit the original message, but I didn't find any "modify" function?!)
================================
Hi, I wrote a very small shared library (.so) with Eclipse (2014 toolchain), that basically acts as a wrapper for a more complex one, but I'm encountering problems with calling in from within LabVIEW RT on a Linux RT target - specifically, the cRIO 9068.
First of all: the library has been copied to /usr/local/lib, and ldconfig has been properly set up.
Most important, I also wrote a C program (using Eclipse as well) that calls the only function currently implemented in the shared library: this work flawlessly both under Eclipse and by logging directly on the cRIO with a Putty terminal.
So I assume the shared library itself is ok and can be called from external code/programs.
Now, going back to LabVIEW (2014 here btw).
Here's where things get tricky, I guess. At first I had the problems listed here --> http://forums.ni.com/t5/LabVIEW/How-to-create-a-c-
Then I modified the Call Library Function Node: various tutorials suggest putting name_of_library.* in the library name or path text box, but this unfortunately doesn't seem to work so I had to put the actual name and extension, too. But this still produced the error mentioned above ("the function name cannot be found" etc.)
So I check the "Specify path on diagram" box, and add /usr/local/lib as a parameter to the Call Library Function Node: now the VI can run and is actually transferred to the RT target... but the output error cluster returns error 7, which is a "File not found" kind of error.
However, I believe this error message is misleading: indeed, if I try to remotely debug this shared library under Eclipse, I am actually able to pause it... and when I press the Pause button on the debugger, the RT target VI suspends execution, then it continues as soon as I press the Resume button.
I'm stuck... I tried searching NI forums and Google as well, but I haven't still found a solution. Any ideas on what's going on?
By the way, I can add more details if needed.
11-19-2014 07:01 AM
Problem solved, it was misconfiguration of the Call Library Function Node that prevented the actual libray (.so) from being called.
07-13-2015 10:11 PM
Hello,
I have having the same problem. Can you share you code so that I can use it as a starting point?
Thanks.
07-14-2015 02:46 AM
07-14-2015 10:06 AM
Hello,
Can I have both?
Thanks.
07-15-2015 07:09 AM
Hi guys, sorry for the delay but as usual I am extremely busy at work.
I'm posting two attachments here, in compressed ZIP format: an Eclipse project, written in C, for an extremely simple (simple being an understatement) shared library and a LabVIEW 2014 project that includes a very very simple - again - VI that uses the aforementioned shared library to demonstrate it is actually working.
Inside the Debug directory of the Eclipse project file you will find the shared library (.so) already compiled for ARM, you must copy it to the RT target/cRIO (or recompile it if your cRIO has an Intel processor).
I chose /usr/local/lib/ on the RT target as the destination directory for the .so, I don't know if there are strict rules in place about this... just make sure - obviously - that you put it in the same path specified on the VI Call Library Function Node.
Needless to say, you'll have to to edit the IP address of the cRIO to match the one in your current configuration.
Hope this helps.
Best regards
07-15-2015 08:06 AM
thankyou for the files. Do we need to manually copy the .so file to /usr/local/lib directory?
07-15-2015 08:14 AM
If I recall correctly you should be able to configure Eclipse to put the compiled .so in a directory of your choice on the target (provided you have the right permissions obviously), but since there is a precompiled .so in the archive I posted you might not need to worry about this.
Just copy it to /usr/local/lib, reconfigure the LabVIEW project to comply with the IP of your chassis and the RT VI will, hopefully, work as expected.
As I said though, the .so is meant to be used for ARM-equipped cRIO so make sure the one you own has the same kind of processor.
07-15-2015 06:45 PM
Thankyou very much. It works now.