08-01-2007 03:37 PM
08-02-2007 07:31 PM - edited 08-02-2007 07:31 PM
The Visual C++ example directory locations on Windows XP/2000 are shown in the attached image "Windows XP_2000 C++ Example Locations.jpg." The image is taken from the Where To Find Examples topic in the NI Measurement Studio Help.

The Visual C++ example directory locations on Windows Vista are shown in the attached image "Windows Vista C++ Example Locations.jpg." The image is taken from the Where To Find Examples topic in the NI Measurement Studio Help.

Message Edited by Matt A on 08-02-2007 07:33 PM
08-03-2007 08:14 AM
08-03-2007 07:06 PM
08-04-2007 07:31 PM
Hello Matt A.,
Thanks again for the help.
With the same setup I have, which is using a Transdeucer voltage source as channel1, I can read voltage and test the counter using Edge triggered setup (PFI4 and PFI7) in Measurmeant and Automation tool. When I use the example of measuring voltage cont clk in C++, with the clock using PFI4 or PFI7 as I switched between both, the one difference I noticed is that with PFI7, I can read samples at higher speed. When I use a printf satament to read data array, it displays 0 for answers. I also played with sample rates, but it didn't seem to do anything.
Thanks
08-06-2007 04:14 PM - edited 08-06-2007 04:14 PM
Message Edited by Matt A on 08-06-2007 04:15 PM
08-06-2007 07:43 PM
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,-1,10.0,DAQmx_Val_GroupByChannel,data,1000,&read,NULL));
if( read>0 ) printf("Acquired %d samples\n",read);for(int i=0;i<1000;i++) { printf(data[i]);
Yes, I do get higher rate of samples acquisition when I select PF7 as opposed to pf4 for clock source.
Another question I have, to accomplish the above goal I mentioned of reading 8 channels, DO I have to create a task with 8 channels, or Could I do it without specifically creating a task?
Thanks
08-08-2007 12:10 AM
08-08-2007 04:16 PM
08-08-2007 10:49 PM
Creates channel(s) to measure voltage and adds the channel(s) to the task
you specify with taskHandle. If your measurement requires the
use of internal excitation or you need the voltage to be scaled by excitation,
call DAQmxCreateAIVoltageChanWithExcit."
The help file also provides the function definition as follows:
"int32 DAQmxCreateAIVoltageChan (TaskHandle taskHandle, const char
physicalChannel[], const char nameToAssignToChannel[], int32 terminalConfig,
float64 minVal, float64 maxVal, int32 units, const char customScaleName[]);"
The nameToAssignToChannel[] parameter is used to name the physical channels in the task and is described as follows:
"The name(s) to assign to the created virtual channel(s). If you do not specify a
name, NI-DAQmx uses the physical channel name as the virtual channel name. If
you specify your own names for nameToAssignToChannel, you must
use the names when you refer to these channels in other NI-DAQmx functions."
If you want to assign a different name to each physical channel, you will have to use multiple calls to the DAQmxCreateAIVoltageChan() function and add a new physical channel with the new name to the same task.
You can add different types of channels to the same task, so long as they are all performing the same operation (analog input, analog output, digital input, digital output, counter input or counter output). There is a similar function to the DAQmxCreateAIVoltageChan() for the different types of functions you may want to add. There is a DAQmxCreateAIStrainGaugeChan() function for strain measurements, there is a DAQmxCreateAICurrentChan() function for current measurement; there is a DAQmxCreateAIRTDChan() function for RTD temperature measurements and so on. You can use these functions to add channels to the same AI task, however you will have to specify a physical channel for each function.
If you notice, the DAQmxCreateCICountEdgesChan() function also has a nameToAssignToChannel[] parameter that you can use to assign channel names to your counter task. For more details about channels and tasks, I would recommend that you review this KnowledgeBase. Again, I would also recommend that you examine the "NI-DAQmx C Reference Help" for more specifics; all these functions are described in detail in this help file.