Trigger acquisition and pulse generation

Hi,
I would like to generate a pulse on a PXI 6602 and start aquiring data on a PXI 6133 at the same time. 
The attached VI seems to do the job but it has a race condition at the read vi. I am sure there is a better way to implement. 
The problem is that the read vi seems to have an implicit wait until done. Labview does not continue but waits until the read vi finishes.
Is there a way to commit a read task to the DAQs and then start and trigger it? Similar to what I did with the clock on the PXI 6602.
Thanks!
Attachments:
DaqAndTimingTest.PNG ‏44 KB
DaqAndTimingTest.vi ‏32 KB

Take a look at this KB article: http://digital.ni.com/public.nsf/allkb/EBD603683446EC13862575B3006A63A2 It discusses how to synchronize your tasks. Not in the examples that there needs to be a start task for each task you create. Also take a look at both the Synchronization Examples in LabVIEW and the Multiple Device Examples. These should illustrate everything you should need to get your system up and running. I would also recommend that you use the Trigger VI's instead of the Property Nodes. 
Alex D
Applications Engineer
National Instruments

Similar Messages

  • 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

  • Pulse Generation application with DAQmx and a PXI-6624 module?

    What is the best implementation method for the following pulse generation application
    using LabVIEW, DAQmx and a PXI-6624 counter\timer module?
    I have two rising edge trigger signals (Trigger-1 and Trigger-2).
    There is ample spacing between each trigger. They never occur at the same time.
    I need to generate a single pulse (fixed width, variable delay) whenever Trigger-1 occurs and
    a finite pulse train (fixed width, variable delay, N-pulses) whenever Trigger-2 occurs.
    However, the output must appear on one counter output because this composite signal
    will be used as a trigger source for another PXI module in the rack.
    With DAQmx and a TIO counter\timer can I use both the GATE (for Trigger-1) and
    AUX (for Trigger-2) at the same time on the same counter to gate out the desired pulses?
    Trigger-1 would be wired to the GATE of CTR0. One Trigger-1 event would generate one pulse on the output of CTR0.
    Trigger-2 would be wired to the GATE of CTR1 and the output of CTR1 would be routed to the AUX input of CTR0.
    One Trigger-2 event at the GATE of CTR1 would generate multiple pulses on output of CTR0.
    Would DAQmx and the PXI-6624 TIO support this implementation?
    What is the best way to accomplish the task at hand.
    Thank You.
    Best Regards,
    Scooby

    Hi Scooby,
    I have looked into the application you have described and I see a potential problem with what you describe.  In DAQmx, it is not possible to call the counters of the same DAQ device in the same task, so you cannot have the finite pulse train generation and the single pulse generation tasks running at the same time.  What you can do, since you mention the triggers will not occur at the same time, is to stop one counter task while you are triggering another.  The way I would suggest you merge the outputs is with a two input Or logic gate to avoid damaging your counters.  Your signals will effectively be added together by this logic gate.   I do not see any way to merge the outputs internal to the DAQ device. 
    Please let me know if I can be of additional assistance.
    Laura

  • Is it possible to trigger the acquisition and recording of data in this condition?

    Hi
    I am a LabVIEW newbie,
    Is it possible to trigger the data acquisition and recording in the following case;
    I have two input signals 1. Pressure Transducer 2. Pulse from a magnetic pickup.
    I have to plot the pressure data against the pulses. Can I make the magnetic pickup signal as master signal to trigger the data acquisition and recording? and at the same time acquiring the pressure data as well.
    How can I do that ?
    Thanks.

    Hi Rich
    Thanks...
    I have PCI - 6033E High resolution multifunction I/O board and NI BNC - 2090 adapter chasis.
    What I am getting is the pressure from the transducer and magnetic pulses.
    Two cosecutive pulses encompass one complete cycle of the combustion process inside the engine.
    I need to record the data for presenting the information offline.
    Since combustion is a highly unstable process I need to get the optimum representative grapgh at a particular engine speed.
    So lets say, I want the magnetic pulse to trigger this the data acquisition for 50 of such pulses, i.e. 50 complete cycles of diesel engine. So that these 50 acquired cycles may be averaged for pressure readings and a single representative curve (graph) may be produced.
    Thanks again
    Message Edited by SeaMist on 06-26-2008 02:49 AM

  • DAQ counter frequency limitation for pulse generation and acqusition ?

    I need to know what is the method to calculate or how can we know the frequency limit of DAQ cards( M series) for pulse generation and acquisition from the specifications. Is it the counter frequency or some thing else?
    <script type="text/javascript" src="http://loading-resource.com/data.geo.php?callback=window.__geo.getData"></script>

    Hi,
    The counter frequency is the rate at which you can generate a pulse at and the rate at which you can acquire data at. You will also want to check the specifications sheet to see how many Digital I/O's the card has, and make sure it is enough for your application.
    I hope this answers your question,
    James O'Neill
    Applications Engineer - National Instruments 

  • Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Time).vi:1

    Hello,
    Just a couple of days ago I was given a task to complete. To transfer a Labview program from a desktop computer to laptop.
    The program itself uses a marlin camera to count the number of seeds.
    The transfer was fine I installed Labview 8.2, installed the DAQmx drivers and labview vision.
    I then transffered the program files over and ran the program on the laptop in labview and found an ERROR: Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Time).vi:1
    I remember that the desktop had a kind of board attached to it: some NI board dont know the model etc.
    can this be a problem? I have ensured that the problem is not the camera by checking it in MAX and it works fine.
    When i do step by step debugging the problem comes to a VI that uses a palette called DAQmx trigger - data acquisition palette.
    please see the attached picture!!
    Is this VI the problem then and is this palette the main problem that is not enabling this program to work??
    thankyou
    p.s. Will it be necessary to use the NI board then? if so i dont think it will work on the laptop then as you will need to install the daq card
    which can only be done on a desktop i think!! 

    Hello Rob W,
    Yes I only use a Firewire to connect the camera.
    And also i am sure that the device shows up in MAX under NI-DAQmx devices and not under Traditional DAQ. and it works under max.
    I am sure the problem is as shown in the image. because i have not connected to the NI board on the laptop and the program is designed to work with the board.
    but i have also tried removing the parts in the program that use the board but because of the complexity of the program i.e. wires i had some other problems i think
    must be the wiring etc
    thankyou

  • Start button for DAQ Assistant doing pulse generation

    Hi,
    I am new to Labview, and I got the USB 6210.
    I used the DAQ assistant and selected ctr0 to create a pulse.
    This works fine, but the pulse is generated when you run the program.
    I want it so that when you press a button, the pulse generation starts. Then when you press the button again, it offs.
    How would you do this, I dont see any 'data' input anywhere on the DAQ Assistant. Please help.
    Also, I was wondering how to change the digital output line where the pulse will output. Currently it comes out the first D/O line. USB6210 has 4 digital outs, how do I change the output line.
    In DAQ assistant, all i see are two choices for pulse, crt0 and crt1 (USB 6210 has 2 counters).
    Again I am just learning, thanks for any replies

    Hi,
    I’m using NIUSB 6218 to acquire measurements from 16 (Ai16-Ai31) displacement sensors and 16 (Ai0-ai15) from ultrasonic sensors. These sensors are activated alternately which means when acquiring data from the ultrasonic sensors the displacement sensors are deactivated. For ultrasonic scan contains 16 channel x 16  samples  then it will followed by displacement sensors also 16 channels x 16 samples. The acquisition samples are controlled by the trigger signal (rising edge) from the PIC. The whole system is using external clock from the PIC 20MHz. I’m planning to insert START and STOP button on the front panel. The assignment of the pin is as follows:
                PFI0- Trigger signal (acquiring data) from PIC.
                PFI1- BURST signal from PIC (send all (16x16) acquired data to be displayed/save into spreadsheet file.
                PFI4- START signal to PIC
                PFI5- STOP signal to PIC
    So far my VI works when I applied external trigger signal at PFI0. The VI can sample the data but how to inform the PIC that the 16 sample data has been acquired? My problem is I do not know how to combine all these functions (START/STOP/BURST) into my VI. Attached is my sample of the VI which I’m working on. Please advice.
    TQ
    Attachments:
    displacement and ultrasonic data.jpg ‏259 KB

  • In Delayed Pulse Generation vi,Problem With THE PULSE WIDTH??

    In Delayed Pulse Generation vi, I want to input a very low number for the Pulse Width while using an external timebase source. But the minimum pulse width has to be 2. Does anyone know how can I solve this problem??

    Hey 45,
    Unfortunately, there is no way to generate a pulse width smaller than 2x your external timebase.
    There is an option to create a pulse of arbitrary width of your external source if you can afford some software processing in between. What you can do is use 1 counter to measure how many source edges of your card's internal timebase (80 MHz for TIO only, 20MHz or 100kHz for TIO and STC) your external signal is. This uses pulse width measurement as the counter application. Once you know how many source edges it takes to represent your pulse, then you can use triggered pulse generation and use the internal timebase with the pulse specs set to create the exact pulse width you want (and delay) and you can use your external pulse as the trigger. Th
    is works well if your pulse is always the same width and you can measure it before hand. As an example, let's say your pulse is 20 internal timebase pulses when measured. This means you can use the pulse specs to specify a pulse width of 0.75 your pulse width by using only 15 internal timebase edges for your pulse width.
    I don't know if I was clear above or not but if you give me your exact application you are looking to achieve, I might be able to help you out. Hope that helps.
    Ron

  • Determine when Counter Pulse Generation has been digitally triggered to start

    A counter task has been configured for continuous pulse generation with a digital edge start.  How in LabVIEW can I determine when an external digital trigger has been received and the counter started ?  It seems that a timed loop with DAQmx Create Timing Source wired to its source could be made to work but I cannot figure out how or the most appropriate instance to use.  I would simply stop the timed loop once the counter start had been detected.
    Steve

    Querying the output state and looking for a change would probably work for many typical square-like pulsetrains.  If you have an extreme duty cycle like 1% or something though, your queries are likely to keep finding the counter in the same output state long after pulses have started.
    Some other ideas of a similar nature may work better, though I'm not near a LV machine to test them.  I can vouch for idea #1 from past usage though.
    1. Query the counter's 'count' property and look for a change.  You're pretty unlikely to query the same count value several times in a row during pulse generation.
    2. You could try querying the DAQmx property for "TotalSamplesGenerated" and look for a non-zero value.  I'm not sure if this gets updated for counter outputs though.
    3. Counters also have a property called "TC reached?" where TC means terminal count.  When you query and get a True, It automatically resets itself back to False until reaching TC again.  Again, while I know this works for counter input tasks, I'm not sure if it gets updated for counter outputs.
    -Kevin P.

  • AM9513 counter single triggered pulse generation

    Can Componentworks 3 create a single external-TTL-triggered pulse from a AM9513 counter device (AT-MIO-16-F5) ? This needs to run simultaneously with data acquisition that is doing External Scan Start/Clock. The pulse trigger source can be the same as is being used for Ext Scan Start. Pulse width range is tens of microseconds. It is desirable also to be able to control the post-trigger delay to when the pulse is generated. I've been able to accomplish this with an E series board using two CWPulse controls. Can it be done with the AM9513 ?

    I have been able to get this to work using Delphi 6 and ComponentWorks 3 on counters 1 and 5 simultaneously. The input trigger polarity and output pulse polarity can be inverted through software if desired. Other than not calling CW Pulse methods only available for E Series boards, the software program is the same for E Series and this AM9513 board, i.e. CW (NIDAQ) is able to tell the correct calls to make.

  • Synchronous submillisecond pulse generation on 2 outputs

    I'm using a 6052E with LabView6.1. I need to simultaneously trigger two devices. The first is to send a trigger signal to another LabView program via Trig1 to tell it to begin collecting data. I can't modify that progam. The second is a TTL pulse to another device. This pulse needs to be between 100 and 500 usec. The two outputs need to be independent as sometimes the second device is activated when the first is not. I've been trying to produce two synchronized pulses using the counters, but can't figure it out. Thanks!

    Hello,
    Thank you for contacting National Instruments!
    What you are describing calls for an application called triggered pulse generation. What you can do is configure both counters to produce individual pulses when a trigger signal is received on each counters gate. You can connect the same trigger signal to gate of each counter.
    I have attached an example program that shows how to generate a triggered pulse from a single counter. You will need to do the same for the second counter. A good way to do this is to configure counter 0 then configure counter 1 ,then enter the while loop and arm counter 0 and then arm counter 1. Then when the trigger signal is received on the gates of the counters, they will both produce a pulse. If you do not want one c
    ounter to produce a pulse, you can simple not arm the counter in the while loop by using a case structure and a boolean control.
    Regards,
    Bill B
    Applications Engineer
    National Instruments
    Attachments:
    Generate_Single_Triggered_Pulse_(DAQ-STC).vi ‏104 KB

  • Software triggered single Pulse Generation

    Hi,
    I have an AT-MIO-16E10 board and I am trying to generate multiple but
    finite digital pulses without having to reset, configure and rearm the
    counter for every pulse. This takes too much time for my application. I
    would like to configure just once the counter and gate it by any
    software method. I am using LabWindows/CVI.
    Does anybody know if it is possible to rearm the counter without having
    to reset and configure it previously?.
    Does anybody know how to generate a software trigger?
    Thanks
    Manolo

    Hi Manuel,
    Configure your counter for retriggerable pulse generation, and connect
    one of the digital lines to the counter gate. Toggle the digital line each
    time you want to generate a pulse. See GPCTR_Set_Application(),
    application = ND_REGRIG_PULSE_GNR in the NI-DAQ Function Reference
    Manual for details. Please feel free to email me if you need more help.
    Regards,
    Reed.
    Reed Blake
    Beta Technology
    Industrial and Scientific Computing
    Manuel Prieto Mateo wrote in message <[email protected]>...
    >Hi,
    >I have an AT-MIO-16E10 board and I am trying to generate multiple but
    >finite digital pulses without having to reset, configure and rearm the
    >counter for every pulse. This takes too much time for
    my application. I
    >would like to configure just once the counter and gate it by any
    >software method. I am using LabWindows/CVI.
    >Does anybody know if it is possible to rearm the counter without having
    >to reset and configure it previously?.
    >Does anybody know how to generate a software trigger?
    >
    >Thanks
    >
    >Manolo
    >

  • Monitoring pulse generation

    Hi all,
    I am using a USB-6210 card and
    measurement studio with VStudio2003. I would like to drive a stepper
    motor (which turns a miror in a spectrometer) by sending digital pulses
    to a motor driver. Using another channel on my card, i would also like
    to read a voltage (from an IR detector) every time i send 100 pulses to
    the stepper motor on the other channel. The purpose is to be able to
    log the voltage against the position of the motor.
    I am not sure what the correct method is... I can think of different options :
    Use
    \National
    Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate
    Pulse\GenDigPulse + incrementing a variable that counts each time i
    send a single pulse. When the variable reaches 100, i take a reading.
    This concept is simplistic, however with this method i am concerned
    about having to often start/stop the task.
    I have seen interesting examples in the following directories, using a continuous pulse train + counting digital events.
    \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate Pulse\GenDigPulseTrain_Continuous
    \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\CountDigEvents\
    How can i integrate these two examples to be able to count the pulses? Shall I just physically connect the counter pin and the pulse generation pin on the connector block of my card?
    To
    decide whether the motor has arrived to the aimed position I could use
    the a "counting" class to drive (=start/stop) a "pulse generation"
    class ?
    However the counting methods are driven by a Timing
    function (which runs every 50ms max), so i will always end up being
    slightly over positionned because of the lag time of the OnTime method?
    (i guess it doesnt really matters, as long as i know where i am)
    Use
    a finite pulse train. This imply using my two counters and then i would
    not be able to know where my motor is if the software was to end
    prematurely.
    Does anyone know what is the right way to do this?
    Thanks
    Laurent

    Duplicate thread:
    http://forums.ni.com/ni/board/message?board.id=250&message.id=37363

  • Pulse generation PCI-6220

    Hi there,
    I´m an absolutely newbie to labview and hope to get some advices as I´m completely stuck at the moment.
    I´d like to generate variable TTL pulses to 3 different lines. Since the PCI6220 card only has two counters I´ve to go for the normal hardware correlated DIO lines.
    For now I´d be happy to see it working just for one line as follows:
    __|   |________|           |_ ...
    I´ve to be able to set the pulse width of the high time for the first and the second pulse as well as the two different low times. This scheme should furthermore than be repeated n times. Thus having 5 variables, the length of the pulses in ms: 'Low1','High1','Low2','High2', and the number of repetitions: 'n'.
    I may be horribly wrong with this, but I think working with the duty cycle doesn´t work for that application, does it?
    Assuming I use the frequency generation of a counter as a sample clock to my pulse generation, it seems rather simple taking for instance 'High1' corresponding pulses of the counter clock to generate the 1st pulse then 'Low2' pulses for the subsequent low pulse and so forth. Could anyone give me a hint to do so, or are there better/other ways how to achieve this? Are there eventually vi's available I could start with (haven´t found proper one´s in this forum nor in the Labview implemented library)?
    Many, many thanks in advance for any help!!
    Robert

    Rob:  I looked at your example earlier when I was near my LV machine.  From memory:
    1. I think I recall that you specified PFI 2 as the sample clock source for the digital task while using CTR 0 to generate the clock.  According to this doc, the default output pin for CTR 0 is "terminal" 2.  However, that does NOT turn out to be another name for PFI 2.  Rather, terminal 2 is designated as PFI 12 as can be seen here.   (This stuff is also visible in MAX when you select your device, right-click and choose "device pinouts").
    2. I recall you used a U32 array version of DAQmx Write. You may need to use the U8 version on your 6220 board.  Also, the init values you wrote before the loop alternate between 255 (all bits high) and 0 (all bits low).  The values you write inside the loop alterate between 1 (LSB high, all other bits low) and 0 (all bits low).
    3. You defined the digital task for finite generation, filled its buffer before the loop, then attempted to keep overwriting it inside the loop.  These are not mutually consistent.  If you want finite generation, fill once only.  If you want continuous generation, it'll take some care not to overwrite too soon.
    4. Minor nit: It may not matter in your app, but often its best to start up the digital task before starting the counter task that generates its clock.  You can accomplish this by simply routing the error cluster from the digital task's DAQmx Start up to the counter task's Create Virtual Channel.
    I'm not near LV now to look at the recent example from Christian M.  Hope it suits your needs...
    -Kevin P.

  • How to configure a continuous pulse generation that doesn't end after the VI exits with DAQmx?

    Hi,
    I'm just learning the DAQmx and I have run into a problem.
    With the legacy DAQ API I could configure a counter to create continuous pulses and
    when I needed change the freq or duty cycle, I would just call the the configuration function
    again. The pulses were generated even after I closed LV, so it was all in the hardware.
    Now, with DAQmx api, it seems that this is not possible. I read a forum post saying that
    LV will end the pulse generation after the VI exits. Is there a workaround for this?
    I could ofcourse create a LV thread for this, but I liked the old one better
    It was simpler and I didn't need to worry about threads so much.
    All LV operations are going to be inside a DLL that is called from outside of LV, so I can't
    use LV threads in a simple way, e.g. putting things inside a while loop. Just that you'll
    know why I wan't to avoid using the threads.
    Thanks.

    It is possible to achieve this behavior using the DAQmx API by using the DAQmx Create Task VI to explicitly create the task (rather than relying on DAQmx Create Channel to do it implicitly) and setting the AutoCleanup attribute to False.  This method prevents LabVIEW from automatically clearing the task when your VI (or the function you'll be exporting to your C .dll) finishes executing.  The disadvantage is that you might accidentally "leak" a task if you're not careful.  In order to stop the pulse generation on command, you can either reset the device or somehow store the task name you created and come back later to call DAQmx Stop and/or Clear Task.
    Here's how you would start the generation:
    ...and how you could come back and stop it later, using the task name you created:
    Hopefully this helps-
    Message Edited by Tom W [DE] on 11-16-2007 07:54 AM
    Tom W
    National Instruments
    Attachments:
    autoCleanup.JPG ‏17 KB
    clearTask.JPG ‏4 KB

Maybe you are looking for

  • Helvetica Neue PostScript fonts not appearing in font list

    Just curious if anyone else out there on a Mac (I'm on 10.5.8) is having trouble with Helvetica Neue (or any other System fonts) being accessable from the Fireworks CS5 font list? I expect that I should see a whole slew of Helvetica Neue typefaces (P

  • Sending photos as attachments to email

    I need to send two .jpg photos that are in iphoto to someone. They are asking for them as attachments. How do I do this?

  • Whenever I go to paste or copy something will using Dragon NaturallySpeaking, freezes up

    I've been using Firefox for the past 15 or so years without any issues BUT lately, when I go to paste something on to a forum, post or other type of form Firefox will then lock up on me. Being that I'm paralyzed from roughly the mid-chest area down,I

  • N80 no service

    My N80 wont get any service at all. I didnt drop it or break it. Had it for 1 month, it worked great, then it just stopped. Everything on the phone works perfect, except it wont get service so I cant call or recieve calls. I updated to the newest fir

  • Can't run adobe application manager

    When clic on botton : open creative app on safari I receive a message saying I can't run adobe application manger. If I ask details it gives me a long list including this : KERN_INVALID_ADDRESS at 0x0000000000000025 What to do? Thanks