Skip to content
Draft
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: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"MD033": false,
"MD013": false,
"MD032": false,
"MD028": false,
"MD024": false,
"MD007": false,
"MD022": false,
"MD040": false
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"cSpell.words": [
"Cacher",
"csmdoc",
"csmlog",
"CSMLS",
"CSMP",
"CSMQ",
"Evnt",
"Gevt",
"HEXSTR",
"lvclass",
"Massdata",
"ogtk",
"Refnum",
"Splite",
"Struct",
"usecase"
],
"files.autoGuessEncoding": true
}
Binary file modified CSM Tool/CSM-MassData Cache Status Viewer.vi
Binary file not shown.
3 changes: 3 additions & 0 deletions CSM-MassData-Parameter-Support.lvproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<Item Name="example" Type="Folder" URL="../example">
<Property Name="NI.DISK" Type="Bool">true</Property>
</Item>
<Item Name="help" Type="Folder" URL="../help">
<Property Name="NI.DISK" Type="Bool">true</Property>
</Item>
<Item Name="CSM-MassData-Parameter-Support.vipb" Type="Document" URL="../CSM-MassData-Parameter-Support.vipb"/>
<Item Name="Dependencies" Type="Dependencies">
<Item Name="user.lib" Type="Folder">
Expand Down
25 changes: 23 additions & 2 deletions CSM-MassData-Parameter-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-08-12 17:59:50" Modified_Date="2025-10-12 21:43:56" Creator="yaoli" Comments="" ID="07e4427f487bb6732398a60dbc8e72b2">
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-08-12 17:59:50" Modified_Date="2026-01-03 17:01:18" Creator="yaoli" Comments="" ID="99a5e88aa29ecc6d151635b10ac0adcc">
<Library_General_Settings>
<Package_File_Name>NEVSTOP_lib_CSM_MassData_Parameter_Support</Package_File_Name>
<Library_Version>2025.10.0.1</Library_Version>
<Library_Version>2025.11.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 @@ -134,6 +134,12 @@ In LabVIEW test and measurement applications, handling large data types such as
<Preserve_Hierarchy>true</Preserve_Hierarchy>
<Path>&lt;user.lib&gt;\_NEVSTOP\Communicable State Machine(CSM)</Path>
</Additional_Destination>
<Additional_Destination>
<Name>LabVIEW</Name>
<LLB>false</LLB>
<Preserve_Hierarchy>true</Preserve_Hierarchy>
<Path>&lt;application&gt;</Path>
</Additional_Destination>
</Destinations>
<Source_Files>
<Destination_Overrides>
Expand Down Expand Up @@ -166,6 +172,12 @@ In LabVIEW test and measurement applications, handling large data types such as
<Additional_Destination>true</Additional_Destination>
<Additional_Destination_Index>1</Additional_Destination_Index>
</Destination_Overrides>
<Destination_Overrides>
<Path>help</Path>
<Destination>0</Destination>
<Additional_Destination>true</Additional_Destination>
<Additional_Destination_Index>2</Additional_Destination_Index>
</Destination_Overrides>
<Password_Overrides>
<Path>.</Path>
<Password/>
Expand Down Expand Up @@ -197,6 +209,15 @@ In LabVIEW test and measurement applications, handling large data types such as
<Exclusions>
<Path>LICENSE</Path>
</Exclusions>
<Exclusions>
<Path>.vscode</Path>
</Exclusions>
<Exclusions>
<Path>.markdownlint.json</Path>
</Exclusions>
<Exclusions>
<Path>README(zh-cn).md</Path>
</Exclusions>
<Place_Folder_Contents>
<Path/>
</Place_Folder_Contents>
Expand Down
Binary file modified _test/obsolete_examples/Main.vi
Binary file not shown.
Binary file not shown.
Binary file modified addons/MassData-Parameter/CSM - Convert Argument to MassData.vim
Binary file not shown.
Binary file not shown.
Binary file modified addons/MassData-Parameter/CSM - Convert MassData to Argument.vim
Binary file not shown.
Binary file modified addons/MassData-Parameter/CSM - MassData Data Type String.vi
Binary file not shown.
Binary file modified addons/MassData-Parameter/CSM - MassData Parameter Status.vi
Binary file not shown.
Binary file not shown.
Binary file modified addons/MassData-Parameter/dir.mnu
Binary file not shown.
Binary file modified example/1. MassData Argument Format.vi
Binary file not shown.
Binary file modified example/2. Show MassData Cache Status in FP.vi
Binary file not shown.
Binary file modified example/3. MassData in Non-CSM Framework.vi
Binary file not shown.
Binary file modified example/4. MassData in CSM.vi
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# CSM MassData Support Addon

