Multithreading and daq acquisition

I�m trying to run 2 DAQ�s (PCI MIO 16 XE) devices in one PC (Win XP) to acquire N-data samples from 5 AI channels each using LV 7.0. For the acquisition to starts, each device is independently triggered (5KS/s) . It works fine and I can get the data. The problem is that the second DAQ starts the acquisition probably only after the first has finished its acquisition. (I cannot be sure about that because actually I do not know how to get the start time of an acquisition). At least the DAQ�s are starting the acquisition at different times and this could be a problem if the time difference is to big( >500 micro seconds).
1. is this a classical Multithreading problem? Is there a solution?
2. how can I assure that both DAQ�s start
the acq. nearly at the same time?
3. how can I get the start time of the Acq. ?
4. if I have to use 4 DAQ�s on one PC will this work? Known problems?
Thanks
Alberto

Let me try to explain my problem using the DAQmx example VI �Cont Acq&Graph Voltage-Ext Clk- Dig Start.vi�.
Making few changes to the above VI, you can use it as a Sub-Vi. ( I also limited the number of scans to 1000). I used 2 PCI MIO 16XE-10 devices and wrote a program using two of this sub.vi. I used one trigger signal and one clock for both devices and scanned the same channel. As input I used a Sinus voltage. After the program runs, If I plot the obtained data time independent, i.e the x-axis is now the scan number rather than time (relative or absolute) I get a shift in the signals of about 90 clocks, this means that for example, the scan position for the max amplitude came for one device 90 clocks later than for th
e first device. This is unacceptable for my application
In other test , If I just did copy the block diagram of the example in a new VI twice and made the necessary changes (trigger channel, channel names, etc). Now I got NO shift in the Graph. Both sinus waves were exactly the same. But I still have no idea about the difference on the start time of both devices. I suppose, in this case both devices started at the same time. But how can I be sure of that?
Without the possibility of using that Sub-Vi�s and because I have to use 1, 2 or 4 devices selectively, my program will be looking very complicated. I�m sure there must be a better way to solve this.
Thanks

Similar Messages

  • Transferring DAQ acquisition data via TCP/IP

    Hi all. I am trying to write a program which shares the raw data acquired from a DAQ acquisition device to several computers at the same time. I am using a NI-USB DAQ 6251 to acquire 2 channels of data at 200kS/s on each channel. I need to send this data to other computers in a network so that the each computer can perform different functions on the signal.
    Anyone who has done something similar before? Can you help to advice on how I can go about doing this efficiently and reliabily? I cannot afford the data to be lost during the transfer. I did try using shared variables but it did not work well.
    Thanks in advance.

    Hi K.P,
    I hope you are doing well today! The following links should help you get started. If you face any other issues, please be sure to let us know.
    Using the LabVIEW Shared Variable and OPC With NI-DAQmx
    Shared variable to grab data from remote PC with DAQMX
    Message Edited by Adnan Z on 04-12-2007 10:29 AM
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How can I configure NI PCI 6221 and DAQ SCB-68 for pressure sensors?

    Hello
    everybody,
    I am using the measuring board (NI PCI 6221) and DAQ
    SCB-68 for the data acquisition.
    With the DAQ-Assistant I created AI for the voltage of
    pressure sensors. In a big indicator panel from this DAQ-Assistant I see the
    voltage for both sensors in the correct size. But if I set sensors in the
    blockdiagramm to control the signals for sensor one I get a wrong voltage size
    and for sensor 2 nothing.
    How can I configure this data acquisition equipment to
    get the correct signals?
    Thanks a lot for your help.

    I do not know the type of sensor you are using. But pressure transducers may have a very low output voltage(in the mVolt range). They also need an excitation voltage. Here is an introduction. http://focus.ti.com.cn/cn/lit/an/sloa034/sloa034.pdfThen working with pressure sensors I always use 3 stages in the circuit.
    1 Instrumentation Amplifier as a preamp
    2 filterstage
    3 Final amp and output buffer
    (you may combine stage 2 and 3)
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Synchronizing serial and daq data

    Hi,
    I'm attempting to acquire simultaneous data from a serial port and a NI USB-6211 board.
    I wish to write the data simultaneously and at every second.
    At first the I couldn´t acquire the data as i wanted because there were delays in the acquisition, but then I separeted both serial and daq in two loops and it was solved. However now I can´t manage to write the data simultaneously into the file.
    Any Ideas?
    Thank you.
    Solved!
    Go to Solution.

    Would it be possible to post your code?
    You could sync your loops with a "wait until next ms tick with a value of 1000.  This would cause both loops to execute once ever second at at the same time.
    It sounds like you now have a problem of writing the data to a file at the same time.  You could put for file write in a third loop and transfer your data from the other two via queues or functional globals and then write to the file when both peices of data are ready.
    Gregory Osenbach, CLA
    Fluke

  • Synchronization between counter and analogue acquisition

    To whom it may concern,
    I am developing a data acquisition in C# using DAQ card PCI-MIO-16E4, to acquire analogue and encoder readings.  However, the Analogue and Counter Acquisitions must be synchronized together through an internal clock.  I tried to create two tasks one for analogue and another for the counter.  Analogue channels and Counter to acquire pulses from the encoder (as up/down counter) were set accordingly.  The analogue timing was set to generate a particular square wave to be used as the sample frequency.  The timing for the counter task was set to be as “ai/sampleclock”.  Both tasks were started by calling the respective BeginReadMultiSample, with a separate asynchronous call back function.  The call back functions are called when the required samples were acquired, and will retrieve the respective samples by call the respective EndReadMultiSample.  The problem is that sometimes incorrect data is acquired.  Can someone help me in solving this problem or provide a working example with the minimum requirements?
    thanks in advance
    djg
    Message Edited by djgrech on 11-01-2005 12:24 AM

    Hi Tom W,
    Thanks for your email.  Well what I meant was that the counter and analogue data does not always seem to synchronize (there is a shift in the graphs, or the data is just erroneous).  This is not constant, so I am assuming that the acquisition is not well synchronized.
    I am attaching the code with this email; I am using counter 0 as the sampling frequency, counter 1 connected with the encoder for displacement acquisition (up/down counter), and analogue channels acquisition, in this particular case two.
    Is there a work around of how one can implement the sampling frequency to be internal?
    Thanks for your assistance
    djg
    PS good day
    Message Edited by djgrech on 11-02-2005 12:20 AM
    Attachments:
    AcquisitionForm.zip ‏12 KB

  • Synchronisation of frame grabber and DAQ board

    I want to aquire images and analog voltage signals at the same time, and synchronised, using a NI PCI-1428 Camera Link frame grabber and a NI PCI-6014 DAQ board. Can this be done using the RTSI trigger functions? I know that the frame grabber supports this, but what about the DAQ board?
    How about synchronising a NI-board with a non-NI frame grabber?
    Thanks a lot!
    Peter

    Hi, Peter,
    No, the PCI-6014 DAQ board does not support RTSI. However, most of the low-cost E-series NI data acquisition cards do support RTSI, such as the PCI-6024E or PCI-6036E, so you might consider using one of those boards instead.
    If you decide to go that route, there is a useful tutorial that describes the signals that can be routed over RTSI for NI DAQ and IMAQ boards:
    Developer Zone Tutorial: Synchronizing Motion, Vision, and Data Acquisition
    as well as several example programs:
    Developer Zone Example: Integra
    ting IMAQ and DAQ with Single Display
    Developer Zone Example: Low-level Triggered Ring (with DAQ-supplied triggers)
    As for a non-NI frame grabber, that would really depend on what support the frame grabber has for timing and synchronization. You could route a trigger signal or scan clock out over the PFI pins on the PCI-6014, but you would need to see if the frame grabber is designed to receive these types of signals.
    I hope that helps!
    Best regards,
    Dawna P.
    Applications Engineer
    National Instruments

  • FPGA and DAQ card synchroniz​ation

    Hi, we are controlling and acquiring data from multiple hardware devices (including translational stages and photodetectors). Until last week, we used to peform all control and acquisition using a PCIe 7852R FPGA board. However, we decided to switch the acquisition part to a PCIe 6363 DAQ card to improve the voltage resolution. During testing, I found that the internal clocks in the FPGA and the DAQ cards are slightly mismatched (not just a phase delay, but a difference in time-period).
    I know this because I generated a square wave (period = 20us) using the FPGA and acquired it using the DAQ card (at a rate of 200kHz, i.e., 1 sample every 5us). I observed that the acquired square shifts by 5us every 5 seconds or so. Such a shift does not occur if the generation and acquisition is done using the same board. Therefore, the only explanation is that the clock frequencies of FPGA and DAQ cards differ. According to my calculation, percentage difference between their clock times must be 5us/5s = 0.0001%. 
    Therefore, I am wondering if there is anyway to synchronise the clocks between them. Or, is there a way I can drive the DAQ device based on the FPGA clock, or vice versa? Also, please let me know if there is something trivial that I have fix.
    Thank you very much.
    Regards,
    Varun
    Solved!
    Go to Solution.

    Hi GerdW,
    Thank you for your reply. 
    I understand both solutions you have suggested. I had conceptually thought about the first one (to control the sampling rate). However, I still haven't figured out how to accurately generate a 200kHz square wave - I think I can figure that one out this morning.
    However, I am unsure how to implement the second option. I presume the default internal clock inside the DAQ is running at 100MHz or so. Therefore, inorder to obtain the same performance while using an external clock, I would have to generate at least a 80MHz TTL clock-out from the FPGA. Could you please tell me how I can do that? I couldn't find any clock-out capabilities on my FPGA. Or would I have to generate a clock of my own using Single-Cycle-Timed-Loops?
    Not only did you provide two different solutions, your reply suggested that I wasn't wrong in interpreting that the clock periods of our FPGA and DAQ must be slightly off. 
    Thank you very much.
    Regards,
    Varun

  • Simultaneous Video and DAQ Start

    Pardon my ignorance in the signals world, but I'm having a hard time trying to simultaneously start a video camera and DAQ hardware.  Hopefully someone can provide some insight.
    I will be using a standard camera that accepts triggering and a cDAQ chassis.  I know that I need to use DAQmx for the DAQ (I have a lot of experience with this), but I've never done triggering before in DAQmx.  How do I perform triggering with DAQmx to send the camera a TTL signal to start taking video?  What hardware will I need to send this signal?  Thanks in advance.
    Nathan - Certified LabVIEW Developer

    Nathan,
    What kind of camera bus are you using; USB, FireWire or GigE? Are you able to acquire images with your camera in Measurement & Automation Explorer (MAX)?  Here is a link to a community example that Grabs and Saves to AVI using IMAQdx.  If the camera has digital i/o lines to accept the TTL signal pulse you can run the example I've linked to and configure it for a triggered acquisition in MAX.  The camera's user manual should specify which pins are trigger lines or whether a specific i/o cable are terminal block is necessary.  If the camera supports triggered acquisition you can go into MAX select the camera under Devices and Interfaces the select it's Camera Attributes Tab.  There should be an attibute called "trigger mode" and its default setting is off so you would need to turn it on.  If there are multiple trigger lines, you would need to specify the "trigger source" under its allotted attribute.  Some cameras can only trigger the start of an acquisition while others can also trigger each frame acquisition.  You can specify whichever you'd like under the "Trigger Selector" attribute.
    Once the camera is configured to trigger I would have it perform its image acqusiition in it's own loop as in the example I linked then have the DAQmx tasks perform the data acquisition in a separate loop.  Then all you would need to do is synchronize your data acquisition to a single pulse generation task and wire the pulse output to your trigger line.  If you wish to control the acquisition of each frame you would need to generate a pulse train to the desired frequency for you application, however you would need to be cautious of the cameras limitations on how many frames per second it can acquire at.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    Take a look at this document that discusses how to monitor IMAQ memory usage:
    http://digital.ni.com/public.nsf/websearch/8C6E405861C60DE786256DB400755957
    Hope this helps -
    Julie

  • Strange IMAQ Error Message: "ni: A frame has been dropped and the acquisition has been canceled."

    Hello,
    I am getting a strange error trying to use the NI PCIe-1427 with the MATLAB image acquisition toolbox configured with continuous acquisition.  After about 5 minutes of acquisition, I get the error below:
    ??? ni: A frame has been dropped and the acquisition has been canceled.
    Does anyone have any clues as to why I am getting this error / where I can find out what causes it?  I need to acquire several hours worth of data and this error completely aborts my acquisition.
      --Y

    Hello,
    Turns out that I found the problem.  I had a slow memory allocation in my MATLAB code and this delay allowed too many frames to be accumulated in memory.  I still do not know the source of the exact text of the error, but upon removing the slow memory allocation the error no longer occurs.  I believe that it may have resulted from a buffer overrun of some sort in the underlying driver.
    Given that this no longer poses a problem for me, I will not pursue it further.
    Thank you for your help!

  • I want cRIO to start and stop acquisition with push of physical button on cRIO, is that possible?

    When using my cRIO 9024 on the field, I prefer  to be able to start and stop acquisition with push of a physical button on cRIO. 
    I mean I don't want it to be "as start-up," I don't want cRIO to start acquisition as soon as the power is supplied. 
    Is that possible?
    Solved!
    Go to Solution.

    Hi Cashany,
    you surely can read that switch status. But there are easier (but more expensive) ways to switch a button. Fiddling with a pen or small screwdriver to switch USER1 isn't what I call "user friendly"...
    - You have atleast 2 voltage inputs on your module available. Use a switch to supply voltage to those inputs. Use a "real" button!
    - You have a serial port available. You could set some pins to GND or voltage and check their status inside cRIO/RT target...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Start and stop acquisition using a pulse train

    Hi
    As illustrated in the attached picture I would like to use a pulse train ( connected to PFI line) as a triggering devide to start and stop acquisition on rising edge
    Could you please help me to do it in LabVIEW. My problem is I have to use the same line to start and stop ( trigger and reference trigger ) and both should use rising edge
    Thanks
    Attachments:
    pulse train.jpg ‏33 KB

    tintin_99 wrote:
    I greatly appreciate help on this. How can I use a pulse train to start and stop data acquisition on rising edges as described in attached picture.
    Have a look here
    CLA, LabVIEW Versions 2010-2013

  • Spectrum analyzer with sim and DAQ IV File

    Hello..
    i have a project that i need to design a Spectrum analyzer with simulation mode and DAQ option. ( so you can generate input signal from LabView and DAQ.
    all i look for is a modern Spectrum anlyzer VI file for reference and education purposes
    i know there are examples out there in LabView but, i need a modern one with a lot of options and features ( like Impulse respond, marker... filters.....)
    there is something i found here on the website, it happen long time ago, and some proffessor from Vietnam created such project. its not with DAQ, but its great for me.
    here is the link:
    http://digital.ni.com/worldwide/singapore.nsf/web/all/42B390E4624228D486257249001A5349
    this kind of Spectrum anlyzer looks great
    most appreciate for any help

    Hi Eldad,
    Thanks for posting and welcome to the NI forums!
    The
    application you have linked uses LabVIEW to control a Tektronix TDS220
    over RS232 (a.k.a. serial port).  The TDS220 has a 1GHz sample rate
    with a 100 MHz bandwidth--the specs on our DAQ devices don't go nearly
    this high, our High Speed Digitizers
    would be a better option if you need something comparable.  Also, the
    programming of the two devices (TDS220 vs. DAQ) is going to be quite
    different, so I am not sure how helpful the code from the link would be
    for your application.  I don't have access to the code or permission to
    post it here, but you could always try contacting the original author
    (his contact info is in the link you provided, not sure if it's up to
    date or not).  Again, I'm not really sure how helpful the code would be
    for you.
    You might want to take a look at the following example to see if it does what you need:
    NI-DAQmx: Benchtop Spectrum Analyzer
    There
    are also numerous examples that are installed with the DAQmx Driver to
    help you get started with the API.  You can access them from LabVIEW by
    going to:
    Help >> Find Examples... >>  Hardware Input and Output >> DAQmx
    There
    may not be a ready-made example that will do everything that you
    require, but the above should give you a good starting point for
    implementing the necessary features yourself.  If you run into any
    specific issues while trying to program, please don't hesitate to post
    to the forum and we'll be more than happy to help out.
    -John
    John Passiak

  • How to measure the resistnace of wire without any current input by lab view and DAQ-9172

    i want to measure the resistance of the SMA wire without any current in put by LAB view and DAQ-9172 any body help me

    You could measure the time constant of a resistor/capacitor series circuit. Basic electrical engineering: http://en.wikipedia.org/wiki/RC_time_constant

  • Driver Aeroprobe for MAX and DAQ

    Hi eveybody
    I am currently using a ATX4K-7 (AEROPROBE) computer, but I'm looking for making a connection between the CPU given by Aeroprobe and DAQ from LabVIEW.
    This CPU is used to sense 7-hole pressure probe. And I want to use LabVIEW and DAQ to get speed plots
    However, when I try to find a driver to install in LabVIEW, the different choices does not include Aeroprobe  (or Althen).
    Could someone give me the choices to do, so I can find the right driver to download? or is there a driver that can be used for several CPU.
    Thank you in advance
    Kind regards

    Check with the vendor to see what they might have. Otherwise, you will need specs on the communication interface and then write your own driver.
    p.s. How is this related to NI Academic products or did you post to the wrong board?

Maybe you are looking for