LabVIEW中写入或读取文件时出现error 8
当运行使用文件I/O命令的LabVIEW程序时,出现一条错误消息:
Error 8 Occurred at Open/Create/ReplaceFile
Possible reason(s):
LabVIEW: (Hex 0x8) File permission error.You do not have the correct permissions for the file.
解决方法:
错误8可能由于各种原因而发生,包括文件权限或VI设置。
检查其他打开的应用程序-确保在LabVIEW打开文件之前关闭文件。
如果手动打开了该文件-请确保在运行程序之前将其关闭。
如果对文件结构进行了更改,请确保为文件I/OVI设置了正确的目录。
打开高级文件I/O功能的框图,例如打开/创建/替换文件.VI
将打开File.VI上的打开模式输入更改为数字常量1。
如果直接从输入终端创建了常量或控件,请从下拉菜单中选择“只读”选项。
确保Windows帐户具有编辑文件的权限。如果您正在编辑其他帐户的文件,可能没有这样做的权限。
如果要创建可执行文件,则应用程序尝试访问的源文件可能位于运行它的目标的错误目录中(仔细检查源文件的放置位置)
如果在实时操作系统上,请确保Linux安全外壳没有妨碍,并且您\正在写入/读取lvadmin有权访问的文件夹。
附加信息
Error 8 can occur for various reasonsincluding file permissions or VI settings.
Check any other open applications - makesure that they close the file before LabVIEW opens it.
If you have manually opened the file -make sure you close it before you run your program.
If you have made changes to your filestructure - ensure you are setting the right directory for your file I/O VI.
Open the block diagram of the high-levelFile I/O function, such as Open/Create/ReplaceFile.VI
Change the open mode input on the OpenFile.VI to a numeric constant of 1.
If you created a constant or a controldirectly from the input terminal, select the "read-only" option fromthe drop-down menu.
Ensure that the Windows account haspermission to edit the file. If you are editing another account's file, you maynot have permission to do so.
If you are creating an executable, thesource files included that the application is trying to access may be in thewrong directory for the target you are running it on (double check where yourSource Files will be placed)
If on a Real Time OS, make sure that theLinux Security Shell is not getting in the way and that you are writing/readingto a folder the lvadmin has access to.
需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。
楼主最近还看过