## MassData Argument Format (1. MassData Argument Format.vi)

### Overview

MassData arguments are used within the CSM framework to transfer large amounts of data, such as arrays and waveform data. MassData arguments are also used for lossless transfer of complex data types. This example demonstrates the MassData argument formats supported by the CSM API.

### Introduction

This example simulates the generation of two sets of data: a set of I32 array data and a set of waveform data. Both sets are converted into MassData arguments.

CSM supports the following MassData argument format:

```
<massdata>Start:8057;Size:4004;DataType:1D I32
```

The meaning of each part is as follows:

- `<massdata>`: Indicates that this is a MassData argument.
- `Start`: The starting address of the MassData in memory.
- `Size`: The size of the MassData (in bytes).
- `DataType`: (Optional) The data type of the MassData. Depending on the conversion function selected, this part may not be included.

### Steps

- Step 1: I32 array data. The conversion function selected for this step is `CSM - Convert MassData to Argument With DataType.vim`, so it includes the `DataType` section.
- Step 1.1: Construct raw data, which in a real-world program comes from hardware acquisition, data reception, etc.
- Step 1.2: Call `CSM - Convert MassData to Argument With DataType.vim` to convert the raw data into a MassData argument. You can view the converted argument format on the front panel.
- Step 1.3: Use `CSM - MassData Data Type String.vi` to retrieve the data type from the MassData argument string.
- Step 1.4: Use `CSM - Argument Type.vi` to retrieve the CSM argument tag, which in this case is `<massdata>`.
- Step 1.5: Convert the MassData argument back to raw data. You can view the converted data on the front panel. The converted data should match the original data exactly.
- Step 2: Waveform Data. The conversion function selected for this section is `CSM - Convert MassData to Argument.vim`, so it does not include the `DataType` section.
- Step 2.1: Construct raw data, which in a real-world program comes from hardware acquisition, data reception, etc.
- Step 2.2: Call `CSM - Convert MassData to Argument.vim` to convert the raw data into a MassData argument. You can view the converted argument format on the front panel. The `DataType` section is not included.
- Step 2.3: Use `CSM - Argument Type.vi` to retrieve the CSM argument tag, which in this case is `<massdata>`.
- Step 2.4: Convert the MassData argument back to raw data. You can view the converted data on the front panel. The converted data should match the original data exactly.



## View MassData Cache Status (2. Show MassData Cache Status in FP.vi)

### Overview

MassData uses a background circular queue to cache data. You can configure the size of the queue via the CSM API parameters. This example demonstrates how to view the MassData cache status.

### Introduction

MassData provides a helper function, `CSM - MassData Update Status Indicator.vi`, for viewing the status of the cache. This example illustrates how to use this function.

### Steps

- Step 1: Use `CSM - Config MassData Parameter Cache Size.vi` to set the cache size. You can visually verify on the interface that this setting takes effect.
- Step 2: In every loop iteration, construct a new set of data.
- Step 3: Use the CSM MassData API to pack and unpack the data, simulating usage in an actual program.
- Step 4: Use `CSM - MassData Update Status Indicator.vi` to update the vertical cache status indicator on the UI.
- Step 5: Use `CSM - MassData Update Status Indicator.vi` to update the horizontal cache status indicator on the UI.
- Step 6: Loop interval. Steps 3 through 4 are repeated in each iteration.
- Step 7: (Optional) You can use the CSM Tool provided by this addon to view the MassData cache status more quickly.



## Using MassData in a Non-CSM Framework (3. MassData in Non-CSM Framework.vi)

### Overview

You can use MassData in non-CSM framework. This example demonstrates how to utilize MassData in a non-CSM framework.

### Introduction

Using a Producer/Consumer design pattern example, this VI demonstrates how to use MassData in a non-CSM framework. The data producer is responsible for generating data, packing data into a MassData argument, and transmitting data to the data consumer via a queue. The data consumer is responsible for consuming the data, unpacking the MassData format back into raw data, and processing the raw data. This example illustrates the entire process.

### Steps

