Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 67219

how to get vi error out information using C#

$
0
0

Hi,I am working on concept-- running labVIEW test cases (.vi files) using C# code.

I am able to run any of the .vi file using my C# code. presently .vi file rans in backgroud (actually it is needed).

But i need to capture run time messages/warnings/error while running any of the labVIEW code. but i am not getting any solution how to do it.

 

Bellow is code snipet which will run laVIEW code.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Include LabVIEW namespace from the COM Interface
using LabVIEW;

namespace WindowsFormsApplication3
{
    class Labviewlaunch
    {
        public void labviewlaunchfun(string userSelectedFilePath)
        {
           
        _Application labVIEWApp = new Application();
            if (labVIEWApp == null)
            {
                Console.WriteLine("RunLabVIEWVI : An error occurred getting labVIEWApp.");
                return;
            }
            //Paths to VIs, must use absolute path
            //Enter the absolute path to your VI here
            string viadd_path = userSelectedFilePath;
            //Create VI object
            VirtualInstrument viadd = labVIEWApp.GetVIReference(viadd_path, "", false, 0);
           
            if (labVIEWApp == null)
            {
                Console.WriteLine("RunLabVIEWVI : An error occurred getting the VI reference.  Make sure the VI path you entered is correct.");
                return;
            }
            //Run the VI with default input values, you will see the values on the front panel update if it is open
            viadd.Run();
        }
    }
}

 

with this code .vi file will run in background. but we will not have any information about vi ran without any error or warning.

which function or API will give information of labview run time engine during running any of the labVIEW code.

 

please help me in this.


Viewing all articles
Browse latest Browse all 67219

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>