From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read text from a string control in a compiled LabView executable from C#

I have a third party complied LabVIEW executable and no source code.  I need to read values from the front panel in C#.  I know that LabVIEW controls and indicators are not actual windows.  Is there a way to programmatically access this information(i.e. without using screenshots and OCR)?  I couldn't find this exact question answered in this forum.  I've read a few things about VI Server doing this from LabVIEW, but I don't think you can access VI Server from C#.  Any help would be appreciated.

Thanks in advance.
0 Kudos
Message 1 of 3
(2,398 Views)
You should certainly be able to access VI Server from C#. LabVIEW has an ActiveX server built in that allows other applications to access a sizeable subset of VI Server functionality. I would guess you could access ActiveX servers directly from C#, but the worst-case scenario would be to wrap the ActiveX calls into a .NET assembly. I've seen this done before. This blog entry is slightly off topic, but might help you.


Actually, I do need to revise this answer... If you are working with a LabVIEW DLL, the DLL would have to be compiled with the ActiveX Server option enabled. Otherwise, LabVIEW won't include the code that allows the DLL to be hooked into using this method. So if you don't have the source and you can't recompile it, you might be out of luck. Does the DLL really not have a function that exports this string value?

Message Edited by Jarrod S. on 10-26-2006 01:39 PM

Jarrod S.
National Instruments
0 Kudos
Message 2 of 3
(2,393 Views)

Actually, any LabVIEW built application needs to have the ActiveX server option checked to include that ability. If it does have that ability checked, then it's pretty easy - just add a reference in Visual Studio to our type library (<labview dir>\resource\labview.tlb) and it'll automatically generate the .NET assembly version.

If the ActiveX stuff is enabled, feel free to post questions as you try to use the interface.

If the ActiveX stuff isn't enabled, there isn't much of an option other than OCR I'm afraid.

0 Kudos
Message 3 of 3
(2,363 Views)