Use DAQmx counter or relaxation?

Hello

I am beginner with products OR and I'm triyng to get a result with an acquisition of data USB-6008 and ANSI C API

My goal is to detect the pulse (approximately 1.4V for about 10 ms) and calculate the time between the rising edges (should be between 0.5 and 2 seconds).

As the square pulse, I connected the cables to the digital lines GND and PFI0.

First I tried to use the functions of triggered, but I failed.

So, I am now using the meter functions, but I always got an error and I don't know how to fix it.

Here is the code:

Int32 error = 0;

TaskHandle taskHandle = 0;

char errBuff [2048] = {'\0'};
printf ("=> DAQmxCreateTask... ");

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));

printf ("OK\n");
printf ("=> DAQmxCreateCICountEdgesChan... ");

DAQmxErrChk (DAQmxCreateCICountEdgesChan (taskHandle, "Dev1/ctr0", "", DAQmx_Val_Falling, 0, DAQmx_Val_CountUp));

printf ("OK\n");
printf ("=> DAQmxCfgSampClkTiming... ");

DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandle, "" / Dev1/PFIO ", DAQmx_Val_Falling, DAQmx_Val_ContSamps, 1000 1000 '));

printf ("OK\n");
printf ("=> DAQmxStartTask... ");

DAQmxErrChk (DAQmxStartTask (taskHandle));

printf ("OK\n");

I got the following result:

=> DAQmxCreateTask... Ok
=> DAQmxCreateCICountEdgesChan... Ok
=> DAQmxCfgSampClkTiming...
DAQmx error: measurements: request the value is not supported for this property value.
Property: DAQmx_SampTimingType
You asked: DAQmx_Val_SampClk
You can select: DAQmx_Val_OnDemand

Task name: _unnamedTask<0>

State code:-200077

Can someone tell me how to fix it?

In addition, if you think that there is a better way to implement my requirement, feel free to tell me.

Thanks in advance

Mobill

Hello

Finally, I managed to get the pulse with the following commands:

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));

DAQmxErrChk (DAQmxCreateCICountEdgesChan (taskHandle, "Dev1/ctr0", "", DAQmx_Val_Falling, 0, DAQmx_Val_CountUp));

DAQmxErrChk (DAQmxStartTask (taskHandle));

while (cVal == 0) {

DAQmxErrChk (DAQmxReadCounterScalarU32 (taskHandle, 10, & cVal, 0));

}

Thank you Thomas for your help.

Best regards

Laurent

Tags: NI Hardware

