LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SQLite using RT PC Target

I am trying to use SQLite on RT PC Target (PharLap OS). I downloaded these toolkits:

http://www.labview-tools.com/software/sqlite-api/

And lv_sqlite_103 downloaded from http://zone.ni.com/devzone/cda/epd/p/id/6287

 

None of them worked. The sqlite-api works well on My computer, but after changing the target to RT PC it returned following error:

 Failed to load shared library sqlite3x32.dll:sqlite3_bind_text:C. Ensure that the library is present on the RT target. Use MAX to install NI software or FTP to transfer custom libraries to the RT target.

I tried to copy the dll into RT System folder and I changed the ni-rt.ini file, but nothing happened.

 

The lv_sqlite_103 reported no error but it did not create the db file neither.

 

All of the forum topics discuss only the installation on cRIO (Vx Works). Is it possible to use sqlite with PharLap and RT PC Target?

 

0 Kudos
Message 1 of 5
(1,604 Views)

@chyparo wrote:

I am trying to use SQLite on RT PC Target (PharLap OS). I downloaded these toolkits:

http://www.labview-tools.com/software/sqlite-api/

And lv_sqlite_103 downloaded from http://zone.ni.com/devzone/cda/epd/p/id/6287

 

None of them worked. The sqlite-api works well on My computer, but after changing the target to RT PC it returned following error:

 Failed to load shared library sqlite3x32.dll:sqlite3_bind_text:C. Ensure that the library is present on the RT target. Use MAX to install NI software or FTP to transfer custom libraries to the RT target.

I tried to copy the dll into RT System folder and I changed the ni-rt.ini file, but nothing happened.

 

The lv_sqlite_103 reported no error but it did not create the db file neither.

 

All of the forum topics discuss only the installation on cRIO (Vx Works). Is it possible to use sqlite with PharLap and RT PC Target?

 


The Pharlap OS is a Win32 compatible system, but it does by no means implement the entire Win32 API. So it could be that the sqlite DLL is using certain Windows API functions that are not available on the Pharlap OS. Or another probably even more likely cause is that it was compiled with a specific version of Visual C and therefore depends on the according MS C runtime library. But the NI Pharlap OSes do not include every possible C runtime version that is out there. They only usually come with the version needed to make the LabVIEW runtime system working.

 

First you should do a check of the sqlite DLL with the DLL Checker to see if it uses an unavailable Windows API, and if that test shows no problems you need to find out the C runtime requirements of the sqlite DLL. If it is a C runtime issue you can try to find the according distributable C runtime installer and get that onto the system, but that could be a major hassle. Instead it's probaly easier to recompile the sqlite DLL with the correct Visual C compiler.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 2 of 5
(1,589 Views)

Suggestions,

1) post on LabVIEW Tools to try and get the input of the package author.

 

2) download the DLL provided at the SQLite.org website, make a VI that just calls any sqlite function, and see if it loads on RT.  Both those other DLLs may have additional code in them.   I have a package that uses the standard DLL that you can try if that works (I've never tried it on Real Time).

0 Kudos
Message 3 of 5
(1,582 Views)

I do not know of a system that can run an SQL database on PXI, all I know of are clients (such as this one) that can connect to external SQL databases.

 

-Danny

0 Kudos
Message 4 of 5
(1,564 Views)

I checked the official SQL lite 3.7.13 with the DLL Checker for LabVIEW RT 20010 and got following report of bad APIs that it is using.

Looking at the reported functions I think it would be some serious work in the sqlite source code to work around that. While a few are simply Unicode APIs that might be easily resolved by compiling the DLL as ASCII DLL instead (at the possible cost of loosing support for all non western languages both in the internal storage as well as in any strings passed to the functions, the use of FileMappings suggests that the DLL makes use of memory mapped files for performance reasons. Removing such support and replacing it with direct disk access could not only proof more complicated but would certainly cause serious performance loss.

 

But if there is any SQL database that has potential to be portable to Pharlap then that would be certainly sqlite.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 5 of 5
(1,554 Views)