LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLFN labview crash

Thanks all for the posts this saved me. I just upgraded an application to 2010 with an extensive set of dll wrappers.  2009 was nice enough to silently (NO errors were generated) run my dlls despite the incorrect calling convention.  2010 crashed immediatly.  fixing the calling conventions fixed the crash.  There really should be a warning since I have more applications than I can count to support with potential upgrades.  I could not find any mention of this outside of this set of posts. 

Conclusion: double check all dll calls for correct convention and error handling when upgrading to Labview 2010 since the optimization nolonger allows for labview to help out as much as in the past.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 21 of 32
(3,142 Views)

Hello Paul, I'm having problems using the libmySQL.dll with mysql_real_connect function (error 1097) with LabVIEW 2010 and I'm not sure from reading this thread what calling parameters you used to get it to work in the end. I'd be very interested to know and if you could post your connect wrapper, I would be very grateful. Cheers!

0 Kudos
Message 22 of 32
(3,117 Views)

I was wrapping dlls from ANDOR SDK3.  In labview 2009 they actually worked fine when I was mistakenly using c convention.  In labview 2010 the same exact calls crashed immediately.  Fixing the convention to use WINAPI (which is what I should have used in the first place because this is what the header file specifies) solved the issues I was running into.

 

Did your wrapper work in previous versions of labview?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 23 of 32
(3,109 Views)

I'm planning to replace my existing ODBC calls with the libmysql conection and I have not got anything working yet. The mysql_init does work. I'm using the WINAPI convention but I'm wondering if any of the parameters need to be changed to make mysql_real_connect work.

 

This returns error 1097

connect_MySQL.png

0 Kudos
Message 24 of 32
(3,101 Views)

If you get libmysql.dll working in 2010 let me know. I ran out of time and had to switch back to using ODBC and the database toolkit.

0 Kudos
Message 25 of 32
(3,095 Views)

Thanks to Rob and Rolf for their help. Finally got it working. The problem was that an unsigned long under 32 bit LabVIEW is an uInt32 not an uInt64.

 

LabVIEW_MySQL.png

0 Kudos
Message 26 of 32
(3,014 Views)

Hello d_sdl,

 

Well done for getting it working. Is there any chance you could post your connect code in the screen-shot as I'm still not sure what the 'SZ' parameter type (as it is displayed in your screen-shot) should be?

 

Cheers,

Zing

0 Kudos
Message 27 of 32
(2,994 Views)

Not 100% sure but I would suppose it's the (signed) pointer sized integer.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 28 of 32
(2,988 Views)

Zing

 

SZ is a signed Pointer-sized Integer. I used this data type for the MySQL pointer based on Rolf's earlier suggestion to use a "pointer sized integer CLN datatype for all pointer types (MYSQL*, and those NULL string parameters)". I don't know for sure if it should be signed or unsigned. It worked with the signed type so I didn't try the unsigned case.

0 Kudos
Message 29 of 32
(2,967 Views)

signed and unsigned pointers is mostly just a cosmetic distinction. However if you use one of these for a particular pointer I would recommend to stick to it throughout all LabVIEW VIs. Otherwise you could run into corrupted pointer values due to sign extension arithmetic rules being applied when LabVIEW tries to convert from signed to unsigned and vice versa.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 30 of 32
(2,962 Views)