The easiest thing I've come up with (especially if there are lots of VI's to talk to) is having wrapper classes in .Net that provide properties for each LabVIEW control, so a VI that has an Int32 counter and a stop button might have the following class as an wrapper (C# code):
class MyVI
{
private const string VIPATH = @"Path to vi";
private LabVIEW.Application lv; // Could also be MyExecutable.Application, if you're running from a LabVIEW built .exe
private LabVIEW.VirtualInstrument vi;
MyVI()
{
lv = new LabVIEW.ApplicationClass();
vi = lv.GetVIReference(VIPATH, "password_if_needed", false, 0); // see the LabVIEW ActiveX docs for more info on what this is up to.
}
public Int32 counter
{
get
{
return (Int32)this.vi.GetControlValue("counter");
}
}
public Boolean stop_btn
{
get
{
return (Boolean)this.vi.GetControlValue("stop_btn");
}
set
{
this.vi.SetControlValue("stop_btn", value);
}
}
}
I'm working on a set of VIs / python scripts to generate these automagically using the Front Panel.Controls[] property as a starting point, but I'll have to check with my employer about sharing them here. (It'd be easier if the Export Strings command gave valid XML output instead of almost-valid XML, hint hint NI...)
Time permitting I want to put together an NIWeek paper / presentation on doing this for large-scale projects, we'll see what I have time/permission to do.