labview - Reading CI Frequency In C# With NI USB-6363 -


working labview code

attached above labview code have used in past read frequency data device. use start task vi between property node , while loop.

i trying code in c#. far have been able code analog output's , analog input's on device, usb-6363, (so know able write , read data device c#).

i have used multimeters (grainger link @ bottom of post) read frequency data (orange hz mode device set in picture).

however, c# code seems having issues reading frequency data. c# code attached. when try running program following error. same error when using example program called 'measdigfreqbuffcont_extclk_armstart.2013'. code show creating task, call code later in program in different section , how getting error.

------------------------------------------------- begin error code -------------------------------------------------

{error=-200077 message="requested value not supported value property. property value may invalid because conflicts property.\n\nproperty: nationalinstruments.daqmx.cichannel.frequencydivisor\nrequested value: 1\npossible values: 4 4294967295\nchannel name: digital frequency\n\ntask name: _unnamedtask<0>\n\nstatus code: -200077"}

------------------------------------------------- end error code --------------------------------------------------

in example program asks sample clock source (a pfi channel device). in labview code not ask this. example maybe more in detail trying do?

task frequencyinput = new task();  frequencyinput.cichannels.createfrequencychannel(                 "dev1/ctr0",                 "digital frequency",                 200,                 15000,                 cifrequencystartingedge.rising,                 cifrequencymeasurementmethod.dynamicaveraging,                 0.001,                 1,                 cifrequencyunits.hertz                 );   frequencyinput.cichannels["digital frequency"].frequencyterminal = "/dev1/pfi0";  countersinglechannelreader counterfreq = new countersinglechannelreader(frequencyinput.stream);   double counterfreqdata = counterfreq.readsinglesampledouble();  txtpfi0.text = convert.tostring(counterfreqdata); 

fluke (r) fluke-115 compact - basic features digital multimeter, 14° 122°f temp. range

formatting error message:

requested value not supported value property. property value may invalid because conflicts property.

property: nationalinstruments.daqmx.cichannel.frequencydivisor
requested value: 1
possible values: 4 4294967295

task name: _unnamedtask<0>
status code: -200077

according documentation, asking device use invalid divisor. change 1 4:

frequencyinput.cichannels.createfrequencychannel(                 "dev1/ctr0",                 "digital frequency",                 200,                 15000,                 cifrequencystartingedge.rising,                 cifrequencymeasurementmethod.dynamicaveraging,                 0.001,    /* here */   4,                 cifrequencyunits.hertz                 ); 

ni installs c# examples daqmx, , includes 1 measuring frequency:

c:\users\public\documents\national instruments\ni-daq\examples\dotnet4.0\counter\measure digital frequency\measdigfrequency_lowfreq1ctr\cs


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -