Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Any example for a MFC, WTL or Win32 without Measurement Studio?

It seems that NI wants you buy their Measurement Studio which can easily cost you a fortune. I am looking around a simple example for MFC, WTL without touching the measurement studio. But if you do not have measurement studio, NI only gives you very old examples in ANSI C which is difficult to implement to MFC or WTL. Apparently they want to increase their revenue by forcing you to buy the Measurement Studio. But I will not buy their hardware in the future if this is their strategy.

 

Anyone successfully implement the ANSI C example to MFC or WTL without measurement studio? Can you share an example?

0 Kudos
Message 1 of 12
(7,527 Views)

Junqi,

 

What exactly are you trying to do with MFC or WTL? What examples are you looking for? Many of our drivers have many language examples available as options in the installer. The only ones you wont have access too are the ones specifically for measurment studio because they have controls and functions that are included in measurement studio.

 

As for the cost of measurement studio, it can actually be a net savings when you factor in time saved. The added engineering time, management time, facility cost, etc for using a less capable/stable/supported tool can easily outweigh the cost of the development tool. Making use of the support contract that comes with it alone can often save enough in man-hours for the product to pay for itself. 

 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 12
(7,523 Views)

Hi Kyle,

 

I am trying to implement the example of continuous AI with the callback event to MFC. I do not have problem with the timing acquisition which I can use timer of MFC or WTL. With callback event, I need to understand better to implement it in MFC or WTL because of the non-static member of callback. If there is a simple example, it can save huge time.

 

I understand NI is focusing on the software since it can generate huge revenue but for my application, my needs are limited (single channel, single ADDA board, incorporate to my program). It might save my time to use measurement studio. But to buy a software with that cost to control a $500 board, I have difficulty to justify, especially my application for the data acquisition is extremely simple.

 

What pissed me off is that NI spent so much effort to force people to use Measurement Studio or other software (you can see the new version even does not install other samples for MS C++ 2005, 2008 without Measurement Studio). But it may only take a programmer in your company half day to just put a very simple example there to cover the topic. But I did not see any change after you update NI-DAQ so many times.

 

Junqi 

0 Kudos
Message 3 of 12
(7,521 Views)

Junqi,

 

Im a little confused with this request in general. What development environment are you using? Visual Studio? Also, what language are you coding in? We provide C, C#, VB.net, and legacy VB6 examples with our DAQmx driver that do not require measurement studio. They can be found in documents\National Instruments\NI-DAQ\Examples 

 

Now forgive me if Im misinformed about this, but MFC and WTL are just libraries that have some of the windows API wrapped into them, correct? If so, I dont see how interfacing with them is any different than interfacing with any other library, or why this would cause issues with doing DAQ calls. If you need help with the MFC or WTL library, there are many good places to find help with on the internet. MSDN, codeproject.com, and many others come up as having examples of using MFC in various projects.   

 

The MS examples dont install withough MS because they wouldnt be able to be used because they use libraries that are installed with measurement studio, so they would be nonfunctional and largely useless. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 12
(7,509 Views)

Hi Kyle,

 

Thanks for your response. I am using Microsoft Visual C++ 2003. If I get a data per certain time by using the example in Ansi C: ~\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Int Clk\ and call the function inside a class, there is no issue. But if I want to use the high speed by this example: ~\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Cont Acq-Int Clk\, there will be an issue if I want to use the callback function inside the class. 

 

By searching website, there is one closest to the issue I have.

http://stackoverflow.com/questions/3058481/c-callback-syntax-in-a-class

 

I understand that the callback needs to be as static. But I do not know how to solve even by reading many discussions in website such as: http://www.newty.de/fpt/callback.html

 

I am not a professional programmer and do not want to be. My application is very simply as I mentioned before. I am sure there is someone in NI who can just simply put a function as that trampoline function so we can easily call or duplicate.

 

Thanks,

Junqi

0 Kudos
Message 5 of 12
(7,411 Views)

Hi,

 

Did you find any solution to your problems?

I am facing the same problem now.

Please do provide me if any solutions are available.

Thank you very much.

0 Kudos
Message 6 of 12
(7,081 Views)

You can always search our community examples at http://zone.ni.com/dzhp/app/main to see if you can find any related examples. Otherwise you would need to get help of ANSI C examples in the NI-DAQ folder, and convert them to C++.

National Instruments
Applications Engineer
0 Kudos
Message 7 of 12
(7,062 Views)

 

Hi,

 

Thanks for the reply.

I did try to convert the ANSI C to C++ 6.0 MFC, but somehow the callback function receive nothing.

After googling, I found that most people face the same problem as they mentioned the callback functions are non-static member.

 

Therefore, I am trying to search for example solution that it could perform data acquisition in VC++ 6.0 MFC instead of console-based application.

 

 

Thank you.

0 Kudos
Message 8 of 12
(7,058 Views)

Unfortunatly, C++ is our legacy product, that's why we don't have examples or much support for it. Did you see this forum post? http://forums.ni.com/t5/Multifunction-DAQ/How-to-use-RegisterEveryNSamplesEvent/td-p/775384/page/2?v... It gives a possible solution as below:

- First, call back function has to be declared as static data member to 
match C signature. 
- pass the call back function as a reference object 
ClassName::&CallbackfunctionName. 
- pass "this" pointer for call back argument. 
-  In the call back function, Dispatch to another data member function 
using the access object of call back data which was passed by "this" 
pointer. 
- In dispched function, you will be able to read NI buffers and have access 
to rest of data members.

National Instruments
Applications Engineer
0 Kudos
Message 9 of 12
(7,039 Views)

Hi,

 

Thanks for the fast reply.

However, do you mind provides a simple example on the c code implementation on MFC?

I not quite understand the explanation above.

 

Thank you.

 

0 Kudos
Message 10 of 12
(7,033 Views)