Skip to content

Commit ac01502

Browse files
nevstopyao0928nevstopCopilotCopilot
authored
Dev_2026Q1 (#106)
* init Dev_2026Q1 * [fix] #105 Numeric format of "100B" error * 更新工作流,移除对 "Epoch Date & Time" 包的依赖;更新 README,修正描述并添加新模板信息 * 更新一些VI属性 * [update] #109 disable <safestr> for string datatype * #109 * #107 不能复现,deepseek对算法评估后也没有问题 * [fix] #107 fix potential bug in “Strip Trailing Zeros for Float String.vi” * Update .github/workflows/Check_Broken_VIs.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/Build_VIPM_Library.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update CSM API String Arguments Support.vipb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Restore Apache 2.0 license badge in README.md Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-API-String-Arguments-Support/sessions/cb5f6097-7468-4814-a2e7-4dfe6ee3a1af Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com> * update vipb * Fix license badge to MIT (was incorrectly set to Apache 2.0) Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-API-String-Arguments-Support/sessions/d8b32264-5d85-43ac-9905-1840f79a083a Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com> * Sync and improve English and Chinese READMEs for clarity and consistency Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-API-String-Arguments-Support/sessions/56602093-c286-43b4-9e44-18e8e656f41e Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com> --------- Co-authored-by: yao0928 <yao.li@emerson.com> Co-authored-by: nevstop <nevstop@NEVSTOP-LAB> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 01c3fe3 commit ac01502

File tree

51 files changed

+61
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+61
-59
lines changed

.github/workflows/Build_VIPM_Library.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ jobs:
4848
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4949
- uses: actions/checkout@v3
5050

51-
- name: vipm-InstallPackage
52-
uses: NEVSTOP-LAB/vipm-InstallPackage@main
53-
with:
54-
LabVIEW_Version: 2017
55-
# Package could be PackageName/PacakgeWithVersion/vipFilePath
56-
Package: "Epoch Date & Time"
51+
#不再依赖 Epoch Date & Time 包
5752

5853
- uses: NEVSTOP-LAB/InstallNevstopPackage@main
5954
with:

.github/workflows/Check_Broken_VIs.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
- '**.svg'
1919
- '**.json'
2020
- '**.yml'
21-
21+
2222
push:
2323
paths-ignore:
2424
- '**.md'
@@ -42,12 +42,7 @@ jobs:
4242
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4343
- uses: actions/checkout@v3
4444

45-
- name: vipm-InstallPackage
46-
uses: NEVSTOP-LAB/vipm-InstallPackage@main
47-
with:
48-
LabVIEW_Version: 2017
49-
# Package could be PackageName/PacakgeWithVersion/vipFilePath
50-
Package: "Epoch Date & Time"
45+
#不再依赖 Epoch Date & Time 包
5146

5247
- uses: NEVSTOP-LAB/InstallNevstopPackage@main
5348
with:

CSM API String Arguments Support.vipb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-08-12 17:59:50" Modified_Date="2026-01-06 14:27:18" Creator="yaoli" Comments="" ID="364b0482be4befe0feaff83d08f77cef">
1+
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-08-12 17:59:50" Modified_Date="2026-03-28 20:21:04" Creator="yaoli" Comments="" ID="521fa139301b0f81f36d68bc0327b080">
22
<Library_General_Settings>
33
<Package_File_Name>NEVSTOP_lib_CSM_API_String_Arguments_Support</Package_File_Name>
4-
<Library_Version>2025.11.0.1</Library_Version>
4+
<Library_Version>2026.1.1.1</Library_Version>
55
<Auto_Increment_Version>false</Auto_Increment_Version>
66
<Library_Source_Folder>.</Library_Source_Folder>
77
<Library_Output_Folder>vip</Library_Output_Folder>
@@ -52,12 +52,9 @@ More information for the supported datatype format, please visit: https://github
5252
<Copyright/>
5353
<Packager>NEVSTOP</Packager>
5454
<URL>https://github.com/NEVSTOP-LAB/CSM-API-String-Arugments-Support</URL>
55-
<Release_Notes>[feature] #95 support lvlibp
56-
[update] #99 support leaf name searching in Query Data as API String Arguments.vim
57-
[fix] #98 Do not check (), to avoid bugs
58-
[fix] #100 for enum type, empty string should be converted to the reference enum value.
59-
[fix] #102 for cluster type, all elements will be used in no-tag mode in ��Data To API String Arguments.vi��
60-
[fix] #104 Throw up error if API String does'nt match any enum option</Release_Notes>
55+
<Release_Notes>[update] #109 disable &lt;safestr&gt; for string datatype
56+
[fix] #105 Correct parsing and formatting of numeric values with "B" (byte) suffix, e.g. "100B"
57+
[fix] #107 fix potential bug in "Strip Trailing Zeros for Float String.vi"</Release_Notes>
6158
</Description>
6259
<Destinations>
6360
<Toolkit_VIs>

README(zh-cn).md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
# CSM-API-String-Arguments-Support
22

3-
[English](./README.md) | [中文](./README(CN).md)
3+
[English](./README.md) | [中文](./README(zh-cn).md)
44

55
[![安装量](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/badge.svg?metric=installs)](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/)
66
[![星级评分](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/badge.svg?metric=stars)](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/)
7-
[![许可证](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7+
[![许可证](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
88
[![GitHub下载量](https://img.shields.io/github/downloads/NEVSTOP-LAB/CSM-API-String-Arguments-Support/total)](https://github.com/NEVSTOP-LAB/CSM-API-String-Arguments-Support/releases)
99

10-
该库用于增强通信状态机(CSM)的API参数功能,支持以纯文本格式传递各种数据类型,且特别优化了手动输入体验
10+
本库扩展了 [CSM](https://github.com/NEVSTOP-LAB/Communicable-State-Machine)(通信状态机)框架的 API 参数功能,支持以纯文本格式传递各种数据类型。
1111

12-
库中提供了两个新的CSM模板,它们都包含"Data: Get Configuration"和"Data: Set Configuration"两个内置状态,用于访问存储在'>> internal data >>'移位寄存器中的配置数据
12+
库中还附带两个 CSM 模板,内置 `Data: Get Configuration``Data: Set Configuration``Data: Get Internal Data` 状态,可作为构建需要读写 `>> internal data >>` 移位寄存器数据的 CSM 模块的起点
1313

1414
![example](.github/doc.png)
1515

1616
## 支持的数据类型
1717

1818
- 字符串 (String)
1919
- 路径 (Path)
20-
- 布尔值 (Boolean)
2120
- 标签 (Tag)
22-
- 引用号 (Refnum,包括IVI/VISA/UserDefinedRefnumTag)
23-
- 整数 (I8,I16,I32,I64,U8,U16,U32,U64)
21+
- 引用号 (Refnum,包括 IVI/VISA/UserDefinedRefnumTag)
22+
- 布尔值 (Boolean)
23+
- 整数 (I8, I16, I32, I64, U8, U16, U32, U64)
2424
- 浮点数 (DBL/SGL)
2525
- 复数 (DBL/SGL)
2626
- 时间戳 (Timestamp)
2727
- 枚举 (Enum)
2828
- 数组 (Array)
2929
- 簇 (Cluster)
30-
- 其他类型 (使用CSM-Hexstr表示)
30+
- 其他类型 (使用 CSM-Hexstr 表示)
3131

3232
### 字符串(String)/路径(Path)/引用号(Refnum)/标签(Tag)
3333

34-
字符串和路径类型遵循CSM的规则,特殊字符如'->|'、'->'、'-@'、'-&'、'>>'、','和';'在传递前会自动转换为%[十六进制]字符串,效果等同于使用**CSM AdvanceAPI\CSM Make String Arguments Safe.vi**
34+
字符串和路径类型中,CSM 关键字(`->|``->``-@``-&``>>``,``;`在传递前会自动转换为 `%[十六进制]` 字符串,效果等同于 **CSM AdvanceAPI\CSM Make String Arguments Safe.vi**
3535

3636
> [!NOTE]
37-
> LabVIEW的引用号(Refnum,包括IVI/VISA/UserDefinedRefnumTag)和标签(Tag)也支持,转换规则与String类型相同
37+
> 引用号(Refnum,包括 IVI/VISA/UserDefinedRefnumTag和标签Tag)的转换规则与 String 类型相同
3838
3939
### 布尔值(Boolean)
4040

@@ -45,6 +45,7 @@
4545
- True/False
4646
- On/Off
4747
- Enable/Disable
48+
- Active/Inactive
4849
- valid/Invalid
4950
- 1/0
5051
- Open/Close
@@ -169,31 +170,31 @@ _**特殊情况说明**_:
169170
170171
### 枚举(Enum)
171172

172-
`Indexed Enum` 定义为 [索引编号(index)][分隔符(separator)][枚举字符串] 格式的字符串。支持以下表达方式:
173+
`Indexed Enum` 定义为 `[索引编号][分隔符][枚举字符串]` 格式的字符串。支持以下表达方式:
173174

174-
> 十进制数字作为索引,== 作为分隔符:
175-
>
176-
> - 1 == boolean
177-
> - 2 == string
178-
> - 4 == dbl
179-
> - 8 == number
180-
>
181-
> 十六进制数字作为索引,-- 作为分隔符:
175+
> 十六进制索引,`--` 作为分隔符:
182176
>
183177
> - 0x01 -- boolean
184178
> - 0x02 -- string
185179
> - 0x04 -- dbl
186180
> - 0x08 -- number
187181
>
188-
> 二进制数字作为索引,__ 作为分隔符:
182+
> 二进制索引,`__` 作为分隔符:
189183
>
190184
> - 0b0001 __ boolean
191185
> - 0b0010 __ string
192186
> - 0b0100 __ dbl
193187
> - 0b1000 __ number
188+
>
189+
> 十进制索引,`==` 作为分隔符:
190+
>
191+
> - 1 == boolean
192+
> - 2 == string
193+
> - 4 == dbl
194+
> - 8 == number
194195
195196
> [!NOTE]
196-
> 索引编号(index)支持所有整数的表达方式
197+
> 索引编号支持所有整数的表达方式
197198
198199
_**转换规则1: 没有索引编号时**_
199200

@@ -215,10 +216,10 @@ _**转换规则2:包含索引编号时**_
215216
- 字符串 "9 - CCCC" 将转换为 Enum(9 - CCCC),数字值为 2
216217

217218
> [!NOTE]
218-
> - String matching is case-insensitive.
219-
> - String matching performs regular expression matching starting from the first element in the enum list until the first match is found. Therefore, partial writing is supported.
220-
> For example: 0x00 -- Spring | 0x01 -- Summer | 0x02 -- Autumn | 0x03 -- Winter
221-
> The input string "aut" will match to "Autumn".
219+
> - 字符串匹配不区分大小写。
220+
> - 字符串匹配采用正则表达式,从枚举列表第一个元素开始依次匹配,直到找到第一个符合项为止,因此支持部分匹配。
221+
> 例如枚举为:0x00 -- Spring | 0x01 -- Summer | 0x02 -- Autumn | 0x03 -- Winter
222+
> 输入字符串 "aut" 将匹配到 "Autumn"
222223
223224
### 数组(Array)
224225

@@ -254,15 +255,16 @@ a2 b2 c2 d2 e2
254255
255256
### 簇(Cluster)
256257

257-
**转换规则1: 标签-数据对(Tag:Value)模式**
258+
**转换规则1标签-数据对(Tag:Value)模式**
258259

259-
在标签-数据对模式下,输入字符串由多个标签-数据对组成,冒号(:)用于分隔标签和数据,分号(;)用于分隔不同元素。花括号({})用作边界符号。对于非复杂的混合数据类型,花括号可以省略。其他规则如下:
260+
在标签-数据对模式下,输入字符串由多个 `标签:值` 对组成,冒号`:`)分隔标签与值,分号`;`)分隔不同元素对。花括号`{``}`)为边界符,简单数据类型可省略。其他规则如下:
260261

261-
- 标签对应簇中元素的名称,值会根据对应元素的数据类型进行转换。
262-
- 只需描述需要修改的元素,与数据原型一致的元素可以省略。
263-
- 通过名称匹配元素,顺序无关紧要。
264-
- 对于嵌套簇,子簇元素的标签格式为"父簇标签.子簇元素标签"。
265-
- 嵌套簇中,如果子簇元素的标签名称唯一,可以省略父簇的标签。
262+
- 标签对应簇中元素的名称,值根据对应元素的数据类型进行转换。
263+
- 只需描述需要修改的元素,与原型值一致的元素可省略。
264+
- 通过名称匹配元素,顺序无关。
265+
- 对于嵌套簇,子簇元素的标签格式为 `父簇标签.子簇元素标签`
266+
- 若子簇元素标签在整个簇中唯一,可省略父簇标签。
267+
- 若未提供标签,则输入字符串将转换为簇的第一个元素,方便优先设置第一个元素。
266268

267269
**示例:**
268270

@@ -286,7 +288,7 @@ typedef cluster{
286288
>
287289
> `{subCluster.b2:On}` 表示将簇中子簇的布尔类型数据 `b2` 设置为 TRUE。其他元素的值保持原型输入值不变。由于 `b2` 是唯一的,可以省略父簇标签,直接使用 `b2:On` 也表示相同的转换。
288290
289-
**转换规则2: 无标签模式**
291+
**转换规则2无标签模式**
290292

291293
对于簇,也支持仅输入数据字符串,各值之间用分号分隔。
292294

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
[![Installs](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/badge.svg?metric=installs)](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/)
66
[![Stars](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/badge.svg?metric=stars)](https://www.vipm.io/package/nevstop_lib_csm_api_string_arguments_support/)
7-
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
88
[![GitHub Downloads](https://img.shields.io/github/downloads/NEVSTOP-LAB/CSM-API-String-Arguments-Support/total)](https://github.com/NEVSTOP-LAB/CSM-API-String-Arguments-Support/releases)
99

10-
This library enhances the API parameters for the Communicable State Machine (CSM) framework by enabling the inclusion of various data types in plain text format and is specially optimized for manual input experience.
10+
This library extends the [CSM](https://github.com/NEVSTOP-LAB/Communicable-State-Machine) (Communicable State Machine) framework's API parameters to support various data types in plain text format.
1111

12-
The library also provides two additional templates that include "Data: Get Configuration" and "Data: Set Configuration" states. These templates serve as a starting point for building CSM modules with the ability to access data stored in the '>> internal data >>' shift register.
12+
It also includes two templates with built-in `Data: Get Configuration`, `Data: Set Configuration`, and `Data: Get Internal Data` states — a ready-to-use starting point for CSM modules that need to read and write data in the `>> internal data >>` shift register.
1313

1414
![example](.github/doc.png)
1515

@@ -310,4 +310,4 @@ In Non-Tag mode, the input string consists only of data values separated by semi
310310
311311
### Other Data Types
312312

313-
Other data types are first converted to variants and then transformed using CSM-HexStr.
313+
Other data types are treated as variants and transformed using CSM-HexStr.

_test/Untitled 1.vi

2.62 KB
Binary file not shown.

0 commit comments

Comments
 (0)