11-26-2007 09:14 AM
11-26-2007 12:37 PM
The VI.Call() gives me an OLE exception "The VI is not in a state compatible with this operation". Meanwhile, the LabView app has started and is hanging around in the background, until the Delphi app quits, which kills the LabView app, as designed - this part works fine! What am I doing wrong? Thanks! -Bob... var Form2: TForm2; ParamNames,ParamVals : variant; newapp: TApplication; vi: Variant; ... ParamNames := VarArrayCreate([0, 2], varVariant); ParamVals := VarArrayCreate([0, 2], varVariant); ParamNames[0] := 'StringEntry'; ParamNames[1] := 'Add'; ParamNames[2] := 'LastEntry'; ... newapp.Connect; vi := newapp.GetVIReference('Dummy.vi'); // VI's file name is, indeed, 'Dummy.vi' ParamVals[0] := 'Hello'; ParamVals[1] := True; VI.Call(ParamNames, ParamVals);
11-27-2007 06:37 PM
Hi Bob,
You can use LabVIEW as an ActiveX Server, and thus expose properties and methods to ActiveX client applications, such as the Delphi app you're referring to. You can read and write front panel controls/indicators through the LabVIEW ActiveX Server interface, and it seems like this is what you are looking for.
I'm not aware of a way to insert a LabVIEW front panel into an ActiveX container in another application, but even if you could, you would still need to use the ActiveX Server interface to actually access the data by the rest of the Delphi program.
The LabVIEW application doesn't even need to display the front panel, but can instead be called by the Delphi program, run in the background, and be polled/updated when needed by the Delphi application.
11-27-2007 06:48 PM
Yes, that is exactly what I am looking for! Right now, I can only "see" a few, very generic methods, such as the GetVIReference() function in my second post. What I don't get is what to do with my "newapp" variable; how to I access the front panel controls and indicators?
@donovanb wrote:
Hi Bob,
You can use LabVIEW as an ActiveX Server, and thus expose properties and methods to ActiveX client applications, such as the Delphi app you're referring to. You can read and write front panel controls/indicators through the LabVIEW ActiveX Server interface, and it seems like this is what you are looking for.
I'm not aware of a way to insert a LabVIEW front panel into an ActiveX container in another application, but even if you could, you would still need to use the ActiveX Server interface to actually access the data by the rest of the Delphi program.
That would be cool, but not necessary. Probably, I'll end up bringing the LabView app to front, and just using its front panel as is. That said, if someone know how...
That's the other possibility...The LabVIEW application doesn't even need to display the front panel, but can instead be called by the Delphi program, run in the background, and be polled/updated when needed by the Delphi application.