- Step 1: Use `CSM - Config MassData Parameter Cache Size.vi` to set the cache size.
- Step 2: Data producer loop
- Step 2.1: Construct raw data, which in a real-world program comes from hardware acquisition, data reception, etc.
- Step 2.2: Call `CSM - Convert MassData to Argument.vim` to convert the raw data into a MassData argument.
- Step 2.3: Transmit the converted MassData argument to the data consumer via a queue.
- Step 3: Data consumer loop
- Step 3.1: Receive the MassData argument from the queue.
- Step 3.2: Call `CSM - Convert Argument to MassData.vim` to convert the MassData argument back into raw data.
- Step 3.3: (Optional) Use `CSM - MassData Update Status Indicator.vi` to update the cache status indicator on the UI.



## Using MassData in the CSM Framework (4. MassData in CSM.vi)

### Overview

Demonstrates how to use MassData within the CSM framework.

### Introduction

This example uses a Producer/Consumer scenario to show how MassData operates within the CSM context.

A non-CSM loop acts as the data producer, responsible for generating data, packing the data into a MassData argument, and sending the data via a synchronous message to the CSM module, which acts as the data consumer. This example demonstrates this process.

### Steps

- Step 1: Use `CSM - Config MassData Parameter Cache Size.vi` to set the cache size.
- Step 2: Data producer loop. This loop is not a CSM module.
- Step 2.1: Construct raw data, which in a real-world program comes from hardware acquisition, data reception, etc. Call `CSM - Convert MassData to Argument.vim` to convert the raw data into a MassData argument.
- Step 2.2: Use `CSM - Wait and Send Message for Reply.vi` to send the data as an argument for `API: Update Waveform` to the CSM module, marking the sender as data producer.
- Step 2.3: Data is sent only when the Generate button is pressed.
- Step 2.4: (Optional) Use `CSM - MassData Update Status Indicator.vi` to update the cache status indicator on the UI.
- Step 3: Data consumer loop. This loop is a CSM module named "CSM".
- Step 3.1: In the `API: Update Waveform` case, take the received argument and use `CSM - Convert Argument to MassData.vim` to convert the MassData argument back to raw data and display the data.
- Step 3.3: (Optional) Other cases remain consistent with the template and are unmodified.
- Step 4: During the program exit process, use `CSM - Wait and Send Message for Reply.vi` to send the synchronous message "Macro: Exit" to the CSM module, causing the CSM module to shut down.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# CSM MassData Support Addon

## MassData参数格式 (1. MassData Argument Format.vi)

### Overview

Massdata 参数用于在 CSM 框架中传递大量数据,例如:数组、波形数据等。也用于无损的传递复杂数据类型数据等场景。本范例用于展示CSM API参数中支持的MassData参数格式。

### Introduction

本范例中模拟产生了两组数据:一组是I32数组数据,一组是波形数据,并将这两组数据转换为massdata 参数。

CSM的参数中支持的MassData参数格式如下:

```
<massdata>Start:8057;Size:4004;DataType:1D I32
```

每个部分的含义如下:

- <massdata>: 表示这是一个 MassData 参数。
- Start:MassData 数据在内存中的起始地址。
- Size:MassData 数据的大小(字节数)。
- DataType:(optional) MassData 数据的类型, 选择的打包函数不同,可以不包含该部分。

### Steps

- Step1: I32数组数据, 此部分选择的打包函数为`CSM - Convert MassData to Argument With DataType.vim`,因此包含DataType部分。
- step1.1: 构造原始数据,在实际程序中来源与硬件采集、数据接收等情况。
- step1.2: 调用`CSM - Convert MassData to Argument With DataType.vim`,将原始数据转换为massdata 参数。可以在前面板查看转换后的参数格式。
- step1.3: 使用CSM - MassData Data Type String.vi 获取MassData 参数字符串中的数据类型。
- step1.4: 使用CSM - Argument Type.vi 获取CSM参数标签,在这里是 <massdata>。
- step1.5: 将 CSM massdata 参数转换回原始数据,可以在前面板查看转换后的数据,应该与原始数据完全匹配。

- Step2: 波形数据, 此部分选择的打包函数为`CSM - Convert MassData to Argument.vim`,因此不包含DataType部分。
- step2.1: 构造原始数据,在实际程序中来源与硬件采集、数据接收等情况。
- step2.2: 调用`CSM - Convert MassData to Argument.vim`,将原始数据转换为massdata 参数。可以在前面板查看转换后的参数格式,选择这个打包函数,不包含DataType部分。
- step2.3: 使用CSM - Argument Type.vi 获取CSM参数标签,在这里是 <massdata>。
- step2.4: 将 CSM massdata 参数转换回原始数据,可以在前面板查看转换后的数据,应该与原始数据完全匹配。


