Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant with SDI

Hello,

I am learning MStudio with Visual C++ (MFC), and have just completed a tutorial using Document/View Arch in VC++:
http://zone.ni.com/devzone/conceptd.nsf/webmain/B3C0698D5213E8AF86256A7100645C2F

Now I am trying to output these waveform on a PCI-6040E device using NI-DAQ Assistant and I already have DAQ-7.3 installed. The problem is I don't know how to use the "wafgen" task class, and I want to click the button to start generation and click again to stop. I find little online matrial about this matter.

Can someone please have a look, thank you!

Rolly
0 Kudos
Message 1 of 3
(3,291 Views)
Hi Rolly,

I looked at your zip file that you provided. Wafgen.c was the file that was automatically created from your DAQ assistant. It contains the task configuration, timing and triggering information.

If I understand you correctly, you want to start and stop acquisition from your front panel. So you would have to create callbacks for your button. If you double click on your button (or right click and "Add Event handler"), that will automatically create the callback skeleton code for you. It will be created in the WaveFormView.cpp file.

So all you have to do then is, make function calls to start acquisition (which is auto generated) from within the callbacks.

I hope this helps.

SijinK
National Instruments.
0 Kudos
Message 2 of 3
(3,266 Views)
Hi Rolly

The wafgen class basically sets up the daqmx task by automatically calling configuration methods for you. So one way you can use this is the following

In your WaveformDoc.h, add the following

public:
Cwafgen aoGen;


This will setup and configure the DAQmx task for you.

Then in your document initializarion routines, you can verify the task by calling the following method.

aoGen.Control(DAQmxTaskVerify);

To see how you can use the CNiDAQmxTask class to setup an analog output operation, check out the ContGenVoltageWfm_IntClk example under < Measurement Studio folder > \DAQmx\Analog Out\Generate Voltage\ContGenVoltageWfm_IntClk. This is a dialog application, but it demos how you can setup the daq analog output operation by clicking on a button. Since you have already done the configuration using the wafgen class, you can refer to the part of the example that shows how to use the CNiDAQmxAnalogSingleChannelWriter class(or the multi channel writer class if you are writing to multiple channels)

I hope this helps

Let me know if you have any questions.
Bilal Durrani
NI
0 Kudos
Message 3 of 3
(3,259 Views)