From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRUSB CAN converter - DLL problem

Hi,

I am trying to read CAN data using Diga CRUSB converter. There is no labview component available thus I am forced to access data using DLL.
The problems start at retrieving the information about the device.The function is as follows:
2.png


I tried using clusters like:

1.png

 

The problem is that each time I try running the program, Labview crushes because of memory problems or fpsane.cpp error (when saving the unfinished vi before running).
I am not sure whether the structure used is correct or if I am missing something important.
Please find the DLL and PDF under http://www.diga.biz.pl/zip/crusb_v1/CRUSB_DLL_1_5_0.zip.

Could you please help me with this problem?

0 Kudos
Message 1 of 3
(2,204 Views)

Howdy!

 

I am not sure I have an answer but something to try would be to make your cluster of strings have dummy data in the strings. LabVIEW handles memory for you so as long as you stay in LabVIEW you do not need to worry about allocating memory. However, you are stepping outside of LabVIEW by calling into a DLL. Therefore you might need to preallocate memory for the strings. To do this, it might work if you created your strings with data in them to overwrite.

 

I have had some luck with this on arrays, but I have not done much with passings strings to DLLs, so this is mere conjecture on my part.

 

Good Luck,

Bob

0 Kudos
Message 2 of 3
(2,141 Views)

Hello,

my first suggestion would be to change the configuration of the Call Library Function Node to "Run in UI Thread":

 

uithread.PNG

 

You can read more about it here, in the "Configuring for Multiple Thread Operation".

 

Let us know, if it helps.

 

 

BR,

0 Kudos
Message 3 of 3
(2,127 Views)