LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CANCASEXL,not able to open port for vxlapi.dll

Hi,

I am trying to create LabVIEW code for vxlapi.dll. But was not successful in opening the port.

Harware details:

  1. CANCASEXL(007129-028561)
  2. Windows 7 32bit Operating System.

I did follow the LabVIEW coding according to the state flow for CAN defined in the description document.

What was successful: xlopendriver(),xlgetapplconfig(),xlsetapplconfig(),xlgetchannelIndex(),xlgetchannelmask().

 

Inputs:

  1. Appname(pointer string): test
  2. Appchannel(unsigned 32 bit): 1
  3. PhwType(unsigned 32): 21
  4. phwIndex(unsigned 32): 0
  5. phwchannel(unsigned 32): 0
  6. bustype(unsigned 32): 1

 

Inputs for xlopenport():

  1. porthandle: blank.
  2. Appname: test
  3. Access Mask: value obtained from getchannelmask() function.
  4. Permissionmask: Access mask value
  5. Rxqueuesize: 32
  6. Xlinterfaceversion: 3
  7. Bustype:1

 

Output: porthandle value -1. And labview error 1097.

 

One more query I had:  phwtype,phwIndex and phwchannel were defined as signed integers in xlgetapplconfig , whereas the same parameters are defined as unsigned in getchannelIndex function. Could you tell me why two different data types.

And also could anyone tell me where I am going wrong I opening the port.

 

Thank you and Regards,

Surya

0 Kudos
Message 1 of 13
(14,540 Views)

Just to make something clear, CANcaseXL is NOT a National Instruments product, it's made by Vector ( vector.com ).

So any question about the dll will properly not be able to be answered here in this forum. 

 

Also just one question, do you have a CANcaseXL with a license for LabVIEW ?

To be able to work with CANcaseXL in LabVIEW, you need a special license in the CANcaseXL.

 

0 Kudos
Message 2 of 13
(14,535 Views)

yes, I do have a licensed cancaseXL.

 

Thank you for the suggestion. I am taking vector's help in solving this issue.

 

Surya.

0 Kudos
Message 3 of 13
(14,519 Views)

Hmm, the input description doesn't match the xlOpenPort() funciton at all but would be in terms of naming ok for xlGetAppConfig() and xlSetAppConfig() however in terms of parameter setup only for xlSetAppConfig() . 

 

You do not describe how you have setup the parameters for xlOpenPort(). You do have there quite a few parameters which are defined as passed by reference (pointer) and that would of course have to be setup correctly in the Call Library Node.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 13
(14,515 Views)

Hi,

 

I'm having hard time to get work with initial communication functions. Did you get resolve those initial communication issues (xlOpenDriver, xlGetChannelMask & xlOpenPort)...? Please share with your inputs.

 

Thanks

0 Kudos
Message 5 of 13
(14,288 Views)

You do not need to have a licensed Vector CAN product to use it in LabVIEW. You can call the vxlapi.dll directly.

It's just tricky to import the dll functions from the .h file because LabVIEW doesn't like the way it is defined and there are a couple of structs that LabVIEW struggles with.

 

I have not included the Vector Driver Library description document or dll. You can download it from here:

https://www.vector.com/vi_downloadcenter_en.html

Under "Products" select "CAN Driver Library" and under "Categories" select "Drivers & Firmware" then "Show results"

 

All wrappers are in the attached zip file with a basic example too.

 

The my_vxlapi.dll is a wrapper around the GetDriverConfig function because the XLdriverConfig struct cannot be used by a LabVIEW Call Library Function directly.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 6 of 13
(14,164 Views)

Hi

 

I am also facing the same issue with "vxlapi.dll" in LabVIEW. The xlOpenPort() function returns porthandle as -1 and error code 1097.

 

Could you please help me if you were able to  find the root cause of this issue

 

Thanks in Advance

Sujith Rajan

0 Kudos
Message 7 of 13
(13,998 Views)

Error 1097 is a LabVIEW error code not a vxlapi.dll error code.

Did you define the call library function node yourself or use the one from the library I attached above?

It seems that the function parameters you have defined may be incorrect and that is likely why calling the function is corrupting LabVIEW memory.

 

Error 1097 ...

LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. The exception might have corrupted the LabVIEW memory. Save any work to a new location and restart LabVIEW.

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 8 of 13
(13,967 Views)

I am facing issue with xlActivateChannel.vi. The function call returns me the following error code

 

112

XL_ERR_INVALID_ACCESS The user made a call to a port specifying channel(s) for which he had not declared access at opening of the port.

 

Any idea, why this could be happening??

 

 

Thanks

Sujith

0 Kudos
Message 9 of 13
(13,864 Views)

There are quite a number of reasons why this could be happening.

CAN or LIN? Is another application using the hardware? Did you properly close any references you had to the hardware in previous runs?

Did you provide the appropriate access mask for the channels you wish to activate?

 

Perhaps if you attached your VI it would be easier to give a more specific answer.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 10 of 13
(13,858 Views)