LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CANdo dll driver

Solved!
Go to solution

Hello NI forum,

I'm trying to make a driver for CANdo

http://www.cananalyser.co.uk/candosdk.html

 

 


I have tried to make the clusters that are typedef, when I run this I get the return value 4 which means that a CANdo device is not found when I insert it into the USB port, LabVIEW crashes.

I'm not sure what I'm doing wrong. I'm hoping that someone could tell me if the way I'm using the function is wrong.

 

The function I'm trying to use is:

 

CANdoGetDevices its on page 5 the typedef is descriped in the appendix A

 

/Marck

Marck Holm Hansen
Tech Lead at GPower | LabVIEW Architect | TestStand Architect | Bachelor of Electrical Engineering | Admin, LabVIEW.dk

Download All
0 Kudos
Message 1 of 5
(2,962 Views)

when i run the program with the CANdo attached i get this error

 

labview error.png

 

but when i run the code without the CANdo device attached it works and the function returns 4 that means CANDO_NOT_FOUND

and that is true so what i want to know is where is the error?

 

 

Marck Holm Hansen
Tech Lead at GPower | LabVIEW Architect | TestStand Architect | Bachelor of Electrical Engineering | Admin, LabVIEW.dk

0 Kudos
Message 2 of 5
(2,955 Views)
Solution
Accepted by topic author Marck_GPower

The data type you're passing to the DLL is wrong.  There are two problems:

1) you're seeing the somewhat-classic "fixed-size array inside a struct" as explained in many places, for example http://forums.ni.com/t5/LabVIEW/Passing-a-cluster-with-array-to-a-dll/m-p/1063907.  You cannot pass a LabVIEW array inside a cluster as a fixed-size array inside a struct; you need to replace the array with a cluster containing the correct number of elements.

2) You need to pass an array of TCANdoDevice, rather than a single element.

0 Kudos
Message 3 of 5
(2,940 Views)

Thanks for the response I found the example.. which btw is great by holding my mouse cursor over the call

Marck Holm Hansen
Tech Lead at GPower | LabVIEW Architect | TestStand Architect | Bachelor of Electrical Engineering | Admin, LabVIEW.dk

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

Do you can fix it?

0 Kudos
Message 5 of 5
(2,534 Views)