 Curt_C
		
			Curt_C
		
		
		
		
		
		
		
		
	
			03-10-2014 10:57 AM
Hi,
There was a question posted earlier asking about measuring frequency using C# and a multifunction DAQ that got my interested in th e topic.
I found this example using a counter but it throws an error at startup.
https://decibel.ni.com/content/docs/DOC-16563
There are 2 tasks, an AITask and a counter task.
The error occurs when trying to setup the input frequency terminal.
counterTask = new Task();
            
                counterTask.CIChannels.CreateFrequencyChannel(counterComboBox.Text, "",
                    Convert.ToDouble(minValueTextBox.Text),
                    Convert.ToDouble(maxValueTextBox.Text), edge, 
                    CIFrequencyMeasurementMethod.LargeRangeTwoCounter, 0.001,
                    (long)divisorNumericUpDown.Value, CIFrequencyUnits.Hertz);
                counterTask.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples, 1000);
                // Setup the Counter Input Frequency Terminal to be the Start Trigger from the AI Task
               counterTask.CIChannels.All.FrequencyTerminal = aiTask.Triggers.StartTrigger.Terminal.ToString() ;
Here's the Error
Error 1 'NationalInstruments.DAQmx.StartTrigger' does not contain a definition for 'Terminal' and no extension method 'Terminal' accepting a first argument of type 'NationalInstruments.DAQmx.StartTrigger' could be found (are you missing a using directive or an assembly reference?)
I'm using Visual Studio 2008, Measurement Studio 2008 Ver 8.5, DAQmx 9.5.5 and NET 3.5.
Am I missing something?
Thanks
Curt
 chris88
		
			chris88
		
		
		
		
		
		
		
		
	
			03-11-2014 05:14 PM
Hi Curt
Do you have DAQmx properly installed? Meaning that you should install it after you install VS and MS, in order to install the DAQmx .NET Support? The easiest way to see if the .NET support is installed is to go and try to run a built in example in C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.0, are you able to run any of this examples without errors??
03-12-2014 06:08 AM
Hi Chris,
Thank for the reply.
This is the only example that doesn't work.
Curt
 chris88
		
			chris88
		
		
		
		
		
		
		
		
	
			03-13-2014 11:25 AM
Hi Curt
Do you have the proper references included in your project? I am able to run this code as it is with no errors. You should see NationalInstruments.DAQmx under the references of your project.
This reference is in this path.
C:\Program Files (x86)\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll
regards