Reading PCI-6023 counter by Delphi/NI-DAQ

One current goal of mine is to read the counter of an NI I/O board PCI-6023E by Delphi using NI-DAQ driver commands. For Delphi/NI-DAQ *without ActiveX* don't exist any NI examples yet. In VB works the "same" prog fine.
http://www.home.fh-karlsruhe.de/~egra0011/Projects/SIM
What part is in my code "PCI6023E_Counter.pas" missing? Are the NI-DAQ commands/driver working with Delphi?
Thanks.

I am not familiar with Delphi syntax, but you are using the correct NI-DAQ functions and in the correct order. Make sure you are connecting your digital pulse to the correct pin. You should be connecting the signal to the Source of the specified counter. You are using Counter 1, so that should correspond to pin 37 of the PCI-6023E.
Also, the count value returned is not going to be meaningful until your signal has pulsed so that the count will increment. It would be more useful to call the GPCTR_Watch in a loop to see if the count is incrementing when it sees new pulses.
In general, if you are interested in making NI-DAQ function calls instead of using Active X in Delphi, run NI-DAQ Setup and install the Borland C examples. The syntax will be different, but t
he NI-DAQ function calls and programming structures will be the same for your own Delphi code.
Raecine Meza
National Instruments
http://www.ni.com/ask

