09-20-2012 02:41 AM
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
Solved! Go to Solution.
09-20-2012 06:09 AM
when i run the program with the CANdo attached i get this error
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?
09-20-2012 10:58 AM
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.
09-21-2012 01:29 AM
Thanks for the response I found the example.. which btw is great by holding my mouse cursor over the call
03-21-2018 10:54 AM
Do you can fix it?