Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/VIPM_Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
shell: powershell

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v4.3.2
with:
# Artifact name
name: ${{ steps.vip-name.outputs.vipName }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ Build
/Requirement/*.lock
/src/_benchmark/*.tdms_index
/*.vcfg
*.tagdb
Binary file added Benchmark/EXAMPLE_PARSEFILE.vi
Binary file not shown.
Binary file added Benchmark/TagDB-TestMain.vi
Binary file not shown.
Binary file modified Benchmark/benchmark-tagDB.vi
Binary file not shown.
Binary file modified Benchmark/benchmark.tdms
Binary file not shown.
50 changes: 27 additions & 23 deletions LabVIEW-TagDB.vipb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VI_Package_Builder_Settings Version="2018" Created_Date="2015-10-20 15:34:05" Modified_Date="2023-12-29 11:43:01" Creator="Administrator" Comments="" ID="1f80511f993aa0610e11fbfce054412c">
<VI_Package_Builder_Settings Version="2018" Created_Date="2015-10-20 15:34:05" Modified_Date="2025-10-08 20:52:47" Creator="Administrator" Comments="" ID="9843ccf7ef0d7ae39714a1486fad6e62">
<Library_General_Settings>
<Package_File_Name>NEVSTOP_TagDB_library</Package_File_Name>
<Library_Version>3.0.0.2</Library_Version>
<Library_Version>3.1.0.2</Library_Version>
<Auto_Increment_Version>false</Auto_Increment_Version>
<Library_Source_Folder>src</Library_Source_Folder>
<Library_Output_Folder>vip</Library_Output_Folder>
Expand All @@ -28,37 +28,41 @@
<VI_Package_Configuration_File>LabVIEW-TagDB.vipc</VI_Package_Configuration_File>
<Description>
<One_Line_Description_Summary>TagDB Library for LabVIEW Programming</One_Line_Description_Summary>
<Description># LabVIEW TagDB Library
<Description>NEVSTOP TagDB is an advanced data management library designed specifically for the LabVIEW environment, providing efficient reading, writing, storage, and sharing of configuration and Tag data. Through optimized data structures and caching mechanisms, it offers reliable data persistence and real-time data access solutions for LabVIEW applications.

Used for providing configuration and Tag data functionality.
## Best Practices

## FEATURE
### Data Management
- **Data sharing in multi-threaded environments**: Use TagDB as a data sharing center between multi-threaded applications, avoiding the use of global variables
- **Configuration information storage**: Store system configuration information in TagDB for easy import/export and version control
- **Temporary data caching**: Utilize TagDB's caching functionality to achieve asynchronous updates and fast access to data points
- **Control reference management**: Store LabVIEW front panel control References for convenient dynamic UI manipulation

- Cache functionality. If TagDB is not changed, Read action uses a local cache istead of accessing the TagDB.
- TagDB could be obtain by name.
- LabVIEW Reference support is enhanced.
- Configuration file(*.vcfg) is supported.
- A Customer Probe is provide for debuggin.
### Performance Optimization
- For frequently accessed data, consider using TagDB's caching mechanism
- When performing bulk data operations, properly use batch operation functions to improve efficiency
- Appropriately use the locking feature to prevent data modification during critical operations

## VI PALETTE
### Debugging Techniques
- Use the three built-in Probe tools to monitor the status and data changes of TagDB during runtime
- Regularly check the database status using TagDB-Status.vi to detect issues in a timely manner
- Use TagDB-Change Detector.vi to monitor changes in specific Tags, facilitating debugging of complex interaction logic

- TagDB Obtain
- TagDB Load Config File
- TagDB Save Config File
- TagDB Read
- TagDB Write
- TagDB Delete
- TagDB Status
- TagDB Free
## Example Programs

## BEST PRACTICE
The library includes multiple example programs demonstrating usage in different scenarios:

- Tag/Cfg information shared for multiple threads.
- LabVIEW Refnum management. </Description>
- **TagDB Example.vi**: Basic function demonstration
- **TagDB Application Example**: Practical application demonstration with a complete model configuration system
- **TagDB For Control Reference.vi**: Example of handling Reference type data for UI controls
- **TagDB Multi-Thread Example**: Usage example in multi-threaded environments
- **TagDB Using regexp Example.vi**: Regular expression query example</Description>
<Copyright/>
<Packager>NEVSTOP</Packager>
<URL>https://github.com/NEVSTOP-LAB</URL>
<Release_Notes>Update to lv2017 and use vim instead of xnode.</Release_Notes>
<Release_Notes>[add] #14 add delete-multiple interface
Update to lv2017 and use vim instead of xnode.
</Release_Notes>
</Description>
<Destinations>
<Toolkit_VIs>
Expand Down
136 changes: 136 additions & 0 deletions README(en).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# NEVSTOP TagDB Library

[English](./README(en).md) | [中文](./README.md)

NEVSTOP TagDB is an advanced data management library designed specifically for the LabVIEW environment, providing efficient reading, writing, storage, and sharing of configuration and Tag data. Through optimized data structures and caching mechanisms, it offers reliable data persistence and real-time data access solutions for LabVIEW applications.

## Directory Structure

```
├── .github/ # GitHub workflow configurations
├── Benchmark/ # Performance test related files
├── Documentation/ # Documentation and icon resources
├── src/ # Source code directory
│ ├── Example/ # Example programs
│ ├── Probes/ # Custom debugging probes
│ └── TagDB/ # Core library files
│ ├── API/ # Public interface functions
│ ├── Add-ons/ # Additional features
│ └── Typedef/ # Type definitions
├── LabVIEW-TagDB.lvproj # Main project file
└── LabVIEW-TagDB.vipb # VIPackage build file
```

## Core Features

### 1. Flexible Data Storage
- Supports persistent storage of configuration data and Tag data
- Automatically supports conversion and storage of all LabVIEW data types through VIM (VI Macro)
- Specially optimized for Reference type data to ensure efficient storage and retrieval

### 2. Multi-thread Safety
- Provides a comprehensive data sharing mechanism in multi-threaded environments
- Built-in thread safety protection to avoid concurrent access conflicts
- Supports data access and synchronization across VIs and tasks

### 3. High Performance Design
- Implements efficient caching mechanism for fast data access
- Optimized data structures to reduce memory usage and improve retrieval efficiency
- Supports name-based DBRef acquisition method, similar to LabVIEW Named Queue, simplifying programming patterns

### 4. Configuration Management
- Complete configuration file import/export functionality
- Supports saving and restoring system status information
- Provides configuration locking feature to prevent accidental modifications

### 5. Debugging Support
- Offers three custom Probes for convenient runtime debugging and monitoring
- Includes TagDB Probe, TagDB Table Probe, and TagDB Monitor Probe

## API Reference

### Basic Operation Functions

| Function Name | Description |
|--------------|-------------|
| TagDB-Obtain.vi | Obtains TagDB Refnum, creates or opens an existing database |
| TagDB-Release.vi | Releases TagDB Refnum, closes the database |
| TagDB-IsValid.vi | Checks if TagDB Refnum is valid |

### Data Read/Write Functions

| Function Name | Description |
|--------------|-------------|
| TagDB-Write.vim | Writes/updates the value of a single Tag |
| TagDB-Read.vim | Reads the value of a single Tag |
| TagDB-Read By RegExp.vim | Batch reads Tags using regular expressions |
| TagDB-Delete.vi | Deletes a Tag |

### Configuration Management Functions

| Function Name | Description |
|--------------|-------------|
| TagDB-Load.vi | Loads TagDB configuration from file |
| TagDB-Save.vi | Saves TagDB configuration to file |
| TagDB-Set Lock.vi | Locks/unlocks TagDB, disallows/allows adding new Tags |

### Utility Functions

| Function Name | Description |
|--------------|-------------|
| TagDB-Status.vi | Gets current status information of TagDB |
| TagDB-List.vi | Lists all Tag names in the database |
| TagDB_Find Names.vi | Finds Tag names that meet the criteria |
| TagDB-Timestamp.vi | Gets timestamp of TagDB operations |
| TagDB-UpdateUI.vi | Updates UI controls associated with Tags |
| TagDB-Change Detector.vi | Detects changes in Tag values |

## Best Practices

### Data Management
- **Data sharing in multi-threaded environments**: Use TagDB as a data sharing center between multi-threaded applications, avoiding the use of global variables
- **Configuration information storage**: Store system configuration information in TagDB for easy import/export and version control
- **Temporary data caching**: Utilize TagDB's caching functionality to achieve asynchronous updates and fast access to data points
- **Control reference management**: Store LabVIEW front panel control References for convenient dynamic UI manipulation

### Performance Optimization
- For frequently accessed data, consider using TagDB's caching mechanism
- When performing bulk data operations, properly use batch operation functions to improve efficiency
- Appropriately use the locking feature to prevent data modification during critical operations

### Debugging Techniques
- Use the three built-in Probe tools to monitor the status and data changes of TagDB during runtime
- Regularly check the database status using TagDB-Status.vi to detect issues in a timely manner
- Use TagDB-Change Detector.vi to monitor changes in specific Tags, facilitating debugging of complex interaction logic

## Example Programs

The library includes multiple example programs demonstrating usage in different scenarios:

- **TagDB Example.vi**: Basic function demonstration
- **TagDB Application Example**: Practical application demonstration with a complete model configuration system
- **TagDB For Control Reference.vi**: Example of handling Reference type data for UI controls
- **TagDB Multi-Thread Example**: Usage example in multi-threaded environments
- **TagDB Using regexp Example.vi**: Regular expression query example

## Installation Instructions

Install the VIP package using VIPM (VI Package Manager)

## System Requirements

- LabVIEW 2017 or later
- VIPM 2017 or later is recommended for installation

## License

This project is licensed under the MIT License, see the [LICENSE](LICENSE) file for details.

## Contribution Guidelines

Contributions in the form of issue reports and improvement suggestions are welcome. To contribute code, please follow these steps:
1. Fork this repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Submit a Pull Request
166 changes: 135 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,138 @@
# NEVSTOP TagDB Library

用于在 LabVIEW 系统中提供配置、Tag 数据的读写功能。

## FEATURE

- 实现配置、Tag数据的数据保存功能。
- 提供多线程中的数据共享功能
- 通过 Xnode/VIM 支持 LabVIEW 任何数据类型自动转换
- 提供 cache 机制,提供快速的数据访问
- 提供名称获取 DBRef 方法,类似 LabVIEW Named Queue。
- 针对 Reference 类型优化
- 支持配置文件,可导入导出配置、状态信息
- 提供自定义Probe,便于调试

## VI PALETTE

- 获取 TagDB Refnum
- 载入配置文件
- 保存配置文件
- 锁定 TagDB(禁止增加新的Tag)
- 更新 Tag
- 获取 Tag
- 删除 Tag
- 获取 TagDB 状态
- 释放 TagDB

## BEST PRACTICE

- 多线程保存临时数据
- 保存系统配置信息,对配置进行导入导出。
- 提供 Tag 数据点的异步更新,利用 Cache 功能快速的访问数据。
- 存储LabVIEW 前面板控件 Refnum。
[English](./README(en).md) | [中文](./README.md)

NEVSTOP TagDB 是一个专为 LabVIEW 环境设计的高级数据管理库,提供配置及 Tag 数据的高效读写、存储和共享功能。它通过优化的数据结构和缓存机制,为 LabVIEW 应用程序提供了可靠的数据持久化和实时数据访问解决方案。

## 目录结构

```
├── .github/ # GitHub 工作流配置
├── Benchmark/ # 性能测试相关文件
├── Documentation/ # 文档和图标资源
├── src/ # 源代码目录
│ ├── Example/ # 示例程序
│ ├── Probes/ # 自定义调试探针
│ └── TagDB/ # 核心库文件
│ ├── API/ # 公共接口函数
│ ├── Add-ons/ # 附加功能
│ └── Typedef/ # 类型定义
├── LabVIEW-TagDB.lvproj # 主项目文件
└── LabVIEW-TagDB.vipb # VIPackage 构建文件
```

## 核心特性

### 1. 灵活的数据存储
- 支持配置数据和 Tag 数据的持久化存储
- 通过 VIM (VI Macro) 自动支持 LabVIEW 所有数据类型的转换和存储
- 针对 Reference 类型数据进行了特别优化,确保高效存储和检索

### 2. 多线程安全
- 提供完善的多线程环境下的数据共享机制
- 内置线程安全保护,避免并发访问冲突
- 支持跨VI、跨任务的数据访问和同步

### 3. 高性能设计
- 实现高效的缓存机制,提供快速数据访问
- 优化的数据结构,减少内存占用和提高检索效率
- 支持按名称获取 DBRef 的方法,类似 LabVIEW Named Queue,简化编程模式

### 4. 配置管理
- 完整的配置文件导入导出功能
- 支持保存和恢复系统状态信息
- 提供配置锁定功能,防止意外修改

### 5. 调试支持
- 提供三种自定义 Probe,方便运行时调试和监控
- 包括 TagDB Probe、TagDB Table Probe 和 TagDB Monitor Probe

## API 参考

### 基础操作函数

| 函数名称 | 功能描述 |
|---------|---------|
| TagDB-Obtain.vi | 获取 TagDB Refnum,创建或打开现有数据库 |
| TagDB-Release.vi | 释放 TagDB Refnum,关闭数据库 |
| TagDB-IsValid.vi | 检查 TagDB Refnum 是否有效 |

### 数据读写函数

| 函数名称 | 功能描述 |
|---------|---------|
| TagDB-Write.vim | 写入/更新单个 Tag 的值 |
| TagDB-Read.vim | 读取单个 Tag 的值 |
| TagDB-Read By RegExp.vim | 使用正则表达式批量读取 Tag |
| TagDB-Delete.vi | 删除 Tag |

### 配置管理函数

| 函数名称 | 功能描述 |
|---------|---------|
| TagDB-Load.vi | 从文件加载 TagDB 配置 |
| TagDB-Save.vi | 将 TagDB 配置保存到文件 |
| TagDB-Set Lock.vi | 锁定/解锁 TagDB,禁止/允许添加新 Tag |

### 实用工具函数

| 函数名称 | 功能描述 |
|---------|---------|
| TagDB-Status.vi | 获取 TagDB 当前状态信息 |
| TagDB-List.vi | 列出数据库中所有 Tag 名称 |
| TagDB_Find Names.vi | 查找符合条件的 Tag 名称 |
| TagDB-Timestamp.vi | 获取 TagDB 操作的时间戳 |
| TagDB-UpdateUI.vi | 更新与 Tag 关联的 UI 控件 |
| TagDB-Change Detector.vi | 检测 Tag 值的变化 |

## 最佳实践

### 数据管理
- **多线程环境下的数据共享**:使用 TagDB 作为多线程应用程序之间的数据共享中心,避免使用全局变量
- **配置信息存储**:将系统配置信息存储在 TagDB 中,便于导入导出和版本控制
- **临时数据缓存**:利用 TagDB 的缓存功能实现数据点的异步更新与快速访问
- **控件引用管理**:存储 LabVIEW 前面板控件 Reference,方便动态操作 UI

### 性能优化
- 对于频繁访问的数据,考虑使用 TagDB 的缓存机制
- 在大量数据操作时,合理使用批量操作函数以提高效率
- 适当使用锁定功能,防止在关键操作期间数据被修改

### 调试技巧
- 使用内置的三种 Probe 工具监控运行时 TagDB 的状态和数据变化
- 利用 TagDB-Status.vi 定期检查数据库状态,及时发现问题
- 使用 TagDB-Change Detector.vi 监控特定 Tag 的变化,便于调试复杂交互逻辑

## 示例程序

库包含多个示例程序,展示不同场景下的使用方法:

- **TagDB Example.vi**:基础功能演示
- **TagDB Application Example**:带有完整模型配置系统的实际应用演示
- **TagDB For Control Reference.vi**:用于 UI 控件的 Reference 类型数据处理示例
- **TagDB Multi-Thread Example**:多线程环境下的使用示例
- **TagDB Using regexp Example.vi**:正则表达式查询示例

## 安装说明

使用 VIPM (VI Package Manager) 打安装 VIP 包

## 系统要求

- LabVIEW 2017 或更高版本
- 建议使用 VIPM 2017 或更高版本进行安装

## 许可证

本项目使用 MIT 许可证,详见 [LICENSE](LICENSE) 文件。

## 贡献指南

欢迎提交问题报告和改进建议。如需贡献代码,请遵循以下流程:
1. Fork 本仓库
2. 创建功能分支
3. 提交更改
4. 推送到分支
5. 提交 Pull Request


Loading
Loading