Up/down count edges: traditional daq vs daqmx

Hello,
I've inherited a program that uses an encoder to read the position of a torque-arm.  The program uses traditional daq.  The encoder position data is read using "Counter Read Buffer.vi".  Then, by simply casting the output of "Counter Read Buffer.vi" to an I32, the position data can be either positive or negative.
1. Is this a valid method of using "Counter Read Buffer.vi"?  (I wonder because if I capture data as I move the torque arm back and forth, the data suggests that the encoder is not moving back to zero counts each time.  For example, the first time the arm is moved through its range, it might go from 0 counts to 100 counts; the second run may be from 10 counts to 110 counts, the third from 15 to 115 and so on).
2. Is something this simple available in DAQmx too, or do I have to monitor each encoder point that I read to detect when the counter rolls over and handle it manually?
Thanks in advance for any assistance!
Chris

Hello Chris,
For the answer to your first question, this may be an issue with the DAQ device you are using. What exact device are you using?
For the second part, the Measure Angular Position VI, found in the Example Finder under Hardware Input and Output»DAQmx»Counter Measurements»Position, is a good quadrature encoder VI for reading angular position.
Try using this example and see if the behavior is different between the Traditional DAQ and NI-DAQmx code and let me know how it goes.
Regards,
Dan King

Similar Messages

  • How to simutaneously use 2 PCI cards, one with traditional DAQ, the other with DAQmx?

    Hi,
    I am currently trying to debug a system that used to work.. but sadly isnt anymore
    A single computer contains 2 PCI cards (6110 & 6036E). The 6110 card is controlled by a fairly old software, programmed in labview, and hence, using Traditional NI-DAQ. The 6036e card is controlled by a more recent soft, programmed in LV as well but using DAQmx.
    the AI/AO of the 6110 card is only momentarily used (20 sec consecutively, every minute) while the 6036E card is continuously receiving and sending data on its AI/AO.
    Now the problem: the program that control the 6036E card freezes every time that the old prog access the 6110 card.. and then it works again perfectly until the next time that the 6110 card is used.
    So my question: how can I make those 2 cards work simultaneously?
    I dont think that it is because of the software nor because of the computer lack of memory/CPU if it used to work in the past. It might be about a wrong configuration of cards in the MAX but I couldnt find anything wrong there (no problem when accessing AI/AO of both cards through "test panel")
    Thank you very much for you help.

    That's what bugs me. The only thing that those 2 cards share is an AO of the 6110 connected to an AI of the 6036.
    For the rest, nothing is common. The 1st program only deal with device1, while the 2nd prog only access dev2. There shouldnt be any problem and everything is working fine separately. Hence, why I was wondering if the traditional daq and daqmx might conflict on a same computer.
    I just cant find out why the 2nd program controling the daqmx card just freeze everytime the 1st program access the traditional card. It actually doesnt freeze completly but becomes soooo slow, with about only 2 iterations of the main while loop during those 15-20 sec (instead of the normal 3-4000 iterations during such a period).
    The computer specs are a 2.2ghz proc for 1G of ram and running XP, so it should be ok.. even though the computer does slow a bit down when the 1st prog access the traditional card.

  • Traditional DAQ & DAQmx

    I want to change from Traditional DAQ to DAQmx. What shall I do?

    As a further note, you might want to take a look here for a tutorial and info.

  • Is there any incompatibility between Labview 8.5 and Traditional DAQ?

    Hi,  I`m using a DAQPad 6020E and the Labview 8.5 Daq assistant don`t detecte my DAQ when a try to create a new task (to create a new virtual chanel). But MAX detect the DaqPad. So, is ther any incompatibility between Labview 8.5 and traditional Daq? Do you know how can I resolve this?
    Thanks.

    First, you posted to the wrong board. Measure is an old add-on for Excel.
    Second, there is no incompatibility between LabVIEW 8.5 and tradtional DAQ. There is an incompatibility between traditional DAQ and DAQmx which is what the DAQ Assistant uses. Make sure that you install DAQmx if your device is supported by it. Otherwise, you will not be able to use the DAQ Assistant.

  • Counting edges with dynapar encoder

    Hello,
    I am very new to Labview. To kick off some experience, I am trying to count edges on a Dynapar encoder, Model E14020000303. Here is the data sheet:
     https://ecatalog.dynapar.com/downloads/E14_DS_702489_2_.pdf
    I am using LabVIEW 2011, with a NI USB-6210 DAQ. My white wire on the encoder is connected to PFI0. The red and black wires are connected to my 5V voltage source. I am rotating my encoder to count the revolutions. Supposedly my encoder is a 200 PPR, and it is also quadrature. 
    However, I am not understanding what I am getting when counting edges using DAQ Assistant. I am using the Edge Count on ctr0. I can set the DAQ assistant to run on 1 sample acquisition mode and count the rising edge. When I turn the encoder 100 times, the measured value on the DAQ Assistant is usually around 76500, which would mean 765 edges counted per revolution. I can also change things around and go to continuous acquisition mode. I set up PFI2 as the external clock source with a rising edge and put the green wire in PFI2. I set it to read 1 sample at 1k Hz. This usually results in counting around 820 edges.
    I don't understand why I am getting these readings. The DAQ Assistant should only be counting rising edges because that is what it is set at. Why am I getting numbers so high? 
    Thanks!
     

    Hey guys,
    Sorry for the late reply, I have been put on other tasks. You all were right about the ground, that indeed was the problem. With the daq grounded, the encoder measures 200 edges per revolution.
    Thanks!

  • Need help in converting DAQ to DAQmx

    Hi,
    I've struggled with coverting traditional DAQ to DAQmx for two weeks. I really need help from someone.
    As you can see the picture below, I've tried to replace the old VI's with new ones. But, it doesn't work. Of course, the VI below is just a part of my VI. VI's after case structure are inside of while loop.
    Could you please give me thought that why it doesn't work?
    FYI: The strange thing about it is that it runs without any error messege, but there is no actual output (values on the graph, data in arrays, etc).  
    Thanks in advance.
    Best,
    Jay
    Solved!
    Go to Solution.
    Attachments:
    Untitled 1.vi ‏74 KB

    Hi Jay,
    Assuming that the Traditional DAQ and DAQmx code are screenshots from separate VIs, I believe that the following parameter of the read functions in each driver would account for the different behavior that you are seeing (you have both set to -1):
    Traditional DAQ:
     DAQmx:
    So, when you give DAQmx Read a -1 for "number of samples per channel" when running a Continuous task, the effect is that it will return whatever data is available at the time DAQmx Read is called.  In your case this is immediately after the task is started so there very well could be 0 samples available in the buffer.  I'd imagine that you would see data if you change the value of this parameter from -1 to the actual number of samples that you want to read.
    Having said this, if you want to acquire continuously you should call DAQmx Read from inside a loop.  I agree with the others that you should take a look at the DAQmx shipping examples to help get started, you will probably find something very close to what you want to do.  You can find the examples at:
    Help >> Find Examples... >> Hardware Input and Output >> DAQmx
    Thanks for posting, I hope this helps!
    -John
    John Passiak

  • Daq down counter example for pci-mio-16e-4 wanted

    Hi!
    I am searching for an example vi of a down-counter for
    ttl pulse trains.
    thnx,
    Holger

    Thanks for that, but that was also my first idea. Unfortunaly there is no
    example for an DOWN counter in that directory. they all count up.
    i want to count incoming a ttl-pulse-train and terminate that train(by
    dio-line) when
    counted exactly a certain number of counts. if i check the counts (600Hz)
    each time by software, there seems to be no chance to terminate the train
    at the desired number of pulses and thatfore i will have to use the daq card
    on board counter. and my idea is, that a down counter (which is specified in
    the
    manual) would do it.
    my question therefore is, if anyone has ever used a DOWN counter, because
    i have no idea how to realise it/how to use the daq-included down-counter
    vi, which
    i don´t realy understood
    i am thankful for any reply!
    bes
    t regards,
    holger
    "Nirmal Sharma" schrieb im Newsbeitrag
    news:[email protected]..
    > Hi,
    > there are numerous examples which you can find at this path:
    > C:\Program Files\National Instruments\LabVIEW 6.1\examples\daq\counter
    >
    > or Goto Find examples in Labview launching Panel -> Hardware Input and
    > Output -> DAQ -> Counters
    >
    > If you are using DAQ card, Goto ->Count buffered edges or count Edges.
    >
    > Hope this works. Your feedbacks are welcome.
    >
    > Best Regards,
    > Nirmal Sharma

  • PCI-6703 on MAX traditional daq but not on daqmx

    Im using MAX 3.1.1 (with NI DAQmx 7.3.1f0) and its listing my device 6703 on the traditional daq list but not on the DAQmx. I'm trying to utilize the Express VI to use this card but since it does not apear on the list I can use it. I already tried F5 several times.
    Thanks fot the help.
    --Aaron

    PCI-6703/6704 are supported by traditional nidaq, and nidaqmx 7.4 and higher.
    They are not suppoeted by NidaqMx 7.3.
    if you want to use Nidaqmx, upgrade to the latest NIdaq driver.

  • Does NI PXI-6259 support both Traditional DAQ and NI-DAQmx of Labview 7.0 Express?

    I need to buy a Multifunction DAQ board which will be supported by both the Traditional and NI-DAQmx of Labview 7.0. Is the NI PXI-6259 appropriate for such application?
    Thank you.
    Ujwal

    M-series boards are not supported by Traditional NI-DAQ. Stick with the E-series if you require Traditional support.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Can I install an older version of traditional DAQ that support legacy DAQ with DAQmx for support of a new card?

    I have a LabPC+ that works fine, but is not supported in the latest versions of NI DAQ.  I also have a 6024E that I would like to use.  I know that the version of DAQ that supports the LabPC+ also supports that 6024E, but I would prefer to use the latest DAQmx with this.  Is this possible?

    Hi Brain:
    Doesn't look like it, the PC+ will only go up to 6.9.3 tradition DAQ
    http://www.ni.com/support/daq/versions_legacy.htm
    while the 6024E will go up to 7.4.1 traditional or 7.5mx or 8.0mx, dependiong on OS.
    http://www.ni.com/support/daq/versions_pci_pxi.htm
    I assumed these cards were PCI based.
    I am not a DAQ expert, so hopefully someone can verify this.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Need help in converting Traditional DAQ subvis to DAQmx configuration

    i need to convert these vis (of traditional NI DAQ) to be used with a new DAQ card that supports only NI DAQmx.
    please help me in this..
    Can i use the same traditional NI DAQ VIs with NI PCI 6221??  if so how can I? does this device can be configured for traditional NI DAQ??? 
    Kudos always welcome for helpful posts
    Solved!
    Go to Solution.
    Attachments:
    traditional ni daq vis to daqmx.jpg ‏1857 KB

    NI has several resources to help move from tradtional DAQ to DAQmx. A good place to begin is the Getting Started page. There is a tutorial on how to transition. There is also the compatability VIs that replace certain traditional DAQ functions with wrappers around DAQmx functions. The DAQ example you posted is pretty trivial and really should not take much time to convert once you get a basic understanding of DAQmx.

  • Change traditional DAQ code to DAQmx code

    Dear sir/madam,
    I am in trouble.
    This code is written using traditional DAQ but I want to chane DAQmx version.
    I do not know how to code using DAQmx because traditional DAQ is very different for DAQmx.
    Especially, ' AO clock config.vi' of traditional DAQ is what does this fuction.
    I can not know how to change it.
    Please advice.
    Bill,
    Attachments:
    version.vi ‏21 KB

    Look at Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW

  • Setting output pin to high while counter counts edges - 660x

    Traditional DAQ allowed you to set the output of a counter while it counted, is there an equivalent for daqmx?  The counter output for our current setup spins a motor until the counter reaches the proper number of counted edges from another pulse generator on the board. Perhaps I need to reconsider the setup, but there should be a method to do this action.  I was only able to find an indicator of the output state in the Channel property nodes. Any ideas? Thanks.

    Hello Roth,
    An event is thrown whenever a counter reaches its terminal count, and you should be able to use that to your advantage here.  Once that terminal count is reached, you can use DAQmx properties to set the counter to output a pulse or toggle the line.  If you use this property in conjunction with the initial count property, you can have the counter cound X number of edges and then toggle the output line:
    I hope this helps!
    Thanks,
    Justin M.
    National Instruments
    Message Edited by Justin M. on 06-12-2006 01:05 PM
    Attachments:
    Terminal Count Toggle.JPG ‏11 KB

  • How do I configure a counter to generate pulses using DAQmx?

    How do I configure a counter to generate pulses using DAQmx?
    Is says in the DAQmx C reference help
    "CtrnInternalOutput—The signal at this internal terminal is where the pulsed or toggled output of the counter appears. The output of a counter pulses or toggles when the counter reaches terminal count. When counting down, the counter reaches terminal count when the count reaches zero. When counting up, the counter reaches terminal count when the counter rolls over. To configure the counter to toggle or generate pulses, use the Export Signal function/VI with Counter Output Event as the signal name."
    I've tried this but can't get it to work, I may have the parameters wrong or something. The DAQmxExportSignal() function is very unintuitive to me. Here is my counter config code...
    int ret = 0;
    ret = DAQmxCreateTask("",&task_);
    errorMsg(ret);
    if (ret != 0)
    throw ret;
    // Configure the counter
    ret = DAQmxCreateCOPulseChanTicks( task_, "Dev1/ctr0", "", "/Dev1/PFI8", DAQmx_Val_Low, 0, divider, divider );
    errorMsg(ret);
    ret = DAQmxCfgImplicitTiming( task_, DAQmx_Val_ContSamps, 1000 );
    errorMsg(ret);
    // Change to pulse mode
    ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    errorMsg(ret);
    // Start the counter
    ret = DAQmxStartTask(task_);
    errorMsg(ret);
    The above code works fine, in toggle mode, if I just comment out the DAQmxExportSignal() part.
    HELP!!!
    Stefan

    The problem is due to the DAQmxExportSignal call.  By default, when you create a counter output pulse train task, the driver will automatically set the output of the counter to toggle when the count for each high ticks and low ticks expire.  The driver also automatically routes the signal present at Ctr0InternalOutput terminal (the output of the counter internal to the device) to the Ctr0Out terminal (the I/O pin available externally).  Using the line
     ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    will tell the driver to tristate the Ctr0Out terminal and not output the signal to the external I/O pin.  Using the DAQmxExportSignal function is generally only useful if you want to route the signal to some other terminal internal to the board without having the output show up on the external connector, route the signal to some other external pin other than the default pin, or if you want to have the output show up at multiple locations. 
    If you want to change the output behavior from toggle to pulse, you need to use the DAQmxSetExportedCtrOutEventOutputBehavior function.  However, this is generally only useful if all you care about are edges (not the duty cycle of the pulse train), and you want to generate higher frequency signals.  For example, with a 20 MHz timebase as the source of your counter, you can only generate a 5 MHz pulse train by default.  This is because the minimum value for the low and high ticks parameter is 2 (20 MHz / 4 = 5 MHz).  By changing the output behavior form toggle to pulse, you can generate a pulse train at 10 MHz since the output is now pulsing instead of toggling.  However, the width of each pulse is not programmable so you will no longer have a 50% duty cycle signal.  I don't remember exactly what the width of each pulse is, but I believe it's in the neighborhood of 50 - 100 nanoseconds in width.  I hope this information helps.

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

Maybe you are looking for