## 查看massdata缓存状态 (2. Show MassData Cache Status in FP.vi)

### Overview

Massdata 使用一个后台环形队列来缓存数据,队列的大小可以在CSM API参数中配置。本范例用于展示如何查看MassData缓存状态。

### Introduction

MassData 提供了一个帮助函数 CSM - MassData Update Status Indicator.vi,用于查看MassData缓存状态。本范例展示了如何使用这个函数。

### Steps

- step1: 使用 CSM - Config MassData Parameter Cache Size.vi 设置缓存大小,可以在界面直观的看到这个设置是生效的。
- step2: 每次循环中,构造一组新的数据。
- step3: 使用 CSM MassData 的API对数据进行打包解包,模拟实际程序中的使用情况。
- step4: 使用 CSM - MassData Update Status Indicator.vi 更新垂直方向的UI界面缓存状态控件刷新。
- step5: 使用 CSM - MassData Update Status Indicator.vi 更新水平方向的UI界面缓存状态控件刷新。
- Step6:循环间隔,每个循环会重复 step3~step4。
- Step7:(optional) 可以通过本插件提供的 CSM-Tool 更加快捷的查看MassData缓存状态。

## 在非CSM框架中使用MassData(3. MassData in Non-CSM Framework.vi)

### Overview

MassData 也可以在非CSM框架中使用。本范例用于展示如何在非CSM框架中使用MassData。

### Introduction

通过一个生产者消费者框架的范例,展示了如何在非CSM框架中使用MassData。数据生产者负责生产数据,将数据打包为MassData 参数,并通过队列传输给数据消费者,数据消费者负责消费数据,将MassData格式的数据解包为原始数据,并进行处理。本范例展示了这个过程。

### Steps

- step1: 使用 CSM - Config MassData Parameter Cache Size.vi 设置缓存大小。
- step2: 数据生产者循环
- step2.1: 构造原始数据,在实际程序中来源与硬件采集、数据接收等情况。
- step2.2: 调用 CSM - Convert MassData to Argument.vim 将原始数据转换为MassData参数。
- step2.3: 将转换后的MassData参数通过队列传输给数据消费者。
- step3: 数据消费者循环
- step3.1: 从队列中接收MassData 参数。
- step3.2: 调用 CSM - Convert Argument to MassData.vim 将massdata 参数转换为原始数据。
- step3.3: (optional) 使用 CSM - MassData Update Status Indicator.vi 更新UI界面缓存状态控件刷新。


## 在CSM框架中使用MassData(4. MassData in CSM.vi)

### Overview

本范例用于展示如何在CSM框架中使用MassData。

### Introduction

本范例通过一个生产者消费者的场景,展示了如何在CSM框架中使用MassData。

使用一个非CSM循环生成数据生产者负责生产数据,将数据打包为MassData 参数,并通过同步消息发送给作为数据消费者的CSM模块。本范例展示了这个过程。

### Steps

- step1: 使用 CSM - Config MassData Parameter Cache Size.vi 设置缓存大小。
- step2: 数据生产者循环,这个循环不是CSM模块。
- step2.1: 构造原始数据,在实际程序中来源与硬件采集、数据接收等情况, 调用 CSM - Convert MassData to Argument.vim 将原始数据转换为MassData 参数。
- step2.2: 使用 CSM - Wait and Send Message for Reply.vi 将数据作为 API: Update Waveform 的参数,发送给CSM模块,并标记发送者为Producer。
- step2.3: 在 Generate 按钮为按下状态时,才发送数据。
- step2.4: (optional) 使用 CSM - MassData Update Status Indicator.vi 更新UI界面缓存状态控件刷新。
- step3: 数据消费者循环,这个循环是CSM模块,名称为"CSM"。
- step3.1: 在 API: Update Waveform 分支中,将收到的参数使用 CSM - Convert Argument to MassData.vim 将MassData 参数转换为原始数据并显示。
- step3.3: (Optional) 其他分支和 template 一致,没有修改。
- step4: 程序退出过程中,使用 CSM - Wait and Send Message for Reply.vi 发送同步消息“Macro: Exit” 给 CSM 模块,使CSM模块退出。
Loading