LabVIEW 列举目录子目录和文件名教程
可以使用 LabVIEW 中的 'Directory Contents' 函数来列举目录中的子目录和文件名。
具体步骤如下:
-
打开 LabVIEW,新建一个 VI。
-
在 Block Diagram 中搜索 'Directory Contents' 函数,拖动到 Block Diagram 中。
-
点击 'Directory Contents' 函数,配置函数参数。
-
在 'Directory' 输入框中输入要列举的目录路径。
-
在 'Search Subdirectories' 复选框中勾选,表示要搜索子目录。
-
在 'Include Files' 和 'Include Directories' 复选框中勾选,表示要列举文件和目录。
-
连接 'Directory Contents' 函数的输出端口,可以使用 'Array to Spreadsheet' 函数将结果显示在 Front Panel 中。
-
运行 VI,即可列举目录中的子目录和文件名。
注意:
-
在 'Directory' 输入框中输入的路径必须是存在的路径。
-
如果要列举的目录中包含大量文件和子目录,可能会导致程序运行缓慢。
原文地址: https://www.cveoy.top/t/topic/nrP5 著作权归作者所有。请勿转载和采集!