Similar Questions

  • How to generate a single Point (On-Demand) edge counting with relaxing break

    I have problem when creating a Labview program to generate a single Point (On-Demand) edge counting with relaxing break illustrated in FIGURE 1 below. I only know how to build counter edge without relaxing break and my program is illustrated in FIG. 2 and gaskets also. Should what changes I make on my program? The DAQ card that I use is 6259 PCI/USB.

    FIG1. Single edge counting with break Point (on request)

    Fig.2 my program to generate the edge without relaxing break

    It is resolved

  • How can I pause and resume the analog output using DAQmx?

    I use a DAQ hardware to produce an analog waveform.  I would like simply to break the output of the wave and then resume where it left off.  I use DAQmx and LabVIEW 2011.

    I've seen examples that use a digital or analog break trigger, but I would take a break in the software only.  How can I do this?

    -Joe

    Hi Joe!

    I spent some time thinking about it and I realized that you can technically use a fundamental mission of the analog output, as you previously wrote that runs continuously. However, the generated output samples are controlled by the sample clock pulses, and can be manipulated to fit our needs "suspension."

    To do this, we will need another counter task that generates a pulse train (see our examples of shipping under material input and output > DAQmx > generating digital pulses > generate dig Pulse Train - Continuous.vi) that stops and starts the user to choose. This can be in another quite VI or controlled by software. We will use this as the task of our output sample clock.

    Then, the task of the AO, wire a constant to the sample clock source and select ' DevX/CtrXInternalOutput"based on the counter that you specified in the task of counter. You will need to choose "I/o name of filtration" and check the box that says "include advanced terminals' and right-click of the constant. See picture attached as a reference. In this way, the task of the AO is constantly running, but it generates only actually all data when the meter running task.

    Let me know if you have any questions!

    Have a great day!

  • I need the raw ADC output card PCI-4462 using DAQmx

    I need the raw ADC output card PCI-4462 using DAQmx

    Is it possible or are only regulated units availible.

    Ken Manatt

    [email protected]

    There is a version of 'Raw' DAQmx Read (see image).  This is probably what you are looking for.

    -Alan

  • How self test 6713 using DAQmx programmatically?

    I use DAQmx and I need to be able to perform a self-test on a map of NI 6713 analog output without using MAX. Any suggestions?

    DevtPro,

    As you can see in this document , the recommendation was to use Reset running as self-test in addition to other things.  Currently in DAQmx 8.9 and later there is a Self - Test.vi DAQmx that allows to run just a self-test.  I already submitted a change to this document and it should be reproduced soon.

  • How to build a single Point (On-Demand) edge counting with relaxing break

    Hi, I am building a clock as shown below. It is also called 'Single Point (On-Demand) Edge Counting with relaxing break'.

    "

    I have problem to find the code example. So far, I can only build a counter edge without a controller trigger like below. Could someone help me?


  • How to tell if someone uses my count at home when I'm not home?

    Original title: who was on my computer.

    Probably a stupid question, but I've never had to ask before.  How to tell if someone uses my count at home when I'm not home?

    You can examine (eventwvr.exe) Event Viewer system log. He recorded each logon.

  • I can do this (use a counter 'i' the instance name)

    Hello

    I have 5 dynamic text object in my scene and I need to make a treatment for them (compare each one to the other)

    my text instance names are:

    0, to1, 2, to3, to4

    and their names of variables are:

    T0, t1, t2, t3, t4

    what I have to do is:

    If (t0>t1) then 0 moves to the place of to1 and to1 will move instead of 0

    up to now, I have no problem to compare 2 elements and change their place, but what happens if I have a large number or an unknown number of items, I know that I can (must) a loop but the problem is that I can't do this

    For examle, let's say I have 10 items:

    for (i = 0; i < 10; i ++) {}

    {If (t [i] > {t [i + 1])}

    Exchange (to [i], to [i + 1]);

    }

    }

    This code perfectly work when I work with a table

    I hope that you understand my problem, I don't need someone to tell me how to apply sorting in a table all the I want, it's the ability to use a counter on a MovieClip instance variable name, DynamicText, etc...

    Thank you

    If you follow what I offered in your other post, it would be something like...

    for (i = 0; i<>

    {if(t[i]>t[i+1])}

    Exchange (this ["on" + i], this ["to" +(i+1));

    }

    }

  • count the number of lines without using the count function

    Hello
    How count the number of lines without using the count function?

    Thank you

    Assuming that your statistics table are updated:

    select num_rows
    from   all_tables
    where  table_name = 'YOUR_TABLE_NAME_IN_UPPERCASE';  
    

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/statviews_2105.htm#REFRN20286

  • Using a counter with FiniteSamps and one with ContSamps

    I am using 2 counters on the NI USB-6229 (or USB-6259), case where a counter is implemented for FiniteSamps and another for ContSamps. I have the following MeasurementStudio code:

    ErrChk DAQmxCreateCOPulseChanTicks(hCnt0, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
    ErrChk DAQmxCfgImplicitTiming(hCnt0, DAQmx_Val_FiniteSamps, 100);

    ErrChk DAQmxStartTask (hCnt0);

    ErrChk DAQmxCreateCOPulseChanTicks(hCnt1, "Dev1/ctr1", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);

    ErrChk DAQmxCfgImplicitTiming(hCnt1, DAQmx_Val_ContSamps, 2);

    ErrChk DAQmxStartTask (hCnt1);

    When I run it, I get an error-50103 "the resource specified is reserved". If I change the FiniteSamps to ContSamps on the first counter, everything works fine.

    If I use only one counter with FiniteSamps, everything works very well.

    Is this a bug in DAQmx or the use of double counter on M Series devices is limited to ContSamps?

    VIC

    Hey Vic,

    It is actually planned on a device of the M series.  Here's a time diagram of the M Series user manual which might make this a little clearer:

    The device uses actually one counter for the other door so the result is a generation of finite pulse.  If you can provide the door from another source, you can configure a generation of continuous pulses on two counters and their door (DAQmx calls it a "relaxing break") of this external signal.

    You can also look at the use of the digital I/o correlated to generate impulses over multiple (up to 32 lines on your 6229 and 6259).  You could use one of the counters to generate a time base for digital lines and build the waveform as a result.

    One thing to note is that our new X series cards can generate a generation of impulses finished on a "single" counter (it was actually a paired internal counter that allows this).  There are four accessible counters by the user on the X series devices, which means you could generate four pulse trains finished.

    Best regards

    John

  • Traditional DAQ against DAQmx Counter

    I'm trying to convert an existing legacy application written in LabVIEW LabVIEW 2012 6. I have a problem with a traditional Daq counter. Specicically the VI "event or time meter Config.vi. In the attached VI, you can see that 1 meter is configured to count the cycles of an internal signal, not a PIN counter SOURCE signal. This configuration generates an integer for each cycle of the internal signal: every 10 microseconds in this case. I can't find a way to replicate this feature in DAQmx. I use a DAQCard-6062E (PCMCIA Slot) card in a Dell D620 Laptop. I tried to attach a fully functional VI, but get the error 'the content of the attachment does not match the type of file.' to fix this I had to fix a JPG image. I've included comments in VI to clarify things. Any help appreciated. Thank you.

    In DAQmx you can achieve the same result by setting the terminal entrance for a task of edge to the time base County internal 100 kHz:

    The 100 kHz Timebase is considered to be a "Advanced terminal" (don't get started me on the topic) so see in the dropdown menu, you must right-click on the control / constant and select the appropriate name of I/O filtering option.

    Best regards

  • Open all relays on NI2569 using DAQmx in Labview2009

    How to open all relays on a map of 2569 with DAQmx in LV2009?

    I looked at the help and it says select (using shiiping examplecontrol witch individual relay) BROWSE from the dropdown under the relay.

    Then that's it!  I tried 'CTRL' then the channels I wanted... nothing...  I tried 'SHIFT', then the channels I wanted... still nothing.

    I think that the help file is missing something!

    See attachment.


  • Frequency measurement of analog input using DAQmx C APIs on SMU-6341 map

    Hello

    I use Linux DAQmx and attempt to measure the frequency of analog input using the map DAQ SMU-6341.

    There is an ANSI-C frequency measurement example:

    / usr/local/natinst/nidaqmx/examples/ansi_c/Analog_In/Measure_Frequency/Cont_Freq-Int_Clk-SCXI1126

    However, the call to DAQmxCreateAIFreqVoltageChan results in the following error:

    DAQmx error: selected physical channel does not support the type of measure required by the virtual channel you create.

    Create a channel to a type of measure that is supported by the physical channel, or select a physical channel that supports the type of measure.
    Property: DAQmx_AI_MeasType
    Required value: DAQmx_Val_Freq_Voltage
    Possible values: DAQmx_Val_Current, DAQmx_Val_Resistance, DAQmx_Val_Strain_Gage, DAQmx_Val_Temp_BuiltInSensor, DAQmx_Val_Temp_RTD, DAQmx_Val_Temp_Thrmstr, DAQmx_Val_Temp_TC, DAQmx_Val_Voltage, DAQmx_Val_Voltage_CustomWithExcitation

    Task name: _unnamedTask<0>

    State code:-200431

    DAQmx does support the function of the frequency on the map 6341, or should we use examples of voltage and calculate the frequency manually?

    Frequency of HAVE it is a type of channel that has been supported only on the SCXI module name of the example.

    You will need to use a voltage input channel and calculate the frequency manually for your device.

  • OR USB-6211 is used to count climbing on board TTL

    Hello

    I'm new to NOR-DAQ cards, and so before buying whatever it is would like to know if it is possible to use a device, NI USB-6211

    County and bin amounting to edges of a TTL signal.

    What I want to do is to count how many rising edges of a TTL signal I get in a period of 1 ms; a 20 Mhz sampling frequency should be fine.

    I would like to use Matlab to control and read the number of edges that are counted as well as in the meantime write and read digital IO ports from the USB-6211.

    Is it maybe possible to leave the external TTL signal trigger a 6211 counters, an output then periodically (1 ms) and reset the value of the counter?

    Is it possible and if yes, is it a good idea?

    Thanks and regards,

    Manual

    Manual Hi

    In order to generate this signal, I could use a second timer mode continuous pulse Train generation, right?

    -> Right. You can choose between 2 options

    (1) get the signal to another device, for example signal generator or something like that. If you cannot use such a device, you must select the second solution->

    (2) generate the 1ms period square wave with the meter of the USB-6211 seconds

    I don't know a smart way to generate the 1ms period signal without the software side. You need the software to configure the second counter, route the signal to the second counter for the first counter and so on.

    Maybe you can use what is called "panel test" inside the Explorer Measurment & Automation to generate signal. The Measurment & Automation Explorer is a tool provided with the driver for the DAQ cards. The original purpose of this software utility is to configure your hardware, test and so on.

    I don't know if it works, but I imagine that the following solution:

    You use the test panel called inside the Measurment & Automation Explorer to generate the 1ms period signal (see attached screenshot and http://www.ni.com/white-paper/4638/en). You have no additional program to run the test Panel. Box USB-6211, you use a wire to connect the signal output of the meter of second at the entrance to the first counter. After that, you run Control Panel to test the generation of signals for the seconds counter. At the same time, you start your Matlab program and configure only the first counter. You will need to run the Testpanel all the time if you want to run your measurment.

    Not very nice, but maybe the only solution.

    Best regards, Stephan

  • How to use DAQmx create linear scale

    Hello. I have an output of an amplifier which is 10 mV/V, which is read by a USB-6002. This amplifier voltage range is 0 to 200 volts. Have tested the DAQmx create scale Vi, I don't understand how it works. Looked at the other posts here for answers, I still haven't understood how it works. As a first step, it says that it uses the y = mx + b equation for it. I don't know what the slope refers to except if it is the angle of the line. If someone would have an example that explains how it works, it would be great. I also tried to look at an example but could not find one. Thank you

    Here is an explanation "improvised" y = mx + b.  If you think of 'x' as the input and 'y' as output, then you can consider "m" as the gain, and "b" corresponds to the offset, the output that you can read with zero entry.

    If you think of this equation from an amplifier, many are designed to have zero output when there is no entry.  In other words, b = 0.  If you have a gain of 10 mV/V (which I guess means that a 1V input would give an output 10mV, then m, usually called "the slope" (which is the slope of the curve of output), serait.010/1 = 0.01.)

    Note you describe the range of the amplifier as 0-200V, so the output will be 0 - 2V, well inside the ±10V USB-6002.

    Bob Schor

Maybe you are looking for

  • opacity of URL bar

    When you start typing in the url there is a menu drop-down indicating the locations you have visited but the opacity of it is also dark u can't read it.you see through it...

  • Office Jet Pro 8610: El Capitan problem - error =-19 unsupported color space

    Q: problem for you to connect to HP Office Jet Pro 8610 Apple - iMac 21.5 "®-Intel Core i5 (1.6 GHz) - memory of 8 GB - 1 TB hard" El CapitanPrinter: HP OfficeJet Pro 8610Help my printer set-up of mother-in-law to his new iMac. Wi - Fi connection; It

  • XP, try to use Guided Help get message 'guided help can be downloaded right now.

    Hi I am running windows xp 32 bit editionon houses a HP pavilion a620n with a 3200 + processor AMD Athlon xp with a speeed of 2.20 ghz processor and a max of 512kb L2, 2 GB pc3200 DDR SDRAM. Drive hard seagate sata 2 TB, NVIDIA GeForce 6200, a video

  • use of extra recovery disk

    I have mine but never asked for it. What is this for?  I have lost my documents and it says "refer to the printed instructions.  I have a system of SR5410F

  • Obsolete application permissions

    Hi all We have two permissions in our app (read_cellular_data and access_uicc_carrier_restricted) that Momentics identifies as "not valid for 10.3.1 API. Before removing, I understand include: What exactly they defined as they were valid (for previou