LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

senindg a command to a DLL over labvew

Hi,

I would like to send commands to libmysql.dll in LabView...

I made a code with call library function. I have configured as mysql:connect
with 3 string variables.

But after that every try crashes the labview.

As you understood I am new at both labview and using libmysql.dll.

All I wanna do is every 10 minutes I will connect to server and write a raw
to a table.

Any idea?
0 Kudos
Message 1 of 3
(2,618 Views)
I do not know the dll, specifically the parameters to it's methods.
You should be aware, that strings can be stored in many ways. The old C paradigm of 8 bits per character plus a 0 Byte to define the end-of-string is not universal.
You could use 16 Bits to allow e.g. chinese characters or include 00 as a valid character; then you need another way to define the end (or the length).
Check the Labview/Using ExternalCode document to find out how labview does it and the despricption of what mysql expects. Then you may have to write a little wrapper, that converts from one to the other format.
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 2 of 3
(2,618 Views)

DLLs can be a tricky thing as every programming language may handle data types in a slightly different way. To find out exactly how LabVIEW is passing its data, take a look at the manual linked below. Page 2-38 discusses the specifics of passing strings and the different options available.

Using External Code in LabVIEW

Instead of using DLL calls, it may be easier to use the Database Connectivity Toolkit for database interactivity. This toolkit connects through Microsoft ADO technology and simplifies database communication.

Regards,

Matt Friedman
National Ins
truments

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