02-01-2018 09:15 AM
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.
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.
Later, I installed sqlite3-dev library
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
02-01-2018 10:00 AM
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
02-01-2018 12:05 PM - edited 02-01-2018 01:16 PM
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
02-01-2018 01:27 PM
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.
02-01-2018 01:53 PM
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® (Developer Experience that makes you smile )
02-05-2018 09:53 AM
I'm inclined to agree with you, Joerg. gomezramones, maybe give that Tools Network addon a try
03-02-2018 11:48 AM
I was going to ask if James Powell's SQLite library works on the cRIO. I think my question just got answered. Cheers!!