LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with ADODB + LabView 5.1.1 + Windows 98

Hi,

I've got a serious problem with LabView 5.1.1, ADODB and Windows 98.

I have a little test program which reads some Data via ADODB, MyODBC(*)
(2.50.33) driver from a MySQL database on a linux machine (the test progam
runs under windows 95/98/NT/2000). It opens the connection, reads the
data and closes the connection (using the ActiveX open, invoke, property
and close functions). The program does this every 10 seconds.

(*) plus MDAC 2.6 IE 5.5 and LabView Runtime 5.1.1 installed.


1. Is ist possible that there are some memory leaks in the ADODB routines?
Every time it reads the data it allocates a few kBytes more than it
frees after closing the connection (512 Bytes ... 1102 Bytes). After
two
hours you can't work any more with the computer running the
program.

2. The data read by the program consists of 14 recordsets with five
fields.
The fields are put together into a string and these string are put into
an array(*). When I display the array in the front panel, i can see that
some fields are empty. And sometimes the program reads more the 14
records. With other words: the data is unuseable crap.
(*) The array looks like the following:

field0/0 - field1/0 - field2/0 - field3/0 - field4/0
field0/1 - field1/1 - field2/1 - field3/1 - field4/1
.
.
.
field0/13 - field1/13 - field2/13 - field3/13 - field4/13

When I use the MS Access ODBC driver I have the same problems. With
Windows 95/NT/2000 there is that memory leak but the recordsets are okay.
So maybe it's the ADO(DB)/ActiveX thing from Win98 or the LabView Runtime
5.1.1 in combination with Win98.

Thanks for any
hint.
Richard.


I hope my English is good enough so you can understand what I wrote 🙂


--
http://www-stud.fh-kempten.de/rstadler (under construction)
0 Kudos
Message 1 of 3
(2,820 Views)
There are two things that come to my mind.

1)First of all make sure that when you are opening ActiveX references in labview (e.g Connection or recordset ref), you are closing EACH reference using "Automation Close" VI. Automation close basically deallocates the memory that was allocated for that object.

2)The second thing i would suspect is some bug in MySQL driver that you got. May be LabVIEW is instructing the driver DLL to release the memory location, but the routine in the driver is not taking care of that.

Before blaming everything on driver make sure that you are closing all the objects, once you are done using them.

You might want to consider buying the new Database toolset from NI. Basically that toolset is based on ADO calls from labview.

Abdullah
0 Kudos
Message 2 of 3
(2,820 Views)
I also observed something like this- but it was a programming error. I was using ADODB in LabVIEW to run SELECT statements and retrieve data from recordsets. My program would gradually consume more and more RAM over time. This was plainly visible on NTs Task Manager. My problem was that I was simply forgetting to close/destroy many of the object references. This would also sometimes cause my system to crash when I stopped the program and exited LabVIEW (or exited the run-time engine if it was an exe).

I might suggest you go through the program and make sure you use the Automation Close function to close the appropriate references.

Its especially important to close all "Fields" and "Field" references.

Also, I found that running the GET ROWS method or GE
T STRING method on a recordset works much better than retrieving data using "Fields" and "Field" objects... its faster, easier, less prone to causing problems, less trouble with references and stuff.
http://www.medicollector.com
0 Kudos
Message 3 of 3
(2,820 Views)