Go to Post Its not how much knowledge you have, its how much you want to learn. - tennispro9911 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 18-12-2010, 11:04
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Native call

Quote:
Originally Posted by Greg McKaskle View Post
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.
I was more refering to the C linking process. You build your code, and if a function's definition cannot be found, it remembers this, so that when it is on the cRIO, it links all the previous stubs to the actual location.
Quote:
Originally Posted by Greg McKaskle View Post
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.


Are you using C++? Have you declared the entrypoints to be extern C? Does the Tip above possibly apply?
I am using extern "C" (ones that I call are in bold)
Code:
extern "C"
{
    void ZomBDashboardInit(ZomBModes mode, char* ip);
    int ZomBDashboardAdd(const char* name, const char* value);
    int ZomBDashboardAddDebugVariable(const char* name, const char* value);
    const char* ZomBDashboardGetString(const char* name);
    int ZomBDashboardGetInt(const char* name);
    float ZomBDashboardGetFloat(const char* name);
    double ZomBDashboardGetDouble(const char* name);
    int ZomBDashboardHasSpace();
    int ZomBDashboardIsConnected();
    int ZomBDashboardIsAnyConnected();
    int ZomBDashboardCanSend();
    int ZomBDashboardSend();
    void ZomBDashboardResetCounter();
}
Quote:
Originally Posted by Greg McKaskle View Post

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
how about a zip of the ZomB stuff and Telop, Begin, and my out file?

I've also noticed (of my 3 c calls) the following:
void ZomBDashboardInit(ZomBModes mode, char* ip); //no library name needed
int ZomBDashboardAdd(const char* name, const char* value); //Library needed, does not give errors
int ZomBDashboardSend(); //library needed, gives errors
Attached Files
File Type: zip ZomB.zip (1.00 MB, 12 views)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Native Interface (For using code made in windriver) biojae Java 3 07-03-2010 22:46
LAST CALL! Amanda Morrison Awards 2 22-02-2008 10:21
Official Native Win32 version of GNU Make Astronouth7303 Programming 0 05-01-2007 00:59
Call me an optimist... Eric Tarnowski General Forum 3 02-10-2001 16:55


All times are GMT -5. The time now is 21:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi