02-21-2008 08:45 PM
| DAQTestingDlg.cpp (14 kb) |
02-22-2008 04:49 AM
I am trying to get the hang of it. So in my program, so far I am able to add channels but I find it a bit crude.
In OnInitDialog:
LoadStringVectorInComboBox(m_input1, CNiDAQmxSystem::GetPhysicalChannels(DAQmxPhysicalChannelTypeAI, DAQmxPhysicalChannelAccessExternal));
LoadStringVectorInComboBox(m_input2, CNiDAQmxSystem::GetPhysicalChannels(DAQmxPhysicalChannelTypeAI, DAQmxPhysicalChannelAccessExternal));
In the Startbutton function:
m_input1.GetWindowText(IN1);
m_input2.GetWindowText(IN2);
m_inputTask = std::auto_ptr<CNiDAQmxTask>(
new CNiDAQmxTask("inputTask"));m_outputTask = std::auto_ptr<CNiDAQmxTask>(
new CNiDAQmxTask("outputTask"));....
m_inputTask->AIChannels.CreateVoltageChannel(IN1, "", DAQmxAITerminalConfigurationDifferential, omin, omax, DAQmxAIVoltageUnitsVolts);
m_inputTask->AIChannels.CreateVoltageChannel(IN2, "", DAQmxAITerminalConfigurationDifferential, omin, omax, DAQmxAIVoltageUnitsVolts);
...
My parameters are the same for both inputs. How do I combine them in one task? I tried several methods to combine IN1 & IN2 but still failed.
I want to use the variables from the user selection in the combo box for flexibility.
super thanks!!!
.
02-22-2008
04:07 PM
- last edited on
10-23-2025
03:55 PM
by
Content Cleaner
Hi A,
To clarify, I believe that you are trying to modify the SyncAIAO_DigStart example that ships with measurement studio for VC++ to use more than one AI and AO. Simply put, you will have one task for AI and one for AO. You will configure the timing on AO to correlate to the AI timing. You will also use the DAQmxAnalogMultiChannelReader/Writer functions rather than the single channel. Also, when you configure the channels, you were correct that you will use an array of channels.
I would suggest looking at other examples, specifically the ContAcqVoltageSamples_IntClk in the Analog Input folder and the corresponding example in Analog Output to take those implementations and apply them to your program. Also, check out these great online resources that can be found on our website (I put them in order of personal preference).
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
https://www.ni.com/en/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-handl...
Using NI-DAQmx in Text Based Programming Environments
https://www.ni.com/en/support/documentation/supplemental/21/using-ni-daqmx-in-text-based-programming...
Getting Started with NI-DAQmx: Main Page
https://www.ni.com/en/support/documentation/supplemental/06/getting-started-with-ni-daqmx--main-page...
Also under Start Menu\All Programs\National Instruments\NI-DAQ\NI-DAQmx C Reference Help and the Measurment Studio Help documentation are filled with great information about the functions and what they do and what parameters they expect.
02-26-2008 04:26 AM
02-27-2008 12:31 AM
02-29-2008 03:54 PM - edited 02-29-2008 03:56 PM
