Synchroniz​e IMAQ1394 DAQmx

Dear frds,
I am trying to synchronize image acquisition (input) and Piezoelctric transducer (PZT) motion (output) through labview. However, i have no clue how to go after it.
My camera is DMK21BF04 with external trigger allowing only mode 0 for triggered acquisition  It is a IEEE 1394 type. The PZT motion is controlled through labview using PCI6024E. The motion of this transducer will change the shape of the object viewed by the camera. I want to capture that change at the moment it happens. The change is continuous since i am ramping the PZT. I would like to capture this continous change using the camera and want it to be synchronized.
Looking forward for your suggestions and advices..
thank you in advance

Hello Shiju Ul,
thank you for your forum post. I did found a tutorial about synchronizing audio and video through a IEEE framegrabber, a DSA card and a E series DAQ card. I hope that this information is usefull to you just for reference; http://zone.ni.com/devzone/cda/tut/p/id/6432
Best regards,
Martijn
Martijn S
Applications Engineer
NI Netherlands

Similar Messages

  • How to synchronize two NI9215 DAQmx cards?

    Hi there,
    I'm using two NI9215 DAQmx cards (4ch simultaneous sampling analog inputs) in a chassis type cDAQ-9174.
    Since I need to aquire 8 channels simultaneously I've two NI9215 cards.
    My question is how do I configure these cards to be synchonized?
    I'm using LabVIEW2009 SP1 Dev. Suite
    Thanks for answers!
    Solved!
    Go to Solution.

    One of the beautiful things about CompactDAQ is that you can put multiple modules of the same time (Analog, Digital, etc.) into the same task and they are automatically synchronized.  So, to synchronize the two modules, create one Analog Input task and reference the channels as "cDAQ1Mod1/ai0:3, cDAQ1Mod2/ai0:3".  This will automatically synchronize the two modules together.
    Seth B.
    Staff Test Engineer | National Instruments
    Certified LabVIEW Developer
    Certified TestStand Developer
    “Engineers like to solve problems. If there are no problems handily available, they will create their own problems.”- Scott Adams

  • Counters synchroniz​ation in daqmx

    Hello Everybody,
    I'm rewriting custom software in LabView from DAQ to DAQmx. I have the following problem:
    I need Ctr0 (at low frequency) to trigger "packets" of pulses on Ctr1 (that operates at high frequency). I'm using Pause,Trigerr option on Triggering node. Since pulse trains on the Ctr1 and Ctr0 "drift" with respect to each other that causes idle state of the Ctr1 oscillate between 0 & 1 - depends in what state it was left after Ctr0 pulse.
    Does anybody have any idea how to overcome this problem?
    I tried to synchronize start of both counters by triggering them from the pulse of the third counter but it does not help. Also, it is impossible to use Start.Trigger opting  with Pause.Trigger optin on the same counter.
    Here is a VI that demonstrates the problem.
    I'm using NI 6052 board with 2 counters. Ctr0 Out is wired to PFI4 (Ctr1 G)
    Thank you in advance.
    Pta.
    Attachments:
    IdleStateDrift.vi ‏37 KB

    Ok, it seems that I fixed the problem.
    In case it will be useful for the others, there is a solution:
    If you are trying to replicate Finite Pulse Train Int (DAQ-STC).vi in DAQ/Examples you need to use just one counter in DAQmx in Finite/Retriggerable mode. It eliminates necessity of 2nd counter and Pause Trigger option so there is no problem with counters drift.
    I have wasted several days of my time on this simple task.

  • Sampling local variable and synchroniz​e with DAQmx

    Hello, 
    I made a small change in the set-up I used with labview and now when I wanted to change the code I'm having a rather complicated problem.
    In my old set-up I was measuring three variables: x and y with a QPD and the power of a laser with a power detector. I was using the DAQmx and I was getting a matrix with three columns with n (sample rate) values. Now, for various reasons I had to take out the second detector. So now I want to build the same matrix as constructed before, but instead of putting the measured values of the laser power I want to put the theoretical values (they are in a local variable) as I cannot measure them. The problem is that this local variable, in general, changes during the DAQmx acquisition time and I would need to sample it at the same rate as I acquire the data from DAQ and then combine all them. How I could sample this variable and attach it to my DAQ results? DAQmx doesn't accept local variables.
    Thanks

    A local variable is not something standalone. It is always associated with a control or indicator. Hows is it updated?
    From your description, it is not clear what you are doing. Can you show us some code instead?
    (Also be more clear when using acronyms. QPD cound mean many things)
    LabVIEW Champion . Do more with less code and in less time .

  • Synchronize PCI- 5421 and PCI-6602

    I am using a PCI 6602 to generate four pulse trains. I am also generating a signal with a PCI 5421 AWG. All signals are started at the same time by using a common start trigger. The problem I am having is that after they run for a while the 6602 and 5421 signal start drifting. I know in the past I had sync clocks in a PXI chassis but I am unsure how to syncronize the clocks using PCI card. I do have an RTSI cable linking the cards together so could someone please give me an example of how to sycronize these cards in Labview (8.2)

    Hello Kiebach,
    You seem to be connecting the signal correctly in your NI-DAQmx program. However, I do not see any NI-FGEN code where you import the signal to be used as an external clock. Have you added this code? I think you would benefit from examining the example program entitled "niFgen_DAQmx_Synchronization_Example.vi". This program shows how to synchronize an NI-DAQmx device and an SMC Arb device. You can find the example by opening the NI Example Finder utility; you can open this utility from LabVIEW by going to the Help menu and selecting Find Examples... Once you have opened the NI Example Finder, you can navigate to this example by selecting the Browse tab and going to Hardware Input and Output>>Modular Instruments>>NI-FGEN (Signal Generators)>>Synchronization. You will notice that this example uses the Export Signals VI rather than the Connect Terminals VI. To help understand the difference between these two, you may want to examine this document.
    Matt Anderson
    Hardware Services Marketing Manager
    National Instruments

  • Trying to read multidevic​es in an array of tasks

    Hi,
    Because of getting this error: "One or more devices do not support multidevice tasks.", I am trying to use an array of tasks to be able to read multiple devices, as suggested by GregFreeman in the following link:
    http://forums.ni.com/t5/LabVIEW/One-or-more-device​s-do-not-support-multidevice-tasks/td-p/2608285
    But the problem is that I still get another error, which is :
    NIDaq Error  in DAQmxStartTask code -89121 Destination terminal to be routed could not be found on the device.
    Here's my code:
    for (int i = 0; i < nCh; i++) {
       niStat = DAQmxCreateTask (tName, pTH);
       niStat = DAQmxCreateAIVoltageChan(*pTH, chanName, "", myConfig, rLo[i], rHi[i], DAQmx_Val_Volts, NULL);
       niStat = DAQmxSetAIRngLow(*pTH, chanName, rLo[i]);
       niStat = DAQmxSetAIRngHigh(*pTH, chanName, rHi[i]);
       niStat = DAQmxCfgInputBuffer (myTasks[t], (int) sampRate);
    niStat = DAQmxCfgSampClkTiming(myTasks[0], "", sampRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, sampRate);
    for (int t = 1; t < nTasks; t++) {
        niStat = DAQmxCfgSampClkTiming(myTasks[t], "PFI1", sampRate,DAQmx_Val_Rising, DAQmx_Val_ContSamps, sampRate);
    niStat = DAQmxExportSignal(myTasks[0], DAQmx_Val_AIConvertClock, "PFI1");
    for(int t = 0; t < nTasks; t++) {
        niStat = DAQmxRegisterEveryNSamplesEvent(myTasks[t],DAQmx_Val_Acquired_Into_Buffer,buffSamps,0,Eve​ryNCallback, NULL);
    for(int t = 0; t < nTasks; t++) {
        niStat = DAQmxRegisterDoneEvent(myTasks[t],0,DoneCallback,N​ULL);
    for(int t = 0; t < nTasks; t++) {
        niStat = DAQmxStartTask(myTasks[t]);
    I would be very grateful if you could help me. 
    Thanks.

    Hi,
    The 9223 cards do indeed not have a PFI i/o line, so trying to export the signal to that task would be likely to be causing this error in this case. The canonical method to synchronise the Analog Inputs for these modules is for them to share a common timebase off the cDAQ analog input clock, and a common start trigger so that they start acquisition at the same time.
    There is a good example on the NI website of synchronization features in DAQmx which I have linked below for you:
    http://www.ni.com/white-paper/4322/en/
    Best Regards,
    James Kent
    James Kent | Applications Engineer | National Instruments UK & Ireland
    w: uk.ni.com | ireland.ni.com

  • Triggering and simultaneous measurements

    Hi everybody 
    I've written a Vi to to acquire data simultaneously from 7 devices. I'll be using cDAQ9178 with NI9203. The vi will acquire current values 4 to 20mA. Could you please check the attached file and let me know if I need to improve it.
    I have some question and I should be grateful if anyone can help me to answer them.
    1. How to open the binary file from write to measurement file by EXCEL?
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?? I was thinking about notifiers but I don't know how to use them ?
    Sorry for asking to much  I really in urgent need of all of this. I should finish my data acquisition system by Tuesday 
    Best Regards 
    Solved!
    Go to Solution.
    Attachments:
    triggering and simultaneous measurements.vi ‏97 KB

    1. How to open the binary file from write to measurement file by EXCEL?
    If you select TDMS as the file format in the write to measurement file, you should be able to open it directly from Excel if you install the TDMS Excel Add-In. Be aware that at 1kHz data rate, you will exceed the capability of old versions of Excel to read the entire file in about 65 seconds. Newer versions can read more, but anything over a couple thousand points gets difficult to analyze. That is about my limit. Over this, I go to something else for analysis, such as LabVIEW or Mathematica.
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    The write to spreadsheet file is very inefficient for data logging and cannot be recommended. Given your data (an array of waveforms), TDMS is your best bet. The write to measurement file Express VI is the easy way to do this. I, personally, prefer the control I get from using the TDMS API directly. Note that under the hood, the output of the DAQ Assistant is an array of waveforms with individual t0s and dts. The t0s are all different due to the fact that your 9203 is a scanned device, not a simultaneously sampled device. It scans at 200kHz, so the differences are not large, but they are there. I would convert the DDT into an array of waveforms, then use the native TDMS API, but I have a lot of experience. Since you are in a hurry, the Express VI using TDMS is probably your best bet.
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    That should work fine. Given your continuous acquisition, the trigger will only start the acquisition, not gate it or trigger it at later times.
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?
    We do not have enough information to answer this question. Specifically, how is the valve being triggered (boards being used, hardware interface, software interface). The ideal way would be to run it through the same cDAQ 9178 so that it can be synchronized through hardware. Software synchronization cannot be guaranteed better than about ±50ms. Read up on how to synchronize things through DAQmx and you should be good.
    Good luck!
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • PXIe-4499 simultaneous samples multi-modules

    Hello,
    I have three PXIe-4499 simultaneous samples modules in a PXIe-1082 chassis.
    I built a single AI voltage task which includes all the chnls on the three modules.
    Do I need to do anything special to ensure all modules use the same sample clock?

    Bert,
    Channel expansion is by far the easiest way to synchronize channels in DAQmx.  If all channels are in the same task they will share a sample clock and start simultaneously.  

  • With DAQmx, how to use AO start trigger for AO/AI synchronization with finite AI sampling

    I am a new user to DAQmx and I am trying to synchronize AI (finite samples) with AO in LabVIEW 7.1 using a PCI 6229 card. I want to generate a finite waveform (AO) and, subsequently, collect a finite number of voltage samples (AI). I would like to repeat the AO-AI cycles in a while loop.
    Alternatively, I could use an infinite AO generation and collect finite number of voltage samples on AI but always exactly at the same spot of the AO buffer.
    Using traditional DAQ and a 6024E card, I used a counter triggered by AO start trigger signal (example attached). I have problems with translating this example into DAQmx.
    Please help!
    Ruber
    Attachments:
    AIAODelay_traditional_Eseries.vi ‏155 KB

    Lesley,
    Thank you very much for your suggestion. Late last night I actually tried a to use AI start trigger instead of AO start trigger and it worked (since I tried the AI & AO to start simultaneously, it does not matter what triggers what), even in the loop. The devil is in details, as I had to carefully wire the number of data points and what to place inside/outside the loop.
    The problem with shared clock is that I need to sample the AI and AO at different rates but using AO and AI clock separately did not seem to affect the performance.
    I still want to try to use the AO start trigger (as you suggest) because I would like to delay the AI by a few ms from the AO. Is there a simple way to to that?
    I suppose, switching from traditional DAQ to DAQmx requires your brain to be rewired - after playing with it for a couple of days and nights I developed a "feeling" for it. One of the differences was that, in order to use this example in the loop, one has to use 'stop task' inside and 'clear task' outside the loop.
    Thanks again!
    Radek Uberna

  • Synchronization - DAQmx not triggering

    I have worked with labview 8 for a little while & have never used it for synchronization. We have a PXI1042 chassis connected to the computer using 8331. 6723,5122,5412 need to be synchronized & I am using the clock from 6602 as a trigger for this. The application requires the DC outputs to be at changing levels from each of the 20 channels and at certain points the AWG & Digitizer have to get triggered with a certain microsecond delay. This accuracy is key to the application. All components are working  except for the synchronization bit. The problem I am having is that the DAQmx is not reading the pulse from the source line to get triggered. On the other hand, if I try to make the a/o the source, I can't seem to configure the DAQmx to send out a trigger either. Any ideas on how this can be accomplished would be greatly appreciated!!
    Thanks!
    Sue

    Hello Sue,
                Can you elaborate on what product isn’t triggering properly. Is this the 6723 that’s not triggering correctly. The others are supported by NI-FGEN and NI-SCOPE. Do you have the trigger signal sent over PXI_STAR and have the devices triggering off the signal on that route? It sounds like you are never receiving a trigger on the 6723. Are the other devices receiving the trigger correctly? Are both the trigger and clock coming from the 6602 and PXI routes?
                The only recommendations are to be certain that the cards are triggering correctly on their own, to be sure there is no hardware problem. Hopefully we can get this settled soon.
                The link is a great reference to synchronization with DAQmx. You may be beyond anything here, but maybe it can be helpful in localizing the error.
                Regards,
                            Chris

  • Synchronization of two analogue DAQmx outputs, error -89131

    I am trying to synchronize two analogue waveform outputs.  I can run and observe both channels  in isolation but cannot work out how to run both at the same time.  I'm a novice Labview user.
    My system contains the following:
    Labview 2012
    Windows 7
    PCI-6035 DAQ card
    I've attempted to write code configured as MASTER/SLAVE, an error occurs when the code attempts to write the waveform to the SLAVE output (DAQmx Write), error code -89131
    Any help would be much appreciated
    Thanks
    Duncan

    Hi Duncan,
    For most DAQ devices, only one hardware timed task per subsystem (i.e. analog input, analog output, digital input/ouput, ...) can run at once.  Each subsystem has its own dedicated timing and triggering circuitry, and your code has two separate AO tasks trying to configure the AO subsystem's resources simultaneously.  After the resources are configured the first time, the second task notices that they're already being used, and it tosses you an error indicating as much.
    In order to configure multiple AO channels on a single device, you need to include both (or all) of them in a single task.  For your application, since it looks like your channels will be updating at the same rate, this will be fairly straightforward.
    Open the Voltage - Continuous Output example that you used as a starting point for your code.
    Configure the Physical Channel(s) input -- either in the existing front panel control or as a block diagram constant -- to include both channels.  You can use the dropdown, select Browse, and Ctrl-click multiple channels or you can simply type Dev1/ao0:1 into the field.
    Now that the task contains two channels, it expects you to define two waveforms to write to the output.  In the example, all you have to do is initialize a second element in the Waveform Settings array.  Just increase the array index value to 1 to view the second entry (should be grayed out, at first) and select the Waveform Type, Frequency, or Amplitude for the waveform you want to send out on AO1.
    That should get you going.  Let us know if you run into any other hurdles as you develop your DAQ application!
    KB
    - Additional reference: Simultaneous AO Tasks on the Same Device

  • Synchronize buffered pwm outputs on Daqmx

    I'm using Daqmx to produce two synchronized pwm outputs.
    The pwm outputs: 
                a) have variable controllable frequecy, and therefore use buffered data as input to daqmx write vi. and also use 'implicit' as input to clock type in timing vi
                b) have their beginning edges synchronized
    The design I use uses two separate tasks to create the signals. The only way I could think of of synchronizing the pulses was by putting the 'start vi' and 'write vi' in two different sequential frames. The idea doesn't seem to work, the two pulses somehow drift apart on the oscilloscope. Even the start part does not work; there seems to be a delay.
    Since I'm not using any clock to generate the signals (implicit), how can the two pulses be synchronized?

    Hello lvuser111
    You may take a look to this community example, it could give you a good idea how it may be implemented:
    Synchronize Two Counter Output Tasks Using a Dummy AI Task
    Regards
    Mart G

  • Synchronize two counters two different cards DAQMX

    I've made a simple program to synchronize the generation of two pulse trains created on different cards (6110 and 6601). When I acquire the pulses they are in fact synchronized but one of the two pulse trains starts always before the other. Is it possible to make them start together? You find the vi attached.
    Thanks for any suggestion.
    -Claudio
    Attachments:
    SynchronizeTwoCountersDAQMX.vi ‏89 KB

    You should use a start trigger on your 6601 task. As the start trigger you should use the same signal that is being used as the start for the 6110 task.
    Hope this helps.
    gus....

  • How can I Synchronize two counters in CVI using NI-DAQmx

    Hi, I am new to NI-DAQmx, and I would like to program counting of random digital pulses using two counters in LabWindowsCVI and a PCI6229 multifunction card. I have the evaluation copy for CVI 7.1
    I would like to set counter0, to count pulses from the 10MHz clock, to generate a single pulse (duration in the few ms timescale), that will gate counter1 in the same card.
    When I try to route the output from counter0 to the gate of counter1 I get an error code
    (-89137, "The specified route can not be satisfied because it requires resources that are currently in use by another route").
    How can one do the equivalent of the "Select_Signal()" in the traditional NI-DAQ?"
    I have also a hard time seting the counter0 to actually count a number of clock cycles from the 10 MHz clock.
    What is the NI-DAQmx equivalent of the function "GPCTR_Change_Parameter()" to program a counter to count a predefined number of clock cycles?
    Any suggestions are welcome.
    Fundadero

    Hi Fundadero-
    It sounds like you're programming for an M Series card with counter operations and need a bit of help with DAQmx functions.
    In order to count edges of the 10MHz reference clock you will need to use a format similar to that found in the CVI shipping example "CntDigEv.prj." This is found in the NI Example Finder (Help>>Find Examples) under Hardware Input and Output>>DAQmx>>Counter Measurements>>Count Digital Events. In order to measure pulses from a source rather than the default input terminal (ctrXsource where X is the counter number), you will need to use the function DAQmxSetCICountEdgesTerm(taskhandle char[] counter, char source terminal) as follows:
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateCICountEdgesChan(taskHandle,chan,"",edge,initialCount,countDirection));
    DAQmxErrChk (DAQmxSetCICountEdgesTerm(taskHandle, "/Dev2/Ctr0", "/Dev2/10MHzRefClock"));
    What type of operation are you trying to perform on counter 1? The strategy for routing signals will change based on this. If you're trying to perform gated counting you can specify the the task similarly as above and use the terminal "/DevN/Ctr0InternalOutput" as before. If you are trying to perform frequency measurement you will need to use the DAQmxGetCIFreqTerm function.
    Other channel properties are listed conveniently in the NI-DAQmx C Reference Help found at Start>>Programs>>National Instruments>>NI-DAQ on your start menu. A search for "channel properties list" returns this list.
    Please let us know if you have any additional questions.
    Thanks-
    Tom W
    National Instruments

  • How to count number of NI digitizers installed [NI-DAQmx Base]

    I'm the author of a cross-platform scientific data acquisition/analysis program (C++ using Qt: Windows and OS X). I'm just getting started on adding support for NI digitizers. It's tougher than I was expecting - there's so few helpful code examples. On Mac OS X I'm stuck with NI-DAQmx Base. I'd be very grateful if someone could help me with a couple of basic questions...
    1) How do you determine if the computer has an NI digitizer installed?
    1a) Is there a way to count the number installed?
    2) How do you synchronize things so that the input and output streams start at the same sample point?
    Thanks,
    John.
    Dr John Clements
    Lead Programmer
    AxoGraph Scientific

    Hi John,
    DAQmx base does not have property nodes, therefore we cannot
    programmatically determine information about the cards. We typically refer to
    our high-speed scopes (51xx series) as digitzers, in which case, there are no
    drivers for MAC. Our other DAQ cards, E-Series (60xx) and M-Series (62xx) work
    with DAQmx base according to the readme.
    If you are using a DAQ card, I would like a bit more clarification about question 2. When you say start at the same sample point, do you mean start simultaneously so that the input and output start at the exact same point in time? If so, I may suggest triggering them both off of the same digital line.
    David L.
    Systems Engineering
    National Instruments

Maybe you are looking for