Similar Messages

  • Reading PCI-6023E counter by Delphi/NI-DAQ

    One current goal of mine is to read out the counter of a NI I/O board PCI-6023E by Delphi/NI-DAQ! But I don't get it work.
    I am interested in having a Delphi code using NI-DAQ commands *without ActiveX components*. At NI support doesn't exist yet any example code in Delphi using NI-DAQ just commands.
    What part is missing in my code "PCI6023E_Counter.pas"?
    http://www.home.fh-karlsruhe.de/~egra0011/Projects/SIM
    The "same" prog in VB works fine! Do the NI-DAQ commands/drivers work with Delphi? Thanks.

    Rawi,
    NI-DAQ provides a function prototype for Borland Delphi, so NI-DAQ function calls should work fine in that environment. Your program seems to be correct. However, you don't state why it's not working, and I've noticed that you don't seem to be checking the iStatus return value for an NI-DAQ error. You might want to check to see if an error is being returned. That could point you in the right direction. If you continue to have problems, I would recommend contacting National Instruments support for troubleshooting assistance.
    Also, the counter/timer developer exchange is targeted towards 660X and TIO-10 counter/timer products. The PCI-6023E is a multifunction I/O board, and in the future, you may want to consider posting your inquiries to the multifuncti
    on I/O exchange for assistance.
    Regards,
    Erin

  • DMA transfer rate for PCI-6602 counter/timer

    I'm strongly interested in raising the DMA transfer rate between the PCI-6602 counter and computer. At the moment, I've got a Pen-4 2.4GHz operating under Win98. I have to move an 80 Megaword array at an ~5 MHz speed. So far, I've been able to reach just 2 MHz. Would it be possible? What is the battleneck here - the soft- or hardware?

    Hello,
    I think the bottleneck you are seeing here is a limitation of the dma transfer capabilities that is dependant on the bus of your PC and not your 6602 card. Here is a link of a knowledgebase that you could try to use to see if that would improve your transfer rates. I still doubt you will be able to achieve approximately 5MHz.
    http://ae.natinst.com/operations/ae/public.nsf/fca7838c4500dc10862567a100753500/1b64310fae9007c086256a1d006d9bbf?OpenDocument
    Regards,
    Steven B.

  • Reading PCI-6071E off by ~.15 volts

    I'm developing a DOS real mode driver for a PCI-6071E card. I've followed the examples in the PCI E Series RLPM and the DAQ-STC TRM, and I can read all 64 AI channels OK. I noticed, however, the readings are off by ~.15 volts (both negative and positive). I ran the NI DAQ software (under Windows 95) to see if it read the same values, but it read the voltage correctly. Surprisingly, after running NI-DAQ and restarting the Win95 machine in the DOS mode, my driver reads the values correctly as well! I assume this means the NI-DAQ did something to the PCI-6071E that I'm not doing in my driver. After power cycling the PC and running my driver again (without running NI-DAQ), the readings are off by ~.15 volts again. I looked through all yo
    ur documentation, but can't find a missing programming step. Do you have any ideas?

    Ray,
    It sounds as though the board is not being initialized properly. More than likely, the calibration constants are not being loaded. You can refer to Chapter 5 of the RLPM to learn more about the Calibration DACs on your device.
    Regards,
    Erin

  • I am using the PCI-6110E/​6111E with the NI-DAQ software version6.7​.Is there a way to record at the same time analog and digital channels?I​f,ye

    s can I have timestamps for each sample?I mean,is there a notion of time information on this board?Finally,is there a way to know ,in the double buffer's case,the number of samples in the halfbuffer which is not full if the acquisition stops by a trigger?.I am using the PCI-6110E/6111E with the NI-DAQ software version6.7.Is there a way to record at the same time analog and digital channels?If,yes can I have timestamps for each sample?I mean,is there a notion of time information on this board?Finally,is there a way to know ,in the double buffer's case,the number of samples in the halfbuffer which is not full if the acquisition
    stops by a trigger?.
    Thank you for your interest in advance

    s can I have timestamps for each sample?I mean,is there a notion of time information on this board?Finally,is there a way to know ,in the double buffer's case,the number of samples in the halfbuffer which is not full if the acquisition stops by a trigger?.PALE wrote:
    >
    > I am using the PCI-6110E/6111E with the NI-DAQ software version6.7.Is
    > there a way to record at the same time analog and digital
    > channels?If,yes can I have timestamps for each sample?I mean,is there
    > a notion of time information on this board?Finally,is there a way to
    > know ,in the double buffer's case,the number of samples in the
    > halfbuffer which is not full if the acquisition stops by a trigger?.
    Start by looking around the examples that ship with LabVIEW (if you are
    using LabVIEW).
    Also look around zone.ni.com for general data acquisition information &
    examples. A good site.
    Mark

  • Lookout driver for NI PCI Timer/Counter Board NI-6601

    Is there any Lookout version 5.0 driver available for the NI-6601 PCI Card? Any built in drive that works?

    There is a PCI card available that works with DAQ OPC, in this case the E-series product line would apply. Many of the PCI-6040E type cards have counters. However, at this stage of development I would recommend for serious consideration using LabVIEW and NI-DAQ. Lookout is a great program for communicating with OPC items. However, for basic to advanced data acquisition, LabVIEW is the optimized solution. All other ways will require more development time.
    Regards,
    Robert Jackson
    Application Engineer

  • DAQmx+6009: Reading the current counter value is too slow

    I have a thread that runs a software loop that I need to run as fast as possible. One of the things I need to do is poll the current counter value from my 6009, and branch if it's changed from the last time I read it. Over 90% of the time spent in my 1.2ms loop is doing this read. My goal is to get the loop under 50us.
    What I really need here is an accurate timestamp (20us or better) for every time the counter changes (up to 1kHz). When I detect a change, I currently get the timestamp by calling QueryPerformanceCounter().
    Here's how I create the task:
        DAQmxErrChk( DAQmxCreateTask("",&taskHandle) );
        DAQmxErrChk( DAQmxCreateCICountEdgesChan( taskHandle, line, "", DAQmx_Val_Falling, 0, DAQmx_Val_CountUp ) );
        DAQmxErrChk( DAQmxStartTask(taskHandle) );
    And here's the line of code that goes so slow in my loop:
        DAQmxErrChk( DAQmxReadCounterScalarU32( taskHandle, 10.0, &count, NULL ) );

    I updated a robot control from a Mac Powerbook with a PCI expansion chasis running Mac OS9, Labview 5 and DAQ to a Mac Mini (intell) with 6009 and 6501 USB cards  running Mac OSX, Labview 8.5, and DAQmx-base.  I have connected wheel encoders (pule train and direction) to a 6009 and a 6501.  It all seems to work, except the tuning of velocity control loops is not as good as before, indicating some delays.  The loops run every 100msec (10Hz update) so I expected a synchronisation problem rather than latency.  I did some measurements today and found that reading the 2 counters and the 2 digital inputs takes over 20msec.
     I get better performance from VISA with a serial to USB converter.  I have a program reading 25byte packets every 20msec.  Although I did run into the USB latency problem with another serial application.  I have a serial device that requires a response t changing CTS (clear to send) in less than 1.2msec, and VISA was taking 1.5msec.
    On the same machine I am reading 1024 samples from an analog input every 100msec with out any timing issues - (once I got the incredibly slow start and stop vis outside the loop - they take about 200msec each.  Taking the start and stop vis outside the loop reduced my loop time from 450msec (approx) to 100msec.  The only problem is that to do this I have to run in continuous mode and can't  use an external trigger (it has to restart on every trigger, so the start and stop vis have to be in the loop).
    So it appears that I have updated my technology by 10 years only to find that USB is incredibly slow - something that is not in any of the NI doccumentation that I can find.  Does NI have any documentation on what to expect in terms of performance from these USB devices and any suggestions on how to get better performance, apart from buying more expensive hardware?
    Thanks 

  • NI PCIe-6351 Count Edges Channel error on fast TTL - Multiple Sample Clock pulses were detected

    Hello,
    I am trying to use a PCIe-6351 to record the arrival times of a fast TTL pulse stream (generated by an Excilitas/Elmer Perkin APD). The TTL pulses are 2.5 volt amplitude, 20 ns duration, with a gauranteed dead time of 50 ns between pulses. I am trying to use the the Count Edges function, with the  100MhzTimebase as the input terminal and the input to counter 0 (PFI8) as the sample clock. After a few seconds of acquiring data at 100 Mhz, the application throws the following error (-201314):
    "Multiple Sample Clock pulses were detected within one period of the input signal"
    I had thought that because there is 50 ns dead time between pulses, multiple pulses would never arrive within a single clock cycle of the 100 Mhz timebase. Is there any way this might not be the case? Alternatively, is it possible that the counter is triggering on some jitter around the edges of the pulses? If so, is there any way to filter such high frequencies without losing the 20 ns pulses?
    I have read through the forums for similar problems with photon detectors, but have not been able to resolve this issue. Thank you for the help.
    Matthew Bakalar

    It sounds like the input signal is being detected as multiple edges.
    The PFI filtering feature on the X Series card likely isn't going to be suitable for you.  The minimum setting is actually exactly 20 ns, which should in theory guarantee a 20 ns pulse passing through.  However, if the signal is high for anything less than that there wouldn't be a guarantee (depending on the phase of the timebase relative to the rising edge of the signal)--considering rise times and that there is evidently a glitch in the signal itself, it probably isn't actually a continuous 20 ns high time by the time the DAQ card sees it.
    What you should do instead:
    Configure a second counter as a retriggerable counter output (single pulse).
    Use your external signal as the start trigger for this counter output task.
    Set the initial delay, high time, and low time for the counter output task all to 20 ns (the minimum).
    Use the internal output of the counter output task as the sample clock source for the original edge count task.
    The counter output will be triggered when it sees the external signal, wait 10-20 ns, then generate a 20 ns pulse.  If there is a glitch on the trigger line during this 30-40 ns that the output is generating, it will be ignored.  The counter output will be re-armed in time for the next pulse given the minimum dead time of 50 ns between pulses.
    Best Regards,
    John Passiak

  • How to generate a pulse waveform 90 deg phas shifted with respect to a pulse generated using a counter in PXI 6070E daq card ?

    Hi
    I ma using 6070E daq. I am generating a infinite pulse train using one of the counters. I want to generate another pulse train which should 90 degress phase shifted with respect to the previsously generated pulse. How to implement this using the counters in the DAQ card.

    Hi Gopal,
    1) yes the frequency generator is programmable. You have 2 timbebases (10MHz and 100kHz) and you can divide down by any integer between 1-16. Those are the only frequencies you can use.
    2) The way counters work is that you can apply a gate signal to the counter which will cutoff the output. Therefore, you can have a second counter generating a pulse train of an equivalent frequency to the frequency generator (fout) but you don't want it to start immediately. You want it to start only after a short delay (equivalent to a 90d phase). Therefore, you need to "gate" or prevent the output on this counter for that small delay period of time. The way you can do this is by using a second counter to create a delayed pulse. You would
    connect the output of that counter to the gate of your pulse train function. That way, during the delay period of the pulse, you won't be outputing your pulse train yet. When the pulse (high-time) of your pulse reaches the gate, then your pulse train will start generating its pulse train (which is consequently delayed by the amount of delay used in the single delayed pulse counter). Since you don't want your pulse to go back low, you will have to turn off or clear your pulse counter while it is high. That way the signal on the gate will remain high forever.
    Your better solution is to use a PCI-660x card to perform this action. You will have more counters which will give you a greater range of frequencies to choose from and you will have more accurate timing of the signals.
    Anyway, hope that clears things up. Have a good day.
    Ron

  • PCI-6503 card and Delphi 6. I can't use Delphi examples using OCX...

    Hello,
    I need to control a led (which simulates a door locking). The original program was in Delphi 3. When I recompile it (without any change), the program simply doesn't work.
    I tried to use the Delphi examples given with the installation, but they don't work either. I found how to avoid the EOleSysError exception, but I can't control anything. However, the system is running normally when I control it directly with the test module of the Measurement & Automation Explorer.
    If someone has an idea...
    Thank you in advance.
    Christophe.

    Hi,
    In order to use the Delphi examples that ship with NI-DAQ, you need to have ComponentWorks installed. Please refer to README.doc found in ...\\NI-DAQ\Examples\Delphi.
    Regards,
    RamziH.

  • PCI-6220 COUNTER (Labview): Does "Sample Source" = "Gate Source"?

    Hello,
    I'm using Labview, DAQmx, PCI-6220 (Counter0).  I connected an incremental encoder signal to the source input of CTR0.  In Labview, the "DAQmx Timing" vi requires that the "source" input be wired.  Does this "source" actually mean the source of the sample clock vs. the "Source" input to the counter?
    Thanks for your assistance,
    Chris

    Chris,
    When you talk about using a DAQmx Timing vi, I assume that you are performing
    buffered event counting or any other task that performs buffered acquistion. 
    You can see an example that performs buffered event counting in NI Example
    Finder called Count Digital Events Buffered - Continuous.  The DAQmx
    Timing vi in this example is used to read the current state of the counter
    into memory at a constant rate.  The source input of the Timing vi in this
    case means the source of the sample clock.  This clock is what determines
    when the counter state is read and stored into a buffer.
    If you are performing event counting, and do not need buffered acquisition (no
    sample clock), you can look at example Count Digital Events.vi in Example
    Finder.  In this example no DAQmx timing vi is used.
    Regards,
    Jesse O.
    Application Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • How do I control the sampling rate of a PCI-6602 counter

    Labview version: 7.1
    Processor: Pentium 4 1.8 GHz
    Hello All,
    I have two avalanche photo diodes connected to two counter entrances on a 6602 (ctr 0 and ctr 1).
    As can be seen in the attached VI, I'm generating a signal on ctr2 and using that as an external clock for the counters.
    My objective is to accurately read the counter values at a rate of ~100KHz (i.e. 0.01 ms between measurements) and to be able to control the rate via the front panel. This should be possible (80MHz timebase), however when I run the program it is only able to actually sample at ~5 ms intervals. Also I'm encountering error 200141 even though I set the rate in the counter to 1M, which should buffer enough.
    What am I doing wrong? Any help would be greatly appreciated.
    Thanks a lot,
    Attachments:
    FRET_ver_14.vi ‏456 KB

    Hello Aadam,
    After looking at your code, I would not use the DAQ assistants to implement this. The DAQ assistant are best to be used for simple acquistion and since you are looking to use more lower level properties of you card, I would suggest to move to use the lower level VIs. It will be easier to understand where the problem is occurring at and will run better than using the DAQ assistant.
    I have done some initial research for you to implement this design. I have described each of them below and how they will assist you.
    The first example I have found is the Change Counter Output Frequency While the Task is Running. In this example, it will show you how to change the frequency and duty cycle of a counter output frequency task. One thing to remember about these counters are that the frequency will not change until the period has finished. For example, if you changed the frequency in the middle of a period of frequency of 1 Hz, it has to complete the 1Hz period before changing it to the next frequency.
    The next example I would investgate is in the NI Example Finder called Correlated Dig Write With Counter.vi. The NI Example Finder can be found in Help » Find Examples... This VI will explain how to use the counter as a clock for another task. You will need to combine the concepts of the first example with this to make sure that you can vary the sample clock.
    Finally, in the NI Example Finder, there is an example how to count digital events with an external clock called Count Digital Events-Buffered-Continuous-Ext Clk.vi. With this example, I first suggest to add the counter task and make sure you can get the external clock to work. After this, I would then implement changing clock.
    Jim St
    National Instruments
    RF Product Support Engineer

  • PCI-1200 counter function/connection

    Hi all,
    If there's anybody out there that is
    familar with the PCi-1200 please help me
    with this.
    Somebody please clearify this for me,
    1)
    The counter function :
    ICTR_Read(devicenumber,ctr,count)
    returns the counter (count) value to
    the caller whenever there is a pulse to the CLK input pin , is this true?
    2)
    What is the relation of the counter
    value with the clock frequency or the
    pulse input?
    3)
    If I leave the gate input not connected to anywhere, will it be consider
    always High?
    That's all I can think of right now, if
    you think there is anything else that I
    should know please tell me also.
    Thanks!
    Regards,
    MK. Tan

    "Tan" wrote:
    >>Hi,> >Does anybody know what daq fuction that performs >the task of sending
    a binary patern to the digital I/O port.> >Example: >If I what do sent 1
    to PA0 , 0 to PA1 and 0 to PA2 simultaneously,>Is there a function that do
    that?> >Thanks.
    Hi Tan,
    First, use "status = DIG_Prt_Config (deviceNumber, port, mode, dir)" to configure
    the ports.
    Use these arguments:
    devicenumber: as specified in the measurement and automation explorer
    port: 0 ( PA)
    mode: 0 (no handshaking)
    dir: 1 (standard output)
    Then, call "status = DIG_Out_Prt (deviceNumber, port, pattern)", with
    devicenumber: as specified in the measurement and automation explorer
    port: 0 ( PA)
    patt
    ern: 10000000 (binary)
    See NI-Daq help index -> 1200 Series Device Function List ->DIG_Prt_Config
    / DIG_Out_Prt
    for more info.
    In LabView:Tthe VI's will probably also be called something like"DIG_Prt_Config"
    and
    "DIG_OUT_Prt". Enter these same arguments into the VI.
    Hope it helps,
    Walter

  • Unable to acquire 4 channels (2048 samples to be read).PCI 7030/6040E

    I am using the PCI 7030/6040E DaQ card (Labview 6.1, Windows 2000,Pentium).I want to acquire 4 channel data (2048 samples from each channel)at 6.5kS/s Sampling Rate.When I do this using AI Acquire Waveforms.vi the program gets stuck.When I use continuous buffered acquisition using intermediate VIs, then data over write error occurs.(I am taking FFT of the data and plotting the data as four Waterfalls using Intensity Chart.).It says that you are not reading data from the buffer as fast and so overwriting occurs.How can I solve this problem.Can I get data at this rate using this card ?If so,what should be the buffer size etc? (I want continuous acquisition).

    thanks.i am attaching the code,Buffered.vi and non_buffered_ni.vi.both does not work.the second one gets stuck and the first one gives some overwrite error.Actually what I want is the first one,buffered.vi,because I want continuous acquisition.the second one i have tried to see whether it will work.as i have told,i want a sampling rate of 6500 samples/sec and i want to take 2048 samples from each channel to take FFT and plot waterfall.hope this gives a clear picture.
    Attachments:
    Buffered.vi ‏183 KB
    non_buffered_ni.vi ‏148 KB

  • Read duty cycle of a PWM with DAQ

    Hi,
    I am doing a test system and I have several signals that control motors. They use PWM with a max frequency of 5 kHz.
    I would like to know if with a USB DAQ or a PCI DAQ for example PCI-DIO96 could I meassure the duty cycle of these PWM signals. I mean I need to meassure with 10kHz at least.
    Which are the read frequency of these systems?
    Due to the high number of I/O to test I am also thinking of using Compact-RIO with different I/O modules. What do you think?
    Thanks in advance

    If your PWM frequency is 5 kHz and you want to measure duty cycle to 1%, then you need timing resolution of 2 microseconds or faster.
    The USB-6343 has hardware timed DIO at up to 1MHz, so it might be suitable.  There are other devices with hardware timed DIO at rates of 10 MHz or faster as well.
    Before you buy, determine how often you need to measure the duty cycle to make sure the data transfer can keep up.  USB can sometimes be a bottleneck.
    Lynn

Maybe you are looking for

  • Windows 8.1 on X301

    Hi Everybody, I installed Windows 8.1 RTM on my X301. I managed to have all perepherics to work, only one which is the qualcomm module and GPS. Can anyone help me on this? Thanks

  • Second hand ipad locked to unknown previous owner

    hi,i bought a second hand ipad 4,but it is locked with the previous unknown users id,is there anyway of resetting the ipad back to factory settings.many thanks

  • My system boots normally only half the time

    Hello, I've been trying to properly boot all day and nothing has worked. Symptom: Boots to a blue screen no pinwheel or anything. It froze while working, the pinwheel and everything froze. So I turned it of and on. Now it won't boot normally. The onl

  • Need Report for batch wise consuption

    i need the coding (program) for batch wise consuption report,,, output fields are Posting date, batch number, quantity, mfg date, exp date, next inspec date, order no(po) , product name, batch no quanty issue. i want the logic after retriving the dat

  • No tabs are showing when only one window open. How do I open a new tab?

    Just upgraded to latest version. When only one window is open, no tabs show across the top. If I have two tabs open, both show across the top, but go to no tabs if I close one of them. And, the + sign is available for opening a third tab if at least