1
votes

I am trying to pass a string my function in Windows Form Application in order to invoke InteropAssembly.dll from a LabVIEW script. The script takes a string for opening image and do some process and then return 2 different images. But I am getting the error The type 'LVBaseRefnum' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.LabVIEW.RefnumTypes'. I have checked the forum and so and found this . But it was posted quite long time ago and still no valid answer. Have you ever encounter this error any solution? Thanks in advance and my code as follows:

 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;

    }
}

}

An image is usually binary (byte array) and not a string. If the method requires a string than most likely you need to convert the image to a Base64 string using Convert.ToBase64String(byte[])jdweng
The string is a path of the image and LabVIEW can take care of it itself. When I pass a path in a string controller, the image is being processed in LabVIEW.Oğuz KAHRAMAN
So the error message indicates a dependency issue. I'm not sure what the build process looks like for your InteropAssembly/what it outputs, but it seems like you need to reference NationalInstruments.LabVIEW.RefnumTypes in your .NET project dependencies.hallibut