diff --git a/.github/workflows/Build_VIPM_Library.yml b/.github/workflows/Build_VIPM_Library.yml new file mode 100644 index 0000000..623f83a --- /dev/null +++ b/.github/workflows/Build_VIPM_Library.yml @@ -0,0 +1,58 @@ +# This is a basic workflow to help you get started with Actions + +name: Build_VIPM_Library + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: + - main + types: [closed] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + Build_VIPM_Library: + # The type of runner that the job will run on + runs-on: [self-hosted, lv2014] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + # - name: vipm_InstallPackagesByName + # uses: LV-APT/lvCICD@main + # with: + # Operation: vipm_InstallPackagesByName + # Parameter1: 'Git API' + + # Runs a set of commands using the runners shell + - name: Build VI Package + id: build-vip + uses: LV-APT/lvCICD@main + with: + LabVIEW_Version: 2014 + Operation: vipm_BuildDailyVIP + Parameter1: ${{ github.workspace }}\src\LabVIEW-GlobalStop-Library.vipb + Parameter2: NO + + - id: vip-name + run: + $vipName=Split-Path -Path ${{ steps.build-vip.outputs.Result }} -Leaf; + Write-Host "::set-output name=vipName::"$vipName"" + shell: powershell + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.0.0 + with: + # Artifact name + name: ${{ steps.vip-name.outputs.vipName }} + path: ${{ steps.build-vip.outputs.Result }} + # The desired behavior if no files are found using the provided path. + if-no-files-found: warn + retention-days: 90 diff --git a/.github/workflows/Check_Broken_VIs.yml b/.github/workflows/Check_Broken_VIs.yml new file mode 100644 index 0000000..98e1aeb --- /dev/null +++ b/.github/workflows/Check_Broken_VIs.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: Check_Broken_VIs + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + paths-ignore: + - '.github/**' + - 'vip/**' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + Check_Broken_VIs: + # The type of runner that the job will run on + runs-on: [self-hosted, lv2014] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + # Runs a set of commands using the runners shell + - id: Check_Broken_VIs + uses: LV-APT/lvCICD@main + with: + LabVIEW_Version: 2014 + Operation: VIAn_CheckBrokenVIs + Parameter1: ${{ github.workspace }} + + diff --git a/GlobalStop.lvproj b/GlobalStop.lvproj index 92fd5ce..55d6cf2 100644 --- a/GlobalStop.lvproj +++ b/GlobalStop.lvproj @@ -20,10 +20,9 @@ true true false - - - - + + true + 3 diff --git a/README.md b/README.md index 959dc36..23631b5 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,25 @@ # LabVIEW GlobalStop Library -提供给LabVIEW 程序使用的全局停止方案。 - -**优点:简单、高效、易用,STOP FGV的方案也保证了多线程安全。** +[![Check_Broken_VIs](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml) +[![Build_VIPM_Library](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml) +Simple stop mechanism for parallel loops in LabVIEW. ## 功能 ![Library Pallette](https://cloud.githubusercontent.com/assets/8196752/10752145/8288f624-7cc1-11e5-9700-e3740e08f571.png) -- `Init.vi` : 初始化STOP FGV,如果ERROR 发生,则全局停止位初始化为 TRUE -- `Reset.vi` :设置STOP FGV为 False,Index 标识模块编号,-1 标识全局停止位 -- `Set.vi` : 设置STOP FGV为 True,Index 标识模块编号,-1 标识全局停止位 -- `Get.vi` :检查STOP FGV值,如果输入的错误簇为False,会自动调用 `Set.vi` 方法,Index 标识模块编号,-1 标识全局停止位 -- `CheckSet.vi` :检查输入的Boolean值,(通常连接到Stop Button上)判断是否需要退出。如果输入的错误簇为False,会自动调用 `Set.vi` 方法,Index 标识模块编号,-1 标识全局停止位 - - -## 实现 - - - 使用Function Global Variable (FGV)的方式,存储一组(初始默认32个) Boolean 类型的标志数据,不同线程通过读取该FGV判断是否需要停止。 - - Index 标识模块编号,-1 标识全局停止位。建议创建将模块列表创建为Enum/Combo Typedef,连接到 Index 输入端。 - - 当超出当前定义的标志个数时,会自动扩展 FGV 中的标志Flag 数组长度。 +- `Init.vi` : Initialzie Globalstop, if error occurs, GlobalStop will be set to TRUE +- `Reset.vi` : Reset GlobalStop to FALSE. Index=-1 stands for reset all. +- `Set.vi` : Set GlobalStop to TRUE. Index=-1 stands for set all to TRUE. +- `Get.vi` : Get GlobalStop value of index. Set Index=-1 to get the global value of GlobalStop. +- `CheckSet.vi` : Check the boolean input(usually a stop button). +# Example -## 使用环境 +![image](https://user-images.githubusercontent.com/8196752/200517986-eb2f3ed4-0931-443e-9bb2-d45b227550c0.png) - LabVIEW 2014 + +## Development Environment +- LabVEW 2014 +- VIPM 2020.3 diff --git a/doc/README(chz).md b/doc/README(chz).md new file mode 100644 index 0000000..4005467 --- /dev/null +++ b/doc/README(chz).md @@ -0,0 +1,29 @@ +# LabVIEW GlobalStop Library + +[![Check_Broken_VIs](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml) +[![Build_VIPM_Library](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml) + +提供给LabVIEW 程序使用的全局停止方案。 + +**优点:简单、高效、易用,STOP FGV的方案也保证了多线程安全。** + +## 功能 + +![Library Pallette](https://cloud.githubusercontent.com/assets/8196752/10752145/8288f624-7cc1-11e5-9700-e3740e08f571.png) + +- `Init.vi` : 初始化STOP FGV,如果ERROR 发生,则全局停止位初始化为 TRUE +- `Reset.vi` :设置STOP FGV为 False,Index 标识模块编号,-1 标识全局停止位 +- `Set.vi` : 设置STOP FGV为 True,Index 标识模块编号,-1 标识全局停止位 +- `Get.vi` :检查STOP FGV值,如果输入的错误簇为False,会自动调用 `Set.vi` 方法,Index 标识模块编号,-1 标识全局停止位 +- `CheckSet.vi` :检查输入的Boolean值,(通常连接到Stop Button上)判断是否需要退出。如果输入的错误簇为False,会自动调用 `Set.vi` 方法,Index 标识模块编号,-1 标识全局停止位 + +## 实现 + +- 使用Function Global Variable (FGV)的方式,存储一组(初始默认32个) Boolean 类型的标志数据,不同线程通过读取该FGV判断是否需要停止。 +- Index 标识模块编号,-1 标识全局停止位。建议创建将模块列表创建为Enum/Combo Typedef,连接到 Index 输入端。 +- 当超出当前定义的标志个数时,会自动扩展 FGV 中的标志Flag 数组长度。 + +## Development Environment + +- LabVEW 2014 +- VIPM 2020.3 diff --git a/main1.vi b/main1.vi deleted file mode 100644 index 8af4bbd..0000000 Binary files a/main1.vi and /dev/null differ diff --git a/main2.vi b/main2.vi deleted file mode 100644 index 1e9dc9c..0000000 Binary files a/main2.vi and /dev/null differ diff --git a/main3.vi b/main3.vi deleted file mode 100644 index dc17451..0000000 Binary files a/main3.vi and /dev/null differ diff --git a/src/LabVIEW-GlobalStop-Library.vipb b/src/LabVIEW-GlobalStop-Library.vipb index c1b157d..0a6d5ed 100644 --- a/src/LabVIEW-GlobalStop-Library.vipb +++ b/src/LabVIEW-GlobalStop-Library.vipb @@ -1,7 +1,7 @@ - + nevstop_lib_globalstop - 2.0.2.4 + 2022.11.8.4 false . ..\storage @@ -27,14 +27,36 @@ LabVIEW-GlobalStop-Library.vipc - Global Stop library + Global Stop library for labview # LabVIEW GlobalStop Library -https://raw.githubusercontent.com/nevstop/LabVIEW-GlobalStop-Library/master/README.mds +[![Check_Broken_VIs](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Check_Broken_VIs.yml) +[![Build_VIPM_Library](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml/badge.svg)](https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library/actions/workflows/Build_VIPM_Library.yml) + +Simple stop mechanism for parallel loops in LabVIEW. + +## + +![Library Pallette](https://cloud.githubusercontent.com/assets/8196752/10752145/8288f624-7cc1-11e5-9700-e3740e08f571.png) + +- `Init.vi` : Initialzie Globalstop, if error occurs, GlobalStop will be set to TRUE +- `Reset.vi` : Reset GlobalStop to FALSE. Index=-1 stands for reset all. +- `Set.vi` : Set GlobalStop to TRUE. Index=-1 stands for set all to TRUE. +- `Get.vi` : Get GlobalStop value of index. Set Index=-1 to get the global value of GlobalStop. +- `CheckSet.vi` : Check the boolean input(usually a stop button). + +# Example + +![image](https://user-images.githubusercontent.com/8196752/200517986-eb2f3ed4-0931-443e-9bb2-d45b227550c0.png) + +## Development Environment + +- LabVEW 2014 +- VIPM 2020.3 - yaoli - https://github.com/nevstop/LabVIEW-GlobalStop-Library - Fix issue, update Front panel pallette. + NEVSTOP + https://github.com/NEVSTOP-LAB/LabVIEW-GlobalStop-Library + add cicd check @@ -90,6 +112,11 @@ https://raw.githubusercontent.com/nevstop/LabVIEW-GlobalStop-Library/master/READ true + + false + true + + @@ -110,6 +137,12 @@ https://raw.githubusercontent.com/nevstop/LabVIEW-GlobalStop-Library/master/READ false 0 + + examples + 0 + false + 0 + . diff --git a/src/examples/NEVSTOP/GlobalStop/globalstop-example1.vi b/src/examples/NEVSTOP/GlobalStop/globalstop-example1.vi new file mode 100644 index 0000000..c70a4bf Binary files /dev/null and b/src/examples/NEVSTOP/GlobalStop/globalstop-example1.vi differ diff --git a/src/examples/NEVSTOP/GlobalStop/globalstop-example2.vi b/src/examples/NEVSTOP/GlobalStop/globalstop-example2.vi new file mode 100644 index 0000000..e107889 Binary files /dev/null and b/src/examples/NEVSTOP/GlobalStop/globalstop-example2.vi differ diff --git a/src/examples/NEVSTOP/GlobalStop/globalstop-example3.vi b/src/examples/NEVSTOP/GlobalStop/globalstop-example3.vi new file mode 100644 index 0000000..54e9d51 Binary files /dev/null and b/src/examples/NEVSTOP/GlobalStop/globalstop-example3.vi differ diff --git a/vip/VIPM Package Filder.txt b/vip/VIPM Package Filder.txt deleted file mode 100644 index 8b13789..0000000 --- a/vip/VIPM Package Filder.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vip/nevstop_lib_globalstop-1.0.1.2.vip b/vip/nevstop_lib_globalstop-1.0.1.2.vip deleted file mode 100644 index 8eeef72..0000000 Binary files a/vip/nevstop_lib_globalstop-1.0.1.2.vip and /dev/null differ diff --git a/vip/nevstop_lib_globalstop-2.0.2.3.vip b/vip/nevstop_lib_globalstop-2.0.2.3.vip deleted file mode 100644 index 347344b..0000000 Binary files a/vip/nevstop_lib_globalstop-2.0.2.3.vip and /dev/null differ