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
10 changes: 9 additions & 1 deletion .github/workflows/Run Testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '**.svg'
- '**.json'
- '**.yml'

# Also add paths-ignore for pull requests
pull_request:
branches:
Expand Down Expand Up @@ -43,6 +43,14 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: NEVSTOP-LAB/InstallNevstopPackage@main
with:
LabVIEW_Version: 2017
NEVSTOP-FTP-IP: ${{ secrets.VIPM_FTP_IP }}
NEVSTOP-FTP-PORT: ${{ secrets.VIPM_FTP_PORT }}
PackageName: Communicable-State-Machine
PackageName2: CSM-API-String-Arguments-Support

- name: Run lvCICD Test cases with VITester
id: StartVITester
uses: NEVSTOP-LAB/lvCICD@main
Expand Down
11 changes: 6 additions & 5 deletions CSM INI Static Variable Support.vipb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-11-06 11:10:53" Modified_Date="2026-01-26 13:03:00" Creator="liyao" Comments="" ID="da79750720ceb01a302914ce7bab0807">
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-11-06 11:10:53" Modified_Date="2026-03-20 13:36:25" Creator="liyao" Comments="" ID="687709725bf4fbab8bdf77a163d343b5">
<Library_General_Settings>
<Package_File_Name>NEVSTOP_lib_CSM_INI_Static_Variable_Support</Package_File_Name>
<Library_Version>2025.11.0.1</Library_Version>
<Library_Version>2026.1.0.1</Library_Version>
<Auto_Increment_Version>false</Auto_Increment_Version>
<Library_Source_Folder>.</Library_Source_Folder>
<Library_Output_Folder>vip</Library_Output_Folder>
Expand Down Expand Up @@ -40,9 +40,10 @@
<Copyright/>
<Packager>NEVSTOP</Packager>
<URL>https://github.com/NEVSTOP-LAB/CSM-INI-Static-Variable-Support</URL>
<Release_Notes>[update] update INIViewer Tool
[fix] #87 improve performance of "Sync to File.vi".
[fix] #92 fix path issue of built exe</Release_Notes>
<Release_Notes>[add] #95 add API: "CSM - Load Configuration Variables From String.vi"
[update] update tool icon
[fix] #94 INI-Viewer window is not opened after clicked in tool launcher.
</Release_Notes>
</Description>
<Destinations>
<Toolkit_VIs>
Expand Down
Binary file modified CSM Tool/CSM-INI Variable Viewer - DebugTool.vi
Binary file not shown.
Binary file modified Example/1. Used as parameters parsed by CSM.vi
Binary file not shown.
Binary file not shown.
Binary file modified Example/3. In CSM API parameters.vi
Binary file not shown.
Binary file modified Example/4. Multi-file configuration system.vi
Binary file not shown.
Binary file modified Example/5. import Config.ini with include section.vi
Binary file not shown.
Binary file modified Example/6. Read Nested Variables.vi
Binary file not shown.
Binary file modified Example/7. Write and Read Configuration.vi
Binary file not shown.
Binary file added Example/8. import Configuration From String.vi
Binary file not shown.
Binary file modified INI-Static-Variable-Support/As String.mnu
Binary file not shown.
Binary file modified INI-Static-Variable-Support/CSM - Configuration File Path.vi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
</Item>
<Item Name="MultipleFile" Type="Folder">
<Item Name="CSM - Configuration File Path.vi" Type="VI" URL="../CSM - Configuration File Path.vi"/>
<Item Name="CSM - Load Configuration Variables From File.vi" Type="VI" URL="../CSM - Load Configuration Variables From File.vi"/>
<Item Name="CSM - Load Configuration Variables From String.vi" Type="VI" URL="../CSM - Load Configuration Variables From String.vi"/>
<Item Name="CSM - Mark All Temp Variables as Permanent.vi" Type="VI" URL="../CSM - Mark All Temp Variables as Permanent.vi"/>
<Item Name="CSM - Sync Configuration Variables to File.vi" Type="VI" URL="../CSM - Sync Configuration Variables to File.vi"/>
<Item Name="CSM - Unload Configuration Variable File.vi" Type="VI" URL="../CSM - Unload Configuration Variable File.vi"/>
<Item Name="CSM - Restore Variable Value.vi" Type="VI" URL="../CSM - Restore Variable Value.vi"/>
<Item Name="CSM - Reset to Default.vi" Type="VI" URL="../CSM - Reset to Default.vi"/>
</Item>
<Item Name="As String" Type="Folder">
<Item Name="CSM - Load Configuration Variables From File.vi" Type="VI" URL="../CSM - Load Configuration Variables From File.vi"/>
<Item Name="CSM - Read All Variable Names.vi" Type="VI" URL="../_Support/CSM - Read All Variable Names.vi"/>
<Item Name="CSM - Read Sections.vi" Type="VI" URL="../_Support/CSM - Read Sections.vi"/>
<Item Name="CSM - Read Key Names.vi" Type="VI" URL="../_Support/CSM - Read Key Names.vi"/>
Expand Down
Binary file modified INI-Static-Variable-Support/LabVIEW-Config/Open.vi
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified INI-Static-Variable-Support/_Support/CSMSVMgr/Read INI String.vi
Binary file not shown.
Binary file not shown.
Binary file modified INI-Static-Variable-Support/_Support/INI-FGV(lvlibp).vi
Binary file not shown.
Binary file modified INI-Static-Variable-Support/_Support/INI-FGV.vi
Binary file not shown.
Binary file modified INI-Static-Variable-Support/_Support/_fgv-oper.ctl
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Variable Syntax: `${section.variable:defaultValue}`
- Step2.3: In the code for this part, note that CSM INI Variable Support is not limited to parameters. It can be used with any field.
- Step2.4: Expected result for the code execution in Step2.3.



