Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a Motion Control Program in Visual C++

Hi,

 

I'm trying to create a graphical user interface in Visual C++ 2008 to control a three axis milling machine through NI PCI 7356 Motion Controller; also, I have the NI Motion 8.1 sotfware driver installed in my PC. I have tested the C code that comes in the examples folder of NI Motion succesfully, but it's only written for console app (I was thinking in something more interactive).  I will list you the problems I have had in creating a GUI in visual C++:

 

* First, I tried to build a GUI using Windows Form App in Visual C++ 2008. It is something simple: a window with a push button. Nonetheless, if I simply write  the header #include "flexmoth.h" in the code section of the widows form app, I get many errors (102 errors) after compiling. The error text is:

 

          C:\...\flexmoth.h(180) : error C3389: __declspec(dllexport) cannot be used with /clr : pure or clr/:safe

 

* Second, I build a GUI with two buttons using Microsoft Foundation Classes (MFC's), and it seems it works, but I think it would be easier programming using Windows Form App, because I have to add more controls (push buttons, radio buttons, combo boxes, etc...).

 

I'm not an expert using visual C++ and it will be helpful for me if you give me some advice.

 

Thanks,

 

Arturo

0 Kudos
Message 1 of 2
(5,038 Views)

Hi Arturo;

 

Working with Visual Studio .NET 2003 or later versions such as Visual Studio 2005 is not currently supported by NI-Motion Driver, however here's a link where you can find an example that can help you visualize the way the driver can be used with later versions of Visual Studio.

 

http://digital.ni.com/public.nsf/allkb/67253305A52EFB1986256E94005945D2

 

I hope the information is useful.

 

Good Luck

Francisco Arellano

National Instruments Mexico
Field Systems Engineer - Energy Segment
www.ni.com/soporte
0 Kudos
Message 2 of 2
(4,978 Views)