我正在尝试在 Windows 窗体应用程序中传递一个字符串我的函数,以便从 LabVIEW 脚本调用 InteropAssembly.dll。该脚本采用一个字符串来打开图像并执行一些处理,然后返回 2 个不同的图像。但我收到错误类型“LVBaseRefnum”是在未引用的程序集中定义的。您必须添加对程序集“NationalInstruments.LabVIEW.RefnumTypes”的引用。我检查了论坛等,发现了this。但它已经发布很久了,仍然没有有效的答案。您遇到过这个错误吗?有解决办法吗?提前致谢,我的代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using InteropAssembly;
namespace testLabview
{
public partial class Form1 : Form
{
private object img1;
private object img2;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.pictureBox1 = null;
this.pictureBox2 = null;
string text = this.textBox1.ToString();
LabVIEWExports.test(text, out Image img1, out Image img2);
this.pictureBox1.Image = img1;
this.pictureBox2.Image = img2;
}
}
}
using NationalInstruments.LabVIEW.Interop;
using NationalInstruments.labVIEW.RefnumTypesNational;
LVBaseRefnum nivisionimg;