## Loading Configuration by Providing a Cluster Prototype (2. Load the corresponding configuration by providing the prototype.vi)

Expand Down Expand Up @@ -98,7 +98,7 @@ Data sources may include: information sent via message parameters, parameters in
- Step5.1: `Convert API String to Cluster(Default in Session).vim` conversion. The "non-existing module" section does not exist, so the provided reference data is used, resulting in IP:127.0.0.1 and port:80.
- Step5.2: `Convert API String to Cluster(Default in Session).vim` conversion. Load configuration from the given section/key, but neither exists. The provided reference data is used, resulting in IP:127.0.0.1 and port:80.



## Multi-file Configuration System (4. Multi-file configuration system.vi)

Expand Down Expand Up @@ -202,7 +202,7 @@ path = ${root}/${info.operator}/${info.date}/${info.test}${info.time}.tdms

Using the configuration file example above:

**Scenario 1:** Reading `${file.path}` returns an actual file path dynamically composed of other configuration items, enabling flexible path definitions.
**Scenario 1:** Reading `${file.path}` returns an actual file path dynamically composed of other configuration items, enabling flexible path definitions.

**Scenario 2:** The `[case1]` and `[case2]` sections define two different sets of related configuration information. By modifying `${RT.select}`, you can switch the result of accessing `${RT.addr}`.

Expand Down Expand Up @@ -239,4 +239,16 @@ You can use `CSM - Write Configuration Variable.vi` and `CSM - Write INI String.

- By default, configurations modified in memory are not automatically synchronized to the configuration file. You need to call `CSM - Sync Configuration Variables to File.vi` to synchronize them to the file.
- Modified variables will only be preserved when synchronized to the file if the original configuration file defined those specific configuration items. If the original configuration file did not define certain items, the modified variables are saved only in memory by default and are not synchronized to the file.
- You can call `CSM - Mark All Temp Variables as Permanent.vi` to mark all temporary variables as permanent, ensuring that all variables are preserved when synchronized to the configuration file.
- You can call `CSM - Mark All Temp Variables as Permanent.vi` to mark all temporary variables as permanent, ensuring that all variables are preserved when synchronized to the configuration file.

## Loading Configuration Variables From String (8. import Configuration From String.vi)

### Overview

This example demonstrates how to load configuration variables directly from a string without creating a configuration file.

The effect is equivalent to writing configuration variables one by one through APIs. This can simplify the code. All configuration information will be cached in temporary variable space.

### Introduction

CSM INI Variable Support API provides an API for loading configuration variables from a string. You can use `CSM - Load Configuration Variables From String.vi` to load configuration variables from a string. The effect is equivalent to writing configuration variables one by one through APIs. This can simplify the code. All configuration information will be cached in temporary variable space.
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,18 @@ CSM INI Variable Support提供了修改配置信息的API。您可以使用这
- 可以调用`CSM - Mark All Temp Variables as Permanent.vi`将所有临时变量标记为永久变量,这样在同步保存到配置文件时,所有变量都会被保留下来。


## 从字符串加载配置变量(8. import Configuration From String.vi)

### Overview

本范例用于展示如何从字符串加载配置变量,而不需要创建配置文件。

这样效果与使用 API 逐条写入配置变量相同。可以简化代码。所有的配置信息都将缓存在临时变量空间中。

### Introduction

CSM INI Variable Support API提供了从字符串加载配置变量的API。您可以使用`CSM - Load Configuration Variables From String.vi`来从字符串加载配置变量。这样效果与使用 API 逐条写入配置变量相同。可以简化代码。所有的配置信息都将缓存在临时变量空间中。




Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,19 @@ Loads configuration variables from a specified file. If the section name postfix
- <b>Configuration Path</b>: Configuration file path.
- <b>Section Postfix ("")</b>: Section name postfix.

### CSM - Load Configuration Variables From String.vi
Loads configuration variables from a specified string. If the section name postfix is not empty, the loaded section names will have this postfix appended.

<b>Section Postfix ("")</b> is primarily used when loading multiple configuration files that have identical sections. For example, two configuration files `Hardware1.ini` and `Hardware2.ini` both have a section named `Serial` with identical internal keys indicating serial port configuration. In this case, the configuration in the file loaded later would overwrite the configuration in the file loaded earlier. Using <b>Section Postfix ("")</b> prevents section name conflicts.

<b>Reference Example</b>: `8. import Configuration From String.vi`.

> - Ref: CSM INI-Variable Configuration File Path

-- <b>Controls</b> --
- <b>Configuration String</b>: Configuration string.
- <b>Section Postfix ("")</b>: Section name postfix.

### CSM - Unload Configuration Variable File.vi
Unloads a configuration variable file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,20 @@
- <b>Configuration Path</b>: 配置文件路径。
- <b>Section Postfix ("")</b>: 节名后缀。


### CSM - Load Configuration Variables From String.vi
从指定字符串加载配置变量。如果节名后缀不为空,载入的节名称会加上该后缀。

<b>Section Postfix ("")</b>主要用于载入多个配置文件但具有相同节的情况。例如: 两个配置文件`Hardware1.ini`和`Hardware2.ini`,都有一个名为`Serial`的节且内部的Keys相同(表示串口配置),那么后载入的文件中的配置会覆盖先载入的文件中的配置。使用<b>Section Postfix ("")</b>可以避免节名冲突。

<b>参考范例</b>: `8. import Configuration From String.vi`。

> - Ref: CSM INI-Variable配置文件路径

-- <b>输入控件(Controls)</b> --
- <b>Configuration String</b>: 配置字符串。
- <b>Section Postfix ("")</b>: 节名后缀。

### CSM - Unload Configuration Variable File.vi
卸载配置变量文件。

Expand Down
Binary file modified test/Example/Example/CSM with INI Config.vi
Binary file not shown.
Binary file modified test/Example/testcase - Convert API String to Cluster.vi
Binary file not shown.
Binary file modified test/test performance.vi
Binary file not shown.
Binary file modified testcases/csm-ini-variable-addon/testVIs/test - NESTED read.vi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading