简体   繁体   English

LabVIEW到C#的转换

[英]LabVIEW to C# Conversion

LabVIEW 到 C# 转换(将 VI 转换为 C# 代码)所需的所有软件是什么,除了 LabVIEW 和 Microsoft Visual Studio。

LabVIEW VI's are binary and as far as I know there is no other tool, besides LabVIEW itself, that understands them. LabVIEW VI 是二进制的,据我所知,除了 LabVIEW 本身,没有其他工具可以理解它们。

I think that by using Measurement Studio you could interface with NI hardware in .NET, but I don't think you can access all the VI's built in to LabVIEW from dlls.我认为通过使用 Measurement Studio,您可以在 .NET 中与 NI 硬件进行交互,但我认为您无法从 dll 访问所有内置到 LabVIEW 中的 VI。

如果您正在寻找 LabVIEW 代码到 C# 的自动转换,没有这样的工具存在,您必须手动重写它。

Not C# but may be useful in certain instances:不是 C#,但在某些情况下可能有用:

NI LabVIEW C Generator NI LabVIEW C生成器

No tool exists (that National Instruments knows of) that does what you're looking for.没有任何工具(National Instruments 知道)可以满足您的需求。 Sorry.对不起。

As a general rule, if you want to call LabVIEW code from C#, it is better to convert your VIs into dll library, then import it from C# like any assembly.作为一般规则,如果您想从 C# 调用 LabVIEW 代码,最好将您的 VI 转换为 dll 库,然后像任何程序集一样从 C# 导入它。

Check this example .You may also watch this video for basic creation of LabVIEW dll library检查此示例。您也可以观看此视频以了解 LabVIEW dll 库的基本创建

Manually rewrite the code is the only way.手动重写代码是唯一的方法。 Might not be as painful as you think.可能没有你想象的那么痛苦。 I just converted a few LabVIEW projects to Python scripts and the Python script was surprisingly easier and much smaller in comparison.我刚刚将几个 LabVIEW 项目转换为 Python 脚本,相比之下,Python 脚本出奇地简单且小得多。

Good luck!祝你好运!

We have pylabview which converts VIs to XML (and back).我们有将 VI 转换为 XML(并返回)的pylabview Whether it will convert everything to XML or leave some binary chunks depends on LV version used to create te files though.是否将所有内容转换为 XML 或保留一些二进制块取决于用于创建 te 文件的 LV 版本。 If Block Diagram was converted to XML, then you could write a parser which reads that and transforms to any output.如果 Block Diagram 被转换为 XML,那么你可以编写一个解析器来读取它并转换为任何输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM