NI Home > Community > NI Discussion Forums

Automotive and Embedded Networks

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Automan
Posts: 5
0 Kudos

Call Library Function with Vector's CANcaseXL and vxlapi.dll

I'm trying to access some functions from Vector's vxlapi.dll but I'm failing miserably as the data structures is too complex for me. Would you please give me directions (or provide a simple VI) in order to call the following function by using a Call Library Function node? I'm stucked mostly on how to create the controls to implement the structures below. Thanks a lot.

 

The function I want to call: 

XLstatus xlGetDriverConfig(XLdriverConfig *pDriverConfig)

 

XLstatus is an unsigned char and XLdriverConfig type is as follows:

 

typedef struct s_xl_driver_config {

  unsigned int dllVersion;

  unsigned int channelCount;

  unsigned int reserved[10];

  XLchannelConfig channel[XL_CONFIG_MAX_CHANNELS];

} XLdriverConfig;

 

 

typedef struct s_xl_channel_config {

  char name [XL_MAX_LENGTH + 1];

  unsigned char hwType;

  unsigned char hwIndex;

  unsigned char hwChannel;

  unsigned short transceiverType;

  unsigned int transceiverState;

  unsigned char channelIndex;

  XLuint64 channelMask;

  unsigned int channelCapabilities;

  unsigned int channelBusCapabilities;

  unsigned char isOnBus;

  unsigned int connectedBusType;

  XLbusParams busParams;

  unsigned int driverVersion;

  unsigned int interfaceVersion;

  unsigned int raw_data[10]; 

  unsigned int serialNumber;

  unsigned int articleNumber;

  char transceiverName [XL_MAX_LENGTH + 1];

  unsigned int specialCabFlags;

  unsigned int dominantTimeout;

  unsigned int reserved[8];  

} XLchannelConfig;

 

 

typedef struct {

  unsigned int busType;

  union {

     struct {

        unsigned int bitRate;

        unsigned char sjw;

        unsigned char tseg1;

        unsigned char tseg2;

        unsigned char sam;

        unsigned char outputMode;

     }can;

     unsigned char raw[32];

  }data;

} XLbusParams;

 

 

//defines for xlGetDriverConfig structures
#define XL_MAX_LENGTH                  31
#define XL_CONFIG_MAX_CHANNELS         64

 

Active Participant
O_Proulx
Posts: 306
0 Kudos

Re: Call Library Function with Vector's CANcaseXL and vxlapi.dll

Hello Automan,

 

I think your question is more related to using the call library function node in LabVIEW.  I would suggest looking at the help for the call library node, or maybe ask your question in the LabVIEW forums.

 

I'm sorry if this is not much help...

O. Proulx
National Instruments
www.ni.com/support
Member
Mahyar
Posts: 1

Re: Call Library Function with Vector's CANcaseXL and vxlapi.dll

Hi

I have developed the VI for calling this function. If you have still face this problem you can email me.

mahyar.master@gmail.com

Thanks

Member
Nico_EMC
Posts: 3
0 Kudos

Re: Call Library Function with Vector's CANcaseXL and vxlapi.dll

I do still have trouble with this function : it is not imported by the labviews function "import dll" (many other yes, but not this function).