LabVIEW项目或库文件已损坏 点击:212 | 回复:0



fjczd

    
  • 精华:0帖
  • 求助:0帖
  • 帖子:552帖 | 36回
  • 年度积分:703
  • 历史总积分:1294
  • 注册:2008年8月14日
发表于:2023-02-13 18:04:17
楼主

LabVIEW项目或库文件已损坏

尝试打开项目文件(*.lvproj)时,不断收到错误:项目或库文件已损坏。

当尝试在新计算机上打开类库时,看到错误内存或数据结构损坏。无法加载文件,但库在另一台计算机上打开正常。

如何解决此问题?

遵循这些步骤可能有助于修复库或项目文件损坏。如果没有备份,许多损坏将无法恢复。

1.       右键单击损坏的文件,然后单击打开方式...,选择记事本

2.       将代码复制并粘贴到MicrosoftWord

3.       如果有有效的备份版本,请将代码作为新的MicrosoftWord文档复制并粘贴到Word中。

4.       现在使用“跟踪更改/比较功能比较Word中的两个版本。*跟踪更改/比较功能可在MicrosoftWord 审阅选项卡中找到。

修复LabVIEW项目文件损坏

这个问题可以通过编辑项目文件的XML代码来删除对这个损坏的库文件的引用,或者通过修复库文件损坏来解决。

使用LabVIEW64位打开LabVIEW项目文件

如果代码是在32位位版本的LabVIEW中编写,则在64LabVIEW中打开代码将增加应用程序内存,并可能解决基于大型框图的损坏。

修复LabVIEW项目文件或库文件损坏如果某些结束XML标记在保存过程中未完全写入过程,则项目文件和库文件都可能被损坏。

例如,损坏的项目文件可能在文件末尾缺少以下行:

</Item>
</Item>
</Item>
</Project>
 

这些行将关闭项目和项引用。项引用是特定于项目的,因此,如果项目包含更多或更少的这些行,请不要担心。如果这些引用未关闭,LabVIEW将无法关闭项目文件,并随后通知用户项目已损坏。

如果没有项目的备份副本,请创建一个新项目并访问源代码,如上所述。查找空项目和损坏项目之间的任何明显差异。

通常,这些差异将涉及缺少XML标记,用户应密切关注项目/库的工作备份副本和损坏的项目/库文件中的这些引用。

如果上述任何步骤解决了问题,请尝试在PC上删除并重新安装所需的NI软件。

附加信息

由于多种原因,项目文件可能已损坏。例如,在自动保存过程中,可能发生了LabVIEW内部错误,注册键可能已损坏,或者电源可能已关闭并损坏了文件。

通常,这些损坏会导致项目或库文件中缺少条目。库和项目文件以XML格式编写,可以使用任何基于文本的编辑器打开。但是,处理这些文件的最简单方法是最初使用Microsoft记事本或Microsoft写字板打开它们,然后将内容复制并粘贴到MicrosoftWord文档中。

项目的工作备份副本可用于诊断和修复损坏。备份副本不必与损坏的副本完全相同。但是,备份副本可以为工作项目或库文件中的预期内容提供框架或模板。

 

 

Solution

Following these steps may aid in fixing alibrary or project file corruption.  Many corruptions will beunrecoverable without a backup.

  1. Right-click the     corrupted file, and click on Open With..., select     Notepad

  2. Copy and paste     the code into Microsoft Word

  3. If you have     the working back-up version, copy and paste the code into Word as a     new Microsoft Word document.

  4. Now compare     the two versions in Word using Track Changes/Compare functionality.      *The track changes/compare functionality is found in the Review tab of     Microsoft Word 2007.  

Fixinga LabVIEW Project File Corruption
A corrupted library file can also corrupt a project file if the corruptedlibrary file was included in the LabVIEW project.  This issue can beresolved by either removing the reference to this corrupted library file byediting the XML code for the project file, or by fixing the library filecorruption.  

Open the LabVIEW Project File With LabVIEW64-bit
If the code was written in a 32-bit version of LabVIEW, opening it in 64-bitLabVIEW will increas the application memory and potentially resolve corruptionbased off of large block diagrams.

Fixing a LabVIEW Project File or Library FileCorruption
Project files and library files can both be corrupted if some of the closingXML tags were not written completely during a save process.  

For example, a corrupted projectfile may be missing the following lines at the end of the file:

</Item>
</Item>
</Item>
</Project>
 

These lines are closing the project and itemreferences.  The item references are project-specific, so do not concernyourself if your project has more or fewer of these lines.  Ifthese references are not closed off, LabVIEW will not be able to close theproject file, and subsequently inform the user that the project has been corrupted. 

If you do not have a backup copy of theproject, create a new project and access the source code as describedabove.  Look for any obvious differences between the empty project and thecorrupted project.  

Often times these differences will involvemissing XML tags, and the user should pay close attention to these referencesacross the working back-up copy of the project/library and the corruptedproject/library file. 

If any of the previous steps solve the issue,try removingand reinstalling the required NI software on the PC. 

AdditionalInformation

A project file can be corrupteddue to many reasons.  For example, during the automated save process,a LabVIEW internal error may have occurred, registry keys may be corrupt, orpower may have shut off and corrupted the file. 

Often times, these corruptions result in amissing entry within the project or library file.  Library and project filesare written in XML format and can be opened up with any text-basededitor.  However, the easiest method of working with these files willbe to open them with Microsoft Notepad or Microsoft Wordpad initially andthen copying and pasting the contents to a Microsoft Word document.

A working back-up copy of the project can beuseful in diagnosing and fixing the corruption.  The backupcopy does not have to be exactly the same as the corruptedcopy.  However, the back-up copy can provide a framework or a template forwhat to expect in a working project or library file.  

 

需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。

 




楼主最近还看过


热门招聘
相关主题

官方公众号

智造工程师