랩뷰에서 SQLite를 사용할 수 있는 툴킷이며, VIPM을 통해서 다운로드하여 사용할 수 있습니다.
SQLite는 파일 기반이고 가볍게(?) 사용하기 좋아 자주 사용하고 있습니다. DB(데이터베이스)는 이제 측정/검사 프로그램에서 빠질 수가 없는 거 같습니다. 번거롭다는 느낌도 있습니다. 혹은 랩뷰 프로그램을 하다 SQL 프로그램을 사용하려 하면 어렵게 느껴지기도 합니다.
이 라이브러리 장점중에 하나는 DB를 오픈할 때, DB파일 위치만 연결해주면 사용할 수 있기에 사용하기 편합니다. 다른 SQL 사용에서는 UDL 파일과 같이 DB를 오픈할 수 있는 방법이 별도로 있었으며, UDL 파일을 생성하기 위한 과정 그리고 드라이버 설치 등이 있어 복잡한 면이 있습니다.
라이선스는 BSD 라이선스이며, 업데이트는 가끔씩 해주고 있는데, 아마 SQLite 업데이트에 따라 변경사항 등을 업데이트해주는 것 같습니다.
예제도 잘 되어 있으며, 직접 SQL 문을 실행하여 사용할 수도 있습니다.
아래 그림은 예제중에 하나의 블록 다이어그램을 캡처하였습니다. 이 예제는 메모리상에서 DB 작업하는 예제입니다.
테이블 생성, 데이터 입력, 데이터 선택으로 되어 있습니다.
VIPM 소개글
SQLite Library v1.10.0.85 by drjdpowell
Released On: Mon, 26 Nov 2018 06:21:32 -0600
Author: James David Powell
Copyright: James David Powell
License: BSD
Compatible LabVIEW Versions: >= 2013.
Compatible OS Versions: ALL.
Repository Name: NI LabVIEW Tools Network
Description:
SQLite3 is a very light-weight, server-less, database-in-a-file library. See www.SQLite.org. This package is a wrapper of the SQLite3 C library and follows it closely.
There are basically two use modes: (1) calling "Execute SQL" on a Connection to run SQL scripts (and optionally return 2D arrays of strings from an SQL statement that returns results); and (2) "Preparing" a single SQL statement and executing it step-by-step explicitly. The advantage of the later is the ability to "Bind" parameters to the statement, and get the column data back in the desired datatype. The "Bind" and "Get Column" VIs are set as properties of the "SQL Statement" object, for convenience in working with large numbers of them.
Release Notes:
-- Backup API (beta; not on pallets)
-- "Memory Used" and "Memory Highwater" properties of Connection (also added to Connection Probe)
-- Get Column as File (copy to file in chunks to handle large BLOBs)
-- SQLite 3.23.0
참고 : https://www.youtube.com/watch?v=0UiI2R-pzxQ
'LabVIEW > 에드온' 카테고리의 다른 글
MODBUS 모드버스 통신, RS-485 (feat. LabVIEW, MSB624RA) (0) | 2019.12.23 |
---|---|
JKI State Machine (0) | 2019.12.21 |