Acquiring pre-trigger samples

Hi,
I am using a PCI-6602 board to record the times of incoming pulses. I'd like to add a trigger line so that my program will keep the data of 20us worth of pulses before and after the trigger. I've tried using an armstart trigger, but I've only managed to configure it to start recording pulses after that trigger, and so I don't get the pre-trigger pulses. I've also tried to set up a stop trigger instead: I would read pulse times and discard data older than 20us, and when the trigger comes in I'd let the program run for 20 more microseconds. The problem with that is that, being new to LabView, I haven't figured out how exactly to make this kind of buffer which will discard older data. I looked at a feedback node, configured to only return samples after a number of iterations of my data acquisition loops, but of course that only returns the oldest data. I also feel like using this stop-trigger method seems a bit roundabout. I create a new task for the trigger channel, and I'm worried this may slow down my program because I need to run it continuously (I want data surrounding multiple triggers), and it seems wasteful to recreate the task every time. Any suggestions? Is there a more straightforward way that I have not yet thought of?
Thanks for your help! 
Kamna 
Solved!
Go to Solution.

Hi Kamna and Jeff,
DAQmx filters out properties that aren't supported by any of the installed devices. You can change this by right-clicking the property node and choosing Select Filter... then selecting Show All Attributes. The filtering setting gets saved to disk so it's still set the next time you launch LabVIEW. However, this won't solve the original problem, because the NI 6602 doesn't support reference triggers.
By the way, Jeff, using Ref.PretrigSamples also requires setting Ref.TrigType and the corresponding source properties (Ref.DigEdge.Src, etc.). If you set Ref.PretrigSamples in isolation, it will either get ignored (on devices that support reference triggers) or generate an error (on devices that don't). If trigger attributes didn't get ignored when the trigger type is None, then disabling the trigger (by setting Ref.TrigType=None) would require resetting the other trigger properties (via Change To >> Default Value), which would be pretty annoying.
Kamna, as for your question about "commit": a DAQmx task doesn't program the hardware until the task is committed. Starting the task implicitly commits the task, so you don't normally have to worry about it. There is a more detailed explanation in the NI-DAQmx Help file--search for "Task State Model".
Brad
Brad Keryan
NI R&D

Similar Messages

  • How can I acquire and record pre trigger samples

    Hi I would like to acquire and record pre trigger samples. I have used many different methods including: 
    http://digital.ni.com/public.nsf/allkb/9DE9E3E4DAD​9EE93862579C60018B6EA
    the problem is I would like to acquire pre trigger samples before start trigger not reference trigger. I think reference trigger is used for stop triggering not start triggering. Could you please help me on this
    Thanks? 

    Hi tintin_99,
    I hope you are well and thank you for posting your issues to the forum. 
    I wanted to ask you some further information in regards to your application:
    - What version of LabVIEW do you have?
    - What operating system (OS) are you running on your PC/laptop?
    - Which application programming interface (API) are you using? NI-DAQmx, NI-Scope?
    When you mention you want to acquire the pre-trigger samples before the start trigger and not the reference trigger, how are you currently doing this? Would you be able to post up your code so that everyone can have a look at it?
    Here are some further links to look at:
    - Continous Analog Input Acquisition with Pre-trigger Scans using 2 E-series Boards
    - How Can I Acquire Pretrigger Samples with NI-SCOPE?
    - Software Analog Trigger with Pre-Trigger Samples
    - Synchronized Analog Input/Ouput with an Analog Trigger and Pre-Triggered Samples
    I hope this is alright for now.
    Kind Regards,
    Dom C

  • Pre trigger for USB-4432

    Hello, my name is Dimas aryo, student of Institut Technology of Bandung..I'm still doing my final project.. my hardware is USB-4432..I have succeeded to build Triggering program, and can start taking data at certain level ( 0.2 Volt )..but i'm still confuse how to see the data at certain seconds before start  taking data ( Pre-trigger ). I'm using DAQmx for the driver..and LabVIEW8.5..
    Your help will be aprreciated.. better that you can attached it..
    Thank you very much guys... GBU All...

    Hello Dimas-
         I think what you are trying to do is use a reference trigger.  From LabVIEW, select Help»Find Examples.  Once that opens, take a look at Hardware Input and Output»DAQmx»Analog Measurements»Voltage»Acq&Graph Voltage-Int Clk- Dig Ref.vi.  The digital reference trigger will wait until the number of pre-trigger samples has been gathered before it registers a trigger on the specified line.  At that point, it works like a circular buffer, continuously throwing away the oldest sample as the newest sample arrives.
         I hope this helps.  Best of luck with your application!
    Gary P.
    Applications Engineer
    National Instruments
    Visit ni.com/gettingstarted for step-by-step help in setting up your system.

  • Digiatal pre-trigger over RISI w/NI PCI-6123 DAQmx

    I have an application which I need to aquire pretriggerded data using a PCI-6123 via RTSI bus from a channel on PCI-6052. Am aquireing a total of 7 channels, 6 on the PCI 6123 and 1 on the PCI 6052.  I am using DAQmx. Has anyone successfully achived this?

    Hi John,
    First you will need to connect your cards with a RTSI cable and then create that cable in MAX.
    Sounds like all you need to do is a multi device synchronization. You can find examples for doing that by going to
    Help > Find Examples > Hardware Input and Output > DAQmx > Synchronization > Multi Device
    Once you see how to synchronize multiple devices you can either share the sample clock, or share the trigger.
    In your case I think you will want to share the trigger over the RTSI line.  For the 6052 it sounds like you want to do an analog start trigger.  For the 6123 though you said that you want pre-trigger samples.  That means you will have to set up a Reference Trigger for the 6123, and then have it trigger off of the ai/StartTrigger signal from your 6052. 
    You can find all of the examples with triggering in a similar path as before:
    Help > Find Examples > Hardware Input and Output > DAQmx > Analog Measurements
    Sharing the signals is a breeze and most everything is done automatically by the DAQmx drivers. 
    For more details on synchronization check out this Tutorial:
    Advanced Data Acquisition Series - Synchronization with NI LabVIEW and NI-DAQmx
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?

    I would like to start several PCI 4472 and a PCI-MIO-16E-1 simultaneously. All boards are connected via a RTSI cable.
    My program works fine if I use software trigger, or an analog trigger from a PCI4472 channel. However, the analog trigger works only when I set pre-trigger (or pre-scan) to 0.
    Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?
    Thanks.
    Ian Ren

    Hi, Bill
    I think it is possible to set more than 38 pre-trigger scans on a single 4472 card. I've done this before. You can verify this by running the Labview example "Acquire N - Multi-Analog Hardware Trig.vi" which comes with LabView.
    What I try to do but without success/luck so far is to start data acquisitions of several 4472 cards and a PCI-MIO-16E-1 card using an anlog trigger (with pre-trigger).
    Thanks for your help.
    Ian

  • Pre-trigge​r data from four AI using Daqmx

    Hello everyone,
    I have an PCI-6251 card  connecting BNC-2120 recently. I am using Labview 8.2. I have used design a programme by using Reference analog edge trigger function, the trigger source is the the same as the input channel in a single channel. the reason I choose reference analog edge trigger function is I only need to acquire a pulse produced average one second (random). the reference analog edge trigger function can allow me to acquire the trigger level, pretrigger number and sample number, I can record the pulse.
    However, I need four analog input channels doing the same function, the pulse from sensor is generated randomly. I also need to count how many pulse generated through each channel during the experiment. is there any good way to do this kind work. Any advice would be greatly appreciated.  Thank you in advance for any responses. 
    Lyn

    Lyn
    Although you may be able to use the BNC 2121, I do not reccomend it. The device is a counter specific accessory and does not include any Analog IO. You may be able to work around this but would probably run into similar problems as with the 2120. you could perhaps use the 2111 which includes 8 Analog IO and an APFIO channel too. However, the device does not include as many other features as the 2120 such as thermocouple inputs, digital IO and quadrature encoders. Therefore if you were contemplating an exchange, in the long run it might not be the best idea. The 2111 is also a single ended reference device unlike the 2120 which can accept floating signals. I have included a schematic of the 2111 in this email and the following link will give you all the information on the BNC accessories your Mseries DAQ card can use.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/201​731
    With respect to whether you might still be able to use the 2120, I believe the answer may be yes. I have been working all morning on developing some code which might be able to achiveve this and it turns out the answer may be quite simple. After experimenting with a lot of code I found the easiest method would be to use some of the express VI's located in the LabVIEW function pallette. I have attached a simple VI which takes the input of 2 channels and outputs the signal from a reference point on one of the signals. Have a play and see if you can adapt it for your needs, I hope this will provide a simple and effective solution.
    Best wishes, I really hope this helps.
    Rob
    Rob L
    NI Applications Engineer
    UK & Ireland
    It only takes a click to rate this message ;-)
    Attachments:
    Sampling.vi ‏135 KB
    2111 specs.pdf ‏165 KB

  • How to set a pre-trigger when triggering off a physical channel

    I am trying to set a pretrigger when triggering off a physical channel when the voltage is above a threashold. Basically I would like to capture the pretrigger and posttrigger from a channel. I am using Visual C++.NET with Measurement Studio 7.1 with DAQmx 7.4 driver. I used to program this application with Visual C++ 6.0 with traditional NI DAQ with software analog (stop condition). How do I program in the DAQmx ?
    Thanks,
    Yajai

    In NI-DAQmx, the triggering technique you are referring to is called 'Reference Triggering'. In the attached zip folder is an ANSI C example in NI-DAQmx that demonstrates analog input with a digital reference trigger, acquiring pre and post trigger data. You will have to change the reference trigger function to use an analog edge as opposed to a digital edge (use DAQmxCfgAnlgEdgeRefTrig function). Also in the attached zip file is the NI-DAQmx C Reference Help. You can find all the DAQmx functions and properties there. Hope this helps.
    -Alan A.
    Attachments:
    DAQmx_ref_trig_and_HelpFile.zip ‏53 KB

  • Pre-trigger scans?

    I have attached the VI i'm using to try to collect data for an Impact hammer and its corresponding accelerometers. It collects fine, but I am missing the beginning part of the impuse. I tried setting the pre-trigger scans to numerous numbers but it never gives me any more. This may be due to the way I'm storing data, but this is an old program and the creater is no longer around and I'm not really sure what's going on. I attached the file below, any help would be MUCH appreciated. I'm using a 6110 PCI card also.
    Attachments:
    impactnew2.vi ‏127 KB

    Hi Tim,
    I understand that the code was developed by someone else so it will be more difficult for you to troubleshoot it. I would like you to try running a couple of examples to see if you can acquire all of the necessary data. Since you are using an S series board, you now have the option of using DAQmx as long as you have LabVIEW 7.x or later. Here is a link with some of the Advantages of DAQmx:  Here is the link to a DAQmx Example that you might find helpful: NI-DAQmx: Acquire N Scans Using an Analog Reference Trigger.
    If you still must use Traditional DAQ, please try this example: Acquire Analog Input Data Using a Hardware Analog Trigger.
    I hope that you find this information helpful.
    Regards,
    Hal L.

  • How to do an analog trigger with bipolar levels of detection and start acquisition with pre-trig samples

    hello,
    I use PXI 4472 with accelerometers. I want to trig as soon as the acceleration is out of the window +/-50g and recover the previous samples before the trig. Is it possible to do it?
    I try the daq-mx functions trig on analog windows and a number of pretrig samples but without success. My first sample detected is always over 50g, it seems that the number of pretrig samples has not recognized. Anyone to help me?
    Thank you. 

    Hi Chouca,
    It should be possible to do what you are trying to do:
    type of trigger: analog window triggering (acquire data when the signal leaves the window)
    Action caused by trigger: reference trigger
    I will try and get a 4472 to check that by myself.
    Maybe it would be easier to check the behaviour of the system with a precise voltage generator instead of the accelerometers.
    Best regards,
    Thomas B. | CLAD
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Inscrivez-vous gratuitement aux Journées Techniques : de l'acquisition de données au contrôle/com...

  • Why do I get errors when I use pre-trigger scans with a relatively small number of samples?

    I have a PXI6115 (hi mem option) that I am using to collect data at 5 MHz. If I collect about 10,000 samples with 100 pretrigger scans, the acquisition works fine. However, if I collect 1000 samples with 100 pretrigger scans, I get an AI Read error. Likewise, I can collect 10 pretrigger scans with a sample size of 1000 but I get an error if I try to colelct 10 pretrigger scans with only 100 total samples.
    Why is that the case?
    Thanks in advance.

    This sounds familiar.
    I do not remeber the final answer, but this is what I can recomend. Use the Info-LabVIEW search engine
    http://www.searchview.net/
    To search fro everything posted by "Roger Hart" (sometime in the last 3 years).
    I believe he posted a number of e-mails discussing what he found.
    If this approach get you an answer, please summarize the results here.
    Doing what I can to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Pre trigger problems

    Hello,
    I'm having some issues with my project. I can't figure out what's wrong. The project is to build a FPGA-target which uses a trigger to start sampling data and it also needs to have pre/post trigger functions, but it just won't trigger when it's supposed to.
    I'm attaching my program.
    Regards,
    Tim Jansson
    (It seems that I managed to double post this thread again. I apologize and hope that this won't cause too much problems)
    Message Edited by MightyEKA on 11-23-2009 01:05 AM
    Solved!
    Go to Solution.
    Attachments:
    PosttriggerProjekt.lvproj ‏54 KB
    FPGA.vi ‏77 KB

    I'm quite stuck acctually. Right now, my FPGA works...bad. It triggers but now I'm using 3 FIFOs (one local) and I don't think this is neccesary. My host program is even worse, and it doesn't even uses the trigger.
    Don't even bother to look at the Front Panel!
    Tim
    Attachments:
    PretriggerFPGA.vi ‏82 KB

  • Pre-trigger filtering on analog channel

    Is there a way to add a low-pass filter ahead of the trigger logic when trying to do an analog trigger? I am using DAQ assistant to configure and acquire an analog voltage measurement to capture a motor start-up after a switch closure and it seems to be triggering erratically after the switch is closed. I suspect it is triggering on noise because if I test my vi with a function generator as the voltage source it works fine. I am using a PCI-6250 and LabView 7.0.
    Thanks,

    Hi,
    As far as I know, the trigger circuit of the DAQ boards works on the signal itself, so you cannot do modifications on the signal by software.
    Maybe if you do that treatment by electronic means before feeding it to the DAQ board you can solve the problem.
    Regards,
    Paulo

  • What is the Pre Trigger for combo item same like Pre-Text-Item.

    Hi Everyone,
    Can anyone help what is the same trigger like Pre-Text-Trigger for combo items.
    Thanks in advance.

    Thanks for your reply Mr. Ammad,
    --vDatabaseValue:=GET_ITEM_PROPERTY('item_name',DATABASE_VALUE);
    This will fetch the value from the database. But what I need is to store the value of the item itself.
    For example:-
    I created one combo box called Item_Code and one text item called Quantity in my form.
    I am choosing the item code from the combo box lets say 'ABC123' then my cursor moved to Quantity.
    Now I am again coming back to the Item_Code to change the value which already I choosed 'ABC123', here I need to store that value 'ABC123' into an global variable before to change.
    Hope you understand.
    Thanks.

  • Pre-trigger

    I am trying to eliminate the "lag" data before an arbitrary trigger event (only on the graph, but if the file need to be truncated so be it!) and am having no luck.  Please see the graph below for reference.
    Any help will be appreciated.
    Solved!
    Go to Solution.

    Use a Combi Trigger module with the defined pre and post trigger settings, and then use it to control a Relay module where you route the rest of the data through. The Relay will release data while the trigger is active (high), and not while it's off (low). 
    You can write the data before the relay to write all of the data, or after the relay to only write the desired triggered area. 
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • How can I write to data file only near to SW Trigger samples?

    Hi everyone
    I am working on a model based in this one:
    http://zone.ni.com/devzone/cda/epd/p/id/34#0requir​ements
    I would like to save the data once the trigger is reached, with some data near to the impact.
    Where should I place a "write to measurement file" block in order to may load and plot the data of an impact test?
    Regards.
    Solved!
    Go to Solution.

    Celuti,
    You are so close!
    I am glad to see you understood what I recommended!
    You need to ensure that you connect the same data type to the Queue as what is coming from the DAQ.
    Please see the modified version of the code you posted.
    Craig
    CLD | CTD
    LabVIEW 2011 SP1 | TestStand 4.5
    Attachments:
    daqmx_sw_trigger_example (modified).zip ‏93 KB

Maybe you are looking for

  • My ipod video is not recognized by the computer what should i do/

    my ipod video is not recognized by the computer what should i do?

  • Looking for an ABAP-code for the customer-Exit Variable

    Hello, I have defined a Variable (Interval) which should be processed through Customer-Exit on characteristic Supplier-Date (date format). This Customer-Exit Variable is called ZDATE. We have another time characteristic Fiscal year / period (0FISCPER

  • The UML Package model could not be resolved - SOLVED

    I am using Perforce with JDeveloper 10.1.3.2.0. I have imported a project into Perforce on one machine, then 'p4 sync -f' on another machine. I then created a new application on this machine and added the projects to it. Now, when I try to open a dia

  • Use XPath to select one of the node??

    Can I use xpath to draw <param-value>/mnt/VISL/stats/stats/clarent2</param-value> only? I have tried to use ApplyXPath sample, but I don't know what xpath value I should use? I tried /doc/servlet/init-param/param-value but it certainly draw other tag

  • Interactive Booklet

    I have purchased the new audioslave album(great) However I cannot get anything out of the interactive booklet. I have tried in quick time and the same thing happens - It has a progress bar and a timer of 11 seconds but that is it. I thought it was ar