Pci-6251 DAQmx reading VI average time

Hi, all
 I am using PCI-6251    I have attached a VI and its profile data, I don’t really understand—the average time of DAQmx Read (Raw 1D I16).vi is 175.5ms, but the  longest is 984.4ms, why the difference is so big? is there a way to reduce the difference?
  Thanks
Lyn
Attachments:
Sava all sample.vi ‏138 KB
profile data.xls ‏130 KB

Hi Lyn,
I have taken a look over the code, there are various VI's that could be running at the same time as the DAQmx Read that your processor may be switching between (e.g. “Divide Data.vi”, “array max and min”). Have you considered implementing a producer consumer architecture? This would allow you to read the data off your DAQ card into a queue and process and/or save the data in another loop.
In addition you are opening and closing your file with every iteration of the loop which will not help the performance of your VI. I would suggest take the “TDMS Open” and “TDMS Close” VI’s out of the loop.
Best of luck with your application.
Kind regards,
Ben L
Field Engineer
National Instruments

Similar Messages

  • Undo file Having huge read average time more than 20ms

    Please,
    I'm working on oracle 10g, windows server 2003.
    From the file I/O stats, I found that the Average read I/O from the undo files is more than 20ms, this contrast with other files where the same I/O metric is less then 0.5ms.
    Can someone give me a clue?
    thanks a lot

    I assume 'undo files' you mentioned means datafiles of undo tablespace: Yes
    How did you determined the I/O metric ? What tools used?, the following script
    column FILE_NAME format a30
    column PHYRDS format 999999,999
    column PHYWRTS format 999999,999
    column READTIM format 999999,999
    column "READ AVG (ms)" format 999.99
    column "TOTAL I/O" format 999999,999
    select
    FILE_NAME,
    PHYRDS,
    READTIM,
    PHYWRTS,
    READTIM / (PHYRDS + 1) "READ AVG (ms)",
    PHYRDS + PHYWRTS "TOTAL I/O"
    from
    V$FILESTAT a,
    DBA_DATA_FILES b
    where
    a.FILE# = b.FILE_ID
    order by
    6 DESC;
    Are other files on the same storage as undo datafiles?, all files datafiles,redo files, cotrol files are on the same storage.
    How are your disk storage configured?, it may be a RAID X technology, because the level is unknown.
    By default our client cannot accept to move the undo file to another storage, that's why all data files are stored on the same drive.
    So what can cause the undo read average time to be so high?
    Thanks again

  • How to run two DAQmx Read (Analog) at the same time?

    I would like to measure a voltage and a current,
    but the two cannot be conbined in one task.
    Therefore, I had to use two DAQmx Read in the same program. But it did not run.

    Multiple channel types can be combined in a single DAQmx Read. One way is to use multiple DAQ Create Channel fucntions. Look at the posting here and the second example at the link in the answer.

  • Running LabView 7.1 with PCI-6251 in Windows 7

    I am very new to Labview, and would appreciate any assistance on this issue.  I was tasked with solving it and while I have made some progress I have now hit a wall.
    A computer with a PCI-6251 data capture card, some custom built (external) hardware and LabView 7.1 has been used for many years for a single, specific task, to do verification testing in a manufacturing environment.  The system works well and no additional features or functionality is required.
    The computer failed and a new one with a PCI card slot was purchased to replace it.  Of course as a new PC it has Windows 7 and hardware drivers for XP don’t exist.  I therefore need to run LabView 7.1 on Windows 7 with a NI-DAQ card.
    I installed the NI-DAQmx 9.5.1 driver and then installed LabView 7.1 (as discussed here).  The driver would not install if LabView was already installed since it gave the “unsupported on this version of windows error”.  MAX recognized the card, which it couldn’t when trying to use the 7.5 NI-DAQ driver.
    Now LabView opens but when I try to run the .vi used for testing it complains of 19 missing sub .vis which I cannot locate and I can’t find on the old computer to try to point LabView towards.
    I think something weird is occurring with trying to use the 9.5.1 driver with LabView 7.1.  Are there any suggestion or is there any advice on getting a PCI-6251 working with Labview 7.1 on a Windows 7 machine?   
    Solved!
    Go to Solution.

    After much greif and trying a half dozen various drivers with various settings and other ideas the following procedure based on Caraval's advice worked first time with no errors and seemingly no functional issues.  The system so far appears to be running in Windows 7 just as it was on Windows XP.
    1.  Install LabView from original install CDs, by opening the folder and right-clicking 'setup.exe' and clicking 'run as administrator'.  Selected 'do not install drivers' during the install procedure.  Rebooted computer.
    2.  Installed NI-DAQmx 8.9 from the self-extracting .zip file available here.  Shutdown computer.
    3.  Removed power, pressed power button to completely discharge power supply.  Installed PCI-6251 card.
    4.  Booted computer, and logged in.  Waited a long time, Windows eventually saw new hardware and installed drivers.  Verified MAX could see card.
    5.  Opened LabView and everything worked.
    Looks like we bought the system a few more years.  Will probably have to upgrade everything next time around though.  Many thanks to everyone who commented on this thread. 

  • How to use counters of PCI 6251 to count the number of pulses

    Hello,
    I have inputs from an optical encoder {pulse train} and i need to count the number of pulses for a short period of time to estimate the speed of the DC motor. Could you please tell me how to use the counters in PCI 6251 DAQ. I found something on DAQ STC, whichs says the input pulse should be connected to PF0 {ctr source}, but i have query where do i get the output {number of pulses counted in a particular period of time}.
    Looking for your reply.
    Thanks & Regards,
    bsnr

    Hi bsnr,
    Thanks for the post!
    In MAX (Measurement and Automation Explorer), if you find the device (DAQmx devices) and right-click, you can select pinouts - which should contain a table telling you which pins are what PFI lines.
    Then, in labVIEW, you need to generate some code to use the choosen coutner in a task to count digital edges. If your not sure on this, go to Help>>Find Examples>>Hardware I/O>>DAQmx>>Counters.. and take a look at some of the code provide.
    ps. It seems (maybe just your wording), but your expecting the counter output pin to provide the number of counted edges - this isn't the case.  
    Please let me know what you think?
    Kind Regards, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Posttrigge​red DAQmx Read output if no trigger received.

    I am running a posttriggered analog voltage input on a PCIe-6251 via DAQmx and I need to know what voltage Labview bins if no posttrigger is received and I set the timeout response to "cancel error on match."

    MikeK,
    I am not sure what you mean by post-triggered. Are you referring to a reference trigger, which keeps a buffer of data so that after it is triggered that buffer of data can still be recorded?
    Please attach a snippet of code.
    If you are in fact using a reference trigger and the DAQmx Read times out and the error is ignored by your error handler, no voltage data should be recorded. If you have this running, you can easily test this by creating an indicator on your DAQmx Read output and verifying that nothing is recorded.
    Best.
    Joey S.
    Software Product Manager
    National Instruments

  • DAQmx: Numerical indicators go blank intermittently using DAQmx Read

    Hello everyone,
    I was wondering if anyone else has ever fought this issue and won.  I have a loop (I will attempt to attach an image of the block diagram) which performs a DAQmx Read operation.  The loop employs a 200 millisecond wait.  The loop scales the data, sends all of the values to little indicators in an array, picks out a few critical values to display on duplicate large indicators, and optionally logs the data by streaming it to disk.  The task will usually (99.9% of the time) be run at 100Hz.  So, I was figuring I could do a "Read All", since at 200 ms of wait time due to the millisecond multiple wait function, I should always have around 20 points to read in the buffer the next time around.  This would allow me to have very current readings in my displays.  I could do a partial read, but then I figure I would have a lag between the displayed values and the reality of what's going on in the test.  Having current readings, as current as can be, is highly desirable for this application.
    I figured everything was good with what I was doing, especially when I tested it with a simulated device (I know a simulated device behaves much differently than a real device, especially at start up).  Everything seemed to work well.  When I go to the real hardware, though, I intermittently get blank indicators.  Actually, it is more like intermittent numbers in my indicators.  Most of the time, the DAQmx Read operation returns a null, empty array (no data available in the buffer).  I must be missing something, because I figured that a 200 ms wait would allow another 20 samples to be collected.
    If someone could please just ease my conscience and let me know that I haven't done something very fundamentally wrong in this code, even if you couldn't help me with a solution, I would very much appreciate it.  I feel that this code should work, keeping data in the indicators at all times, and don't know why it doesn't work.  If you could offer me the solution, even if it is to point out that I did something very wrong, I would much appreciate it.
    I am just writing this code, and still have some icons to make, so the sub VI's still have the default icons.  Sorry about that.  Basically all those do is get array subsets, or scale data, or write data to the data files.  If you need to ask questions about the code, I can understand.  I am not the greatest yet at writing self documenting code yet.  And if you need to know what that event structure does, it watches the two boolean button controls to determine what state in the state machine to go to next, and the time out case of the event structure highlights a data value if it goes out of bounds.
    Sorry if I am too wordy.  I have been accused of that before.  I just notice a lot of "Help!  DAQ doesn't work.  How do I fix?" posts, and I don't see how I or anyone else could help that person at all.
    I am using LV8.2, with DAQmx 8.3.1, on Windows XP, 1GB of RAM, and a fairly healthy Duo core processor.  I have a workaround where I throttle back the read operation, only reading 55% of the available samples, as reported by a DAQmx Read property node (the highest percentage I found that prevents the indicators from going blank).  This introduces a small lag between the real world and the data on display, however.  Also, it seems like a processor dependent solution.  I would have to tweak this percentage for every machine I run this on.
    If I have left anything important out, please let me know, and I will do my best to clarify, and thank to anyone who reads this, and a big thank you to anyone who takes the time to reply.  Again, I would be real happy with a "That code looks good to me, and your thinking is correct", if that indeed is the case.
    Thanks.
    Attachments:
    Log Monitor Block.JPG ‏292 KB

    Yeah, as you and Erik said, just specifying (Sample Rate / 5) as the '# to read' could do the trick.  Then you can ditch the 'Wait (msec multiple)' function.  I don't think I'd recommend the -1 = infinite timeout though.  I'm pretty leery of stuff that can lead to an infinite wait or an infinite loop.  Even a 1 sec timeout should easily be way more than enough.  Note however that this method depends on all your processing code executing in under 200 msec on average.  Otherwise, your reads will fall behind and you'll eventually get a DAQ buffer overflow error.  My earlier suggestion to first query for # available samples and then read the MAX of (# available, SampleRate/5) will prevent cumulative fall-behind effects.
    There's too many unknowns to speculate with any confidence on exactly why the software timing method didn't work.   I can point out some additional things that bear greater scrutiny though.
    1. You've got some sort of function dealing with file streaming that takes a path input and produces a path output.  This probably means that every loop iteration you're using the path to open a file, write data, and close the file again.  This actually may consume more than 200 msec, at least some of the time.  Because this runs in parallel with the msec wait function, something like the following could be happening:
    A. Iteration 1 proceeds as expected.  The DAQ read collects 20 samples, the file write consumes only 100 msec, and the wait msec function ends after 160 msec in order to end on a 200 msec multiple.  The wait function took longest, so your whole loop ends on a 200 msec multiple.
    B. On iteration 2, the wait msec function ends after 200 msec on the next 200 msec multiple.  The DAQ read collects another 20 samples (because it's been pretty much exactly 200 msec since the previous loop iteration started) right away.  However, Windows was busy messing with the file cache so this time your file write consumes 375 msec.  The file function took longest so your whole loop ends 175 msec into the next 200 msec multiple.
    C. On iteration 3, the wait msec function ends after 25 msec on the next 200 msec multiple.  The DAQ read collects 37 samples that have come in since the prior call 375 msec ago.  The file function consumes only 50 msec this time, ending the loop 25 msec into the next 200 msec multiple.
    D. On iteration 4, the wait msec function ends after 175 msec at the next 200 msec multiple.  The DAQ read collects the 5 samples that have come in since the prior call 50 msec ago.  Uh oh, not enough samples...
    One possible fix is to open the file outside the loop and leave it open until after the loop is done.  Opening and closing files has quite a lot of overhead.  Inside the loop, you'd be passing around the file refnum.  Doing this one thing alone might also be a way to fix your timing problem.  Along similar lines, you could write the data to a queue and then do your file writes in an independent loop that reads the data out of the queue.  You can search here for "producer consumer" for more info.
    -Kevin P.

  • Error -200279 at DAQmx read

    Hi i am fairly new to daq in labview,
    i have code which accepts data from 2 devices a PCI 4351 connected to a TBX 68T and PC1 6111S card connected to a SCB68 block. i have uploaded the code.
    when the code is running and then when i press the stop button on the front panel, i get an error of -200279 which is something to do with the daqmx read. I have looked into some other problems that some have faced on this error in this forum, and hence i have tried to increase the rate whilst keeping the number of samples the same but this has done nothing and the same error appears.
    any suggestions will be greatful!
    thanks
    Notay
    Attachments:
    Copy of NI 435x Thermocouple (LEE).vi ‏124 KB

    Well the main problem is you have two different mechanisms to control the speed of your while-loop. First in the upper right hand side of the loop there's a wait until next (100) ms. The second timing method is the read 5 samples in a 1000 Hz stream, this only allows for 20 ms wait time.
    AFter a while your buffer will be full (by the way you don't need to specify the number of samples per channel) and the AI read will generate an error.
    Make sure you end the while loop as soon as the error is generated you don't check inside the while loop which is  a bad thing.
    To avoid this you have to decide how to time your while loop.
    I would set the number of channels to read to -1 (be aware you get 100 samples from the AI read)
    Also replace the 'wait until next ms' with a 'wait ms'
    And check for errors inside the whil e loop
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • PCI-6254 DIO Read - Need to know how to trigger the Read operation??

    Hi,
    Can anyone help me with DIO Read operation using PCI-6254 (DAQmx)??
    here'e the breakdown of the issue i'm having:
    i'm doing a DIO Read using DAQmx drivers, and am using "one channel for each line" on the Port 0.
    i'm using another line for DIO Write at the same time...infact the DIO write sends the bit pattern
    and inturn triggers an external device, and am trying to capture the response of ext. device on
    other line thro' DIO READ...
    now, i do see the bit pattern on the Oscope, but am not reading the bit pattern using DAQmx Read?
    (i'm reading all ZEROS)
    Currently, i'm not using DAQmx Trigger? i tried using it, but was getting an error...
    i guess i need to trigger the read when the line goes high/low (for ex)
    can anyone help me with this?
    Regards,
    rkpat

    Hi rkphat,
    DIO operations on an M Series device cannot be configured for triggers. The source of the DIO sample clock must be set up for the trigger and the DIO operation should just be configured to receive that clock. You must provide an external clock or a clock generated by another subsystem, such as an analog input sample clock or a counter pulse train output, to clock digital operations. For example, if you were going to use the analog input sample clock to clock your digital measurements, you would configure your AI subsystem to receive a start trigger and to use an internal clock. Once the trigger arrives, the AI Sample clock is generated and passed to the DIO subsystem. Or if you wanted to use a counter to generate the clock, you would set the counter up for pulse train generation with a digital start trigger.
    If you post your code we can find out why the Digital Read is not returning the correct data.
    Cheers,
    Lesley Y.

  • Displaying and saving multichannel waveforms using PCI-6221 DAQmx card

    I am trying to obtain voltage readings at 8000 kHz from 9 channels using a PCI-6221 DAQmx card. The waveforms are to be displayed on individual charts while being saved. I have run into problems when I have 4 channels reading in at the same time. The charts stop displaying the data. Since the program will be running within another program where video acquisition is being done, space/buffer size is a very large consideration. If anyone can offer any suggestions about being able to display and save this data without losing seconds of information, the help would be appreciated.
    Thanks,
    Nina

    Hello Nins,
    The first thing to notice is that you are going far beyond the specifications of the 6221 if in fact you are sampling at 8000 kHz. Something I can tell you is that when you are performing fast acquisitions and processing the data at the same time, it is sometimes advised to have an acquisition loop (procucer loop) and a processing loop (consumer loop) and transfer data between the two. That way, you can put a wait in the consumer loop and use a waveform graph to plot the data rather than using a Chart wich requires memory.
    Hope this helps some...

  • Synchronous UART using PCI-6251

    Hello
    I am a beginner using LabVIEW and I need to create a synchronous UART using the PCI-6251, meaning, using one digital I/O to generate clock while another one shifts the data bit-by-bit. It has to work as a master in a half duplex mode. (LabVIEW always providing the clock but data flowing in one direction at a time).
    Could someone help me?
    Thanks!

    Hello, 
    It looks like your application is similar to the one in this forum. However the hardware in the forum is an X-Series in which the digital I/O has a dedicated sample clock and the PCI-6251 is an M-Series which requires you to provide the sample clock.  In order to accomplish what you are describing you will need to create a counter output task to use as your sample clock for the digital output and also to export on a PFI line.  An example of using a counter to correlate the digital output can be found by opening LabVIEW and navigating to Help»Find Examples»Hardware Input and Output»DAQmx»Digital Generation and selecting the Correlated Dig Write With Counter.vi.
    Thank you,
    Justin P 
    Justin
    National Instruments
    Product Support Engineer - Conditioned Measurements

  • PCI-6251 Inter chennal effect is modifying signal.

    Hi all,
    Do anyone knows why we have inter chennal influence fo signal in PCI cards.
    I am using PCI-6251 with BNC-2111, now if i connect cable in chennal 2 and read both the chennals then i am having signal in chennal 2 as well as in chennal one but not of same amplitude. the same thing i found with many other chennals..  I recently bought this setup (in January 2007). and i am new at labview. I am using this BNC connector with NRSE, and if i switch to RSE still no change in signal.
    Can anyone help me in this regards..
    Thank you very much in advance ..

    Hello,
    One of the most common issues with Cross-Talk is a high source impedance. So check your system if the signal you are connecting has a high (approx. above 10Kohm) input impedance. This can cause settling time issues in your ADC. Some more issues and possible solutions can be found in the following KB:
    http://digital.ni.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF?OpenDocument
    I hope this helps,
    Regards,
    RikP - National Instruments Applications Engineering
    Rik Prins, CLD
    Applications Engineering Specialist Northern Europe, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Aquiring a signal using a PCI 6251

    Hello,
         I am trying to write a program that aquires a signal from a device connected to a PCI 6251. The device attached to the PCI is an esophageal lead and it is suppose to read a sine wave being sent through the body. Then I want to filter the signal and send it to a buffer. I do not have a good programming background, and I do not know if I can use LabView Signal Express or a function with in LabView 8.2 to aquire the signal. Any suggestions as to what I should do? Thank you.

    Hi yed1920,
    There are a few ways to acquire the sine wave. You can use a single DAQmx Acquire Step in LabVIEW SignalExpress and this will allow you to configure the acquistion and view the incoming data. You can check out some examples using DAQmx in LabVIEW SignalExpress which are found at C:\Program Files\National Instruments\SignalExpress\Examples\DAQmx on a Windows system. The LabVIEW SignalExpress Help and the LabVIEW SignalExpress Getting Started Guide which are installed with the program may also give you some direction.
    If you choose to use LabVIEW, there are examples which can help you get started. The Example Finder can be accessed through the Help menu. The DAQmx examples can be found browsing by task under Hardware Input and Output » DAQmx. You can check out the NI-DAQmx Help file or the articles found on this page to learn more about certain functions in detail.
    Regards,
    Kent
    Applications Engineer
    Digital Multimeter Home

  • Data acquisition and frequency generation togather with PCI-6251 and LV8.2

    Hi friends,
    I am a new user of Labview. I am using LB8.2 with PCI-6251 .
    I have to generate frequency and then measure the data and then for next frequency and so on.
    i know that for this i have to use looping and that is not a problem. The real problem for measurement is to identify whether the frequency is been generated. if yes then measurements starts otherwise it should wait until it started. then after finishing the measurements send a signal to generator for changing the frequency and amplitude.
    Now these two things {generation and measurement} togather are not working correctly for me. so i make 2 diff file, one for generation and other for measurements <by modifying the examples>. I can run both file togather and it works. But it need lots off effort and time. I have to measure from 10Hz to 1000Hz in 2Hz frequency step and i cannt leave in between .
    can anyone help me how to syncronize these two togather .
    Trying to attatch. both the files here ..
    main_v1.1.vi --> for Measuring
    Oscilloscope.vi --> for waveform generation
    Attachments:
    main_v1.1.vi ‏150 KB
    Oscilloscope.vi ‏37 KB

    Hay thnx dude..
    I found the example and now it works
    once again thanks a lot

  • Does the DAQmx drivers include LVRun-Time Engine?

    Does the DAQmx drivers include LVRun-Time Engine?
    1. I first installed LVRun-Time Engine 7.1.1 on a new PC.
    2. Then i ran the installer once again and selected remove to uninstall the program.
    3. Next I installed DAQmx drivers 8.0.1
    4. After this I tried to run my compiled labview.exe and it works fine(!)
    When I look in control panel - add/remove programs and select National Instruments software and press change, I can see that NI LabVIEW Run-Time Engine 7.1.1 is installed.
    Now why would version 7.1.1 be included in DAQmx 8.0.1?
    Question1: Was perhaps the LVRTE install refreshed by the DAQmx install?
    Question2: Is it not possible to completely remove installed software with the regular uninstall? I am trying to verify the install procedure as it will be on a fresh PC.

    The run-time engine is included with DAQmx. If you look at the distribution, there is a Products folder that has it. My guess is that it's included for something like VI Logger or even the test panels in MAX.

Maybe you are looking for