NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

SQLite on myRIO

Hi, I'm newbie on myRIO and Linux RT. I want to create a databases on myRIO 1900 so I installed SQLite library. First, I see what architecture supported myRIO.

 

image.png

And I used this link: http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/armv6-vfp/base/ to download de library and install on my device. 

image.png

 

Later, I installed sqlite3-dev library

 

image.png

 

Now, How can I use this library on labVIEW? I read that I need to call it from Call Library Function Node but I don't know how 

0 Kudos
Message 1 of 7
(4,041 Views)

Hi gomezramones,

 

I just wanted to double-check what version of NI Linux RT you are using (as reported by MAX, the Operating System version reported when the controller has software installed to it). Based on the architectures supported, it's probably 2015+, but in any case, the feeds that NI posted since 2014 releases has sqlite packages available (as a library, as a python package, and as a standalone commandline client). You can use the client you installed, sure, but you probably didn't need to go through the trouble of downloading one from an alternate source (if you're using 2017, see LabVIEW 2017/RIO 17.0 PSA: Feed Adjustment for OPKG)

 

From there, you have a few options: you can indeed use the CLFN to interact with libsqlite3 (you may need to write a wrapper library to adjust any special datatypes to be LabVIEW-friendly), you can interact with it from python (and interact with that through one of a few intergration toolkits or through the SystemExec interface, calling python directly), or calling the commandline tool directly, again, using SystemExec (note: since SystemExec is tricky to use with an interactive CLI tool, you should probably look at using the tool in the non-interactive mode where you pass commands through the call to the tool).

 

Since you're working with a myRIO (limited storage), unless you add external storage to the controller I would probably recommend using either the library or commandline client approach as the python approach will pull python onto the system as well, and it is a fairly large collection of packages.

 

Hopefully this should be enough to get you started, find a good resource online for sqlite

Message 2 of 7
(4,031 Views)

Hi BradM,

 

When I use  CFLN, the ask me to modify two options:Library name or path and function name. I suppose that I have to change is function name and put a sqlite function but how I do that?

 

Thank you for the answer and the links you gave me, I appreciate it. 

 

My best regards

0 Kudos
Message 3 of 7
(4,021 Views)

Using the C API link I posted, find the functions that the library exposes, including the arguments taken, and use that when defining the CLFN. This sort of thing should be covered (in the general sense) in LabVIEW CLFN documentation, e.g. http://zone.ni.com/reference/en-XX/help/371361M-01/lvdialog/call_lib_function_db/. Also, as I stated, thre's likely going to be arguments that are passed to/from the library functions that don't fit well within the LabVIEW datatypes, so you will likely need to write a wrapper library to adapt the datatypes LabVIEW ←→sqlite.

0 Kudos
Message 4 of 7
(4,007 Views)

Perhaps it's easier for you to use James Powell's SQLite Library for LabVIEW: http://sine.ni.com/nips/cds/view/p/lang/en/nid/212894




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


Message 5 of 7
(4,004 Views)

I'm inclined to agree with you, Joerg. gomezramones, maybe give that Tools Network addon a try

0 Kudos
Message 6 of 7
(3,976 Views)

I was going to ask if James Powell's SQLite library works on the cRIO. I think my question just got answered. Cheers!!

Monil Morar
Control System Engineer
Secure Drilling Services (SDS)
Weatherford │ 16430 Park Ten Place │ Suite 200 │ Houston │ Texas │ 77084
0 Kudos
Message 7 of 7
(3,914 Views)