Thread: Native call
View Single Post
  #4   Spotlight this post!  
Unread 18-12-2010, 10:37
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Native call

Quote:
Is there anyway for it to do it the C way, and dynamically link it on deploy/run?
Just to keep the terminology clear, the C way is really defined by the OS or the library standards they have adopted. LV is making the same calls under the hood.

Here is the help for the dialog:

Library name or path—Specifies the library name or path for the function you are calling. Enter only the library name if the library is in the search path of the system. Enter the entire path if the library is not in the search path of the system. To make the reference platform independent, use the * wildcard. If you use the C++ compiler, the names of the functions in the library are altered by a process called name mangling and are platform dependent. When you use a C++ compiler, export functions with the extern "C"{} statement in your header file in order to prevent name mangling.

Specify path on diagram—Determines if you can input the Library name or path on the block diagram. When you place a checkmark in this checkbox, path in and path out appear as input and output terminals on the connector pane for the node. When you place a checkmark in the checkbox, any library referenced in the Library name or path control will not be used.
Tip You can use the path in input to unload a previously referenced library from memory. Wire an empty or invalid path to the path in input to unload any library previously referenced by the node from memory.



Are you using C++? Have you declared the entrypoints to be extern C? Does the Tip above possibly apply?

Personally, I wouldn't use the path input. I'd use the static lib name in the dialog with a * suffix. If you use the path input, use a constant or runtime values could possibly unload the lib.

As I mentioned earlier, all of this is very OS dependent and I'm not sure about the VXWorks details. I'm not sure if dynamic loading and unloading work the same as on other platforms.

Feel free to post a picture of your diagram and one of the config dialog if that helps with the description.

Greg McKaskle
Reply With Quote