LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

invalid function delcaration when generating a function panel

Solved!
Go to solution

Greetings-

I am trying to create an instrument driver in CVI 2013.  My DLL succesfully builds, I then open my header file with my exports and select options->Generate Function Tree.  All of my function declarations come back with " Invalid function declaration for <FuncName>".  I cannot seem to focus any web search to narrow in on function panel generation and the error.  So I submit to you my problem.

 

Shown below is my header file...

 

//#include "Simulator.h"
#include "visa.h"   
#include "vpptype.h"

#if !defined SIM_INCL
#define SIM_INCL

#define DEFAULT_BUFF_SIZE 512

//ERROR DEFINES
#define SIM_CONFIG_ERR       -1001
#define SIM_CONFIG_TIMO      -1002
#define SIM_CONFIG_BAUD         -1003
#define SIM_CONFIG_DATA_BITS -1004
#define SIM_CONFIG_PARITY    -1005
#define SIM_CONFIG_STOPBITS  -1006
#define SIM_CONFIG_TERM_CHAR -1007
#define SIM_CONFIG_INIT      -1008  

#endif

enum PRNDL_State {PARK = 0, REVERSE, NEUTRAL,DRIVE,LOW};

/// ADDT FLOWCONTROL

typedef enum _flowcontrol
{
    NONE = 0,
    XON_XOFF,
    HARDWARE
} FLOWCONTROL;


/// ADDT PARITY
typedef enum _parity
{
    NOPARITY = 0,
    ODD,
    EVEN,
    MARK,
    SPACE
} PARITY;


/// ADDT COMPORT_SETTINGS
typedef struct _comport_settings
{
    int baud_rate;
    int databits;
    PARITY parity;
    double stopbits;  
    int portNum;
    FLOWCONTROL flowcontrol;
    char *ComName;

} COMPORT_SETTINGS;


/// -> ConfigUtils
int  __stdcall ConfigSimulator (ViSession DefaultRM, COMPORT_SETTINGS SimPort);
extern int __stdcall  SimulatorSetInit (void);
extern int __stdcall  CloseSimCom (void);
///<- ConfigUtils


///-> SetterGetterFunc
extern int __stdcall  SimulatorSetVBatt (int State);
extern int __stdcall  SimulatorSetIgn (int State);  
extern int __stdcall  SimulatorSetAcc (int State);
extern int __stdcall  SimulatorSetPrndl (int NewPosition);  /* P=0, R=1, N=2, D=3, L=4 */
extern int __stdcall  TapUpDwn (int NewState);   /* 0 = Tap Dwn nonZero Tap Up */
extern int __stdcall  TapOff (void);
extern int __stdcall  ReadVBATT_Status(void);
extern int __stdcall  CallReadSimulator (void);
///<- SetterGetterFunc



0 Kudos
Message 1 of 5
(4,816 Views)

Hello Schudon99,

 

In "Generate Function Tree" dialog, did you put anyghing in "Function prefix" box? You shouldn't because your functions don't have a common prefix.

Some rules that must be respected can be found here.

 

Constantin

 

0 Kudos
Message 2 of 5
(4,802 Views)

Excellent!  I am down to one error! 

 

/// -> ConfigUtils
int  __stdcall ConfigSimulator (ViSession DefaultRM, COMPORT_SETTINGS SimPort);

 

 62, 16   Unknown data type

 

Any thoughts on that?  I was concerned about using the custom data types (I have used them in the past). 

 

Thanks for getting me one step closer!

-don

0 Kudos
Message 3 of 5
(4,788 Views)
Solution
Accepted by topic author Schudon99

Hello don,

 

If you typedef ViSession in your header it works. I think the included headers are not checked.

You can define it as

typedef ViObject            ViSession; 

the same as in visatype.h

If you define it different you should get an error at compilation, so it should be safe to redefine it.

 

After you do this, remove extern specifier from the other functions and fp generation should succeed.

 

Constantin

 

0 Kudos
Message 4 of 5
(4,780 Views)

That's the ticket! 

 

Thanks much!  I am off to the races.

 

BTW - I also had to delete the "extern" directives.

 

Its all good!

-don

0 Kudos
Message 5 of 5
(4,771 Views)