LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI user interface controls integration with wxWidgets

Hello,

 

 I am programming an application to visualize brain signals using wxWidgets and LabWindows CVI to access a NI-DAQ card. Until now I have visualized the acquired signals using an interface made in CVI and its controls in an external application.

 

What I am looking for is a way to integrate the functions and controls available under CVI to visualize data on a window in an application made using wxWidgets.

 

Any clue about a way to integrate the visualization controls from CVI  in a window made with wxWidgets would be greatly appreciated.

 

Thank you very much in advance!

 

Johnn

0 Kudos
Message 1 of 9
(5,296 Views)

Johnn,

 

I am not familiar with wxWidgets, but according to their website, it looks like they have a C++ interface as an API.  If this is the only way to interact with these libraries, you wouldn't be able to do this with CVI.  If they have .NET assemblies or ActiveX servers to interact with their libraries, you could use CVI to do that.  Do you know if you have that option?

Jonathan R.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 9
(5,245 Views)

Johnn,

 

Sorry about that last post, I was logged into an account that I was using for testing purposes.

 

 I did see on the website that there is a .NET interface to wxWidgets.  You can use the .NET Controller Wizard (Tools->Create .NET Controller) to take that .NET interface and create a CVI driver which you could use in CVI. However this wizard will only create wrappers for the functions included in the .NET assembly and won't be able to port over any .NET controls that are included in the API.  If you can use this wxWidgets library solely by using the functions in the .NET interface, then you can do it, otherwise it won't be possible with the .NET Controller Wizard.

Eric B.
National Instruments
0 Kudos
Message 3 of 9
(5,222 Views)

Thanks for your reply Eric.

I saw on the wxWidgets documentation that there is a class named wxActiveXContainer and wxActiveXEvent. I was wondering whether it would be possible to create in CVI an ActiveX Control from a panel with a Graph Control on it that offers other applications the visualization functions we need by means of some interface, and then try to embed that Control into a wxWidgets frame using a wxActiveXContainer. Do you think this way would be a good idea?

We would like to give the integration through ActiveX controls a try first and if it's not possible that way then try the .NET solution just to keep all our code in C/C++.

Regards,

Johnn

 

0 Kudos
Message 4 of 9
(5,206 Views)

Johnn,

 

As far as I know, there's no way in CVI to create ActiveX controls based off of our built-in controls.  You can certainly use ActiveX controls in a CVI project, but you can't go the other way.  The .NET solution actually doesn't involve any .NET programming.  CVI takes the .NET assembly and generates a CVI library so you can use CVI functions to interact with the .NET assembly.  This way all your code is still in C (though you would still need the .NET framework installed on a system to run this code)

Eric B.
National Instruments
0 Kudos
Message 5 of 9
(5,169 Views)

Thanks for your help.

 

Would it be possible to export a CVI panel in another way other than by means of a .NET assembly? Maybe as a DLL library or something similar?

0 Kudos
Message 6 of 9
(5,120 Views)

Jhonn,

 

As far as I know, there's no way to export a CVI panel to a .NET assembly.  You can take a .NET assembly and create a .NET controller to use in CVI, but not the other way around.  You can either take your code in CVI and convert it to a DLL to use in another language (writing your user interface in the other language and using the wxWidgets library in that other language, then calling the CVI functions using the DLL) or try to use the wxWidgets code in CVI with by creating a .NET controller.

Eric B.
National Instruments
0 Kudos
Message 7 of 9
(5,093 Views)

Hi,

NI Team

 

Ours Counterpart using WxWidgets to generate the DLL,but i want to libraryload the wxDLL and encounter error.Could you please help on.

 

Thanks

0 Kudos
Message 8 of 9
(4,199 Views)

Hello,

 

Are you trying to use wxWidgets in the NI LabWindows/CVI development environment or in another environment (for example, Visual Studio)? This forum is for the NI LabWindows/CVI environment. If you are using LabWindows/CVI, what is the error that you receive when trying to load the library? This KnowledgeBase article has information about using C++ code in CVI: Does LabWindows™/CVI™ Support C++?

It says: "If you need to call C++ code within LabWindows/CVI, you can build the C++ code into a DLL and call the DLL from LabWindows/CVI. In the DLL, mark all exported functions with extern "C" to specify that they will be used with a C compiler. Refer to Section 9 of FAQ: Using Dynamic Link Libraries with NI LabWindows/CVI and the Using DLLs Built with Visual C++ in LabWindows/CVI Community Example for information about building C++ DLLs to call in LabWindows/CVI.

You can also import the LabWindows/CVI libraries or a LabWindows/CVI project into a Microsoft Visual C++ project using the LabWindows/CVI Project Wizard and the LabWindows/CVI Conversion Wizard. Refer to the Integrating LabWindows/CVI with Microsoft Visual C++ KnowledgeBase for additional information."

 

Earlier posts on this forum also explain that you can use a .NET Controller or ActiveX Server to use wxWidgets in LabWindows/CVI.

 

Here is another KnowledgeBase article that discusses using the Windows SDK LoadLibrary function in CVI:

How Can I Access DLL Functions in a LabWindows™/CVI™ Program Without Including the Import Library in... 

 

If you are not using National Instruments software with wxWidgets, you will get better help on the wxWidgets forums: http://forums.wxwidgets.org/ or support for the development environment that you are using.

 

Hope this helps,

Taylor B.
National Instruments
Message 9 of 9
(4,175 Views)