DAQmx Trigger

I have two questions for the VI in attachment. I hope someone can help me :-)
1° The trigger does not work properly: measurements should start whenever the given value ( "Level" * hammer sensitivity) is reached on channel 0. In fact, if I make the value almost 0, it still doesn't work.
2° The charts should have a "memory" of 6 seconds: ( 10kHz rate at 10k samples per second and chart memory is set to 60k ).
After plotting those 6 seconds the program should stop ( therefore I used a for-loop, but I'm not too sure what number I have to attach to 'N').
Any suggestions?
Thank you in advance.
Dries
Attachments:
Daqmx_trigger.vi ‏40 KB

Thank you for your reply.
I don't know property nodes very well, but I already read something about wiring an empty array to the History Data property. The problem which occurs here is the following: if I create an empty array and I want to wire it to the History Data property of that Chart, the following error shows up:
Array element conflict:
The type of the source is 1D Array of Double, the type of the sink is 1D array of waveform.
I've tried to change the 'represetation' of the array, but the '1D array of waveform' type is not shown in the list.
About the reference trigger:
If I change the Trigger to a Reference Trigger, set the pretriggered samples to 1000 and run the VI, I get the following error:
Possible reason(s):
Measurements: Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.
Attempted to Read Sample: 22362
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value:
Task Name: _unnamedTask<8>
Now if I take a look at the Labview Help for Reference Analog Edge Triggering, I read the following:
"When you use a Reference Trigger, the default for the read RelativeTo property is First Pretrigger Sample with a read Offset of 0."
Does this mean that I have to use the DAQmx Read Property Node? If so, could you explain me how I have to use it?
Many thanks in advance,
Best regards,
Dries

Similar Messages

  • Differences in DAQmx Trigger (VI)

    I am trying to figure out why DAQmx Trigger VI works differently with different hardware.
    Case 1; using PXI-6133 and Reference Analog Edge version of VI
    Case 2; using PXIe-6368 and Reference Digital Edge version of VI
    My users have shown me that using an analog signal on an analog channel for a trigger source in both cases works.  Now, using the same trigger source conditions, I want to use a PXI-6133 and Reference Digital Edge version of VI.  This does not work.  Why?
    My goal is to create a subVI that will use the appropriate DAQmx Trigger VI, given the source trigger hardware.  My application will aquire 2 sets of data simultaneously on different hardware.  One set based on a trigger, one set continueuosly.  Does this seem unreasonable? 

    TrigConfig.png - code from main VI that create parameters for Trigger
    Setup Triggers.vi - subVI that configures Trigger
    Kevins_Triggered Fast DAQ.vi - working VI for PXI-6133 and PXI1045
    Attachments:
    TrigConfig.png ‏177 KB
    Setup Triggers.vi ‏39 KB
    Kevins_Triggered Fast DAQ.vi ‏45 KB

  • DAQmx Trigger Property Node in NI-9235

    我使用DAQmx Trigger Property Node不會顯示Analog Edge
    請問是否有辦法設定
    DAQ設備為cDAQ-9172和NI 9235
    另外想問
    NI 9235有辦法設定量測到的數據在超過某個值後才開始紀錄數據

    http://www.labviewpro.net/forum_post_detail.php?post=2010&fid=1
    請先閱讀上面文章
    再參考下面類似方法
    http://digital.ni.com/public.nsf/allkb/4859504F14AF68DB8625721100640F26

  • PXIe-4499 DAQmx Trigger

    I'd like to trigger off a rising edge on one of the analog channels, let's say AI0, on a PXIe-4499 card however I can't seem to figure out how to specify the trigger source. I'm using the "DAQmx Trigger.vi" and the documentation says the following:
    "source is the name of a virtual channel or terminal where there is an analog signal to use as the source of the trigger"
    I tried creating a virtual channel with no luck and have looked through the 4499's documentation but haven't been able to find a reference to source names.
    Can anybody offer a suggestion or point me in the direction of an example?

    Hello bww,
    The example you are looking for can be found on this page. The source you specify will be the signal that triggers the acquisition.  This signal can come through the PFIO for your device, the PXIe chassis backplane, or the Analog Input channels. For your purpose (correct me if I am wrong) you want to acquire on AIO and begin the acquisition when the analog signal (AIO) is above a certain level? Then I would recommend configuring the example to look like the item below.
    Regards,
    Izzy O.
    Applications Engineer
    National Instruments
    www.ni.com/support

  • Use Daqmx Trigger to initialize software

    Hello,
    I am using an NI PCIe-6537B to run an SMB-2163 High-Speed DIO Accessory.  I have a high speed camera sending out triggers whenever a frame is captured.  Each time the trigger is received into PFI4, a digital output (DIO#) sends out a waveform. 
    I would like to know if it is possible to read that trigger so that I can use it to trigger other things in the software "simultaneously."
    I have attempted to simply read PFI4 as a digital input (Digital Bool 1 Line1 Point) while also using it as the external trigger.  It worked for a while but after I left the project it now seems to only randomly read when the trigger is sent.  Not knowing what changed since it last worked, am I doing this correctly or is there a better way to do this?  Perhaps using the Daqmx events.
    Any help is greatly appreciated!
    Thanks,
    Mike S.
    CLAD
     

    Hey Mike,
    A couple of things here.  Firstly, for the Change Detection timing type, you will not need to use the event structure in your program.  This is implemented in hardware, with samples being latched when the configured lines show the change.  Basically, every time the configured line changes, the DAQmx read will return the values of all lines configured for your channel.
    Also, you will not be able to use PFI4 as the source for change detection.  You will have to specify a data line (ports 0-3) for use with the change detection timing type.  Here's some documentation I could find about using this:
    http://www.ni.com/white-paper/4102/en/
    http://digital.ni.com/public.nsf/allkb/4B9452520950566A86256F31006C9AEF
     

  • Daqmx Trigger Indication

    How can I get an indication to the front panel that an acquisition event has triggered using Daqmx?
    I've set the system to pretrigger on a falling edge, which works fine, however, the end user does not get an indication that the system has triggered until after Daqmx Read.vi has finished reading all the data.......12 seconds later (duration of acquisition event).  I'd like the user to get the indication at the moment the trigger threshold parameters have been met.
    I'm using LabVIEW 7.1, DAQmx 7.2.
    Thanks.

    I agree that a software trigger might be your best answer.  I cannot think of a good way without additional hardware to indicate to the user the occurrence of a hardware reference trigger.  The properties for available samples and total samples acquired will not give you the indication you are looking for with a reference trigger.  These are valid options for a start trigger.  If pretrigger samples are important to your application you can continuously read the samples into LabVIEW and programmatically determine the location you wish to trigger, saving your desired number of pretrigger samples and discarding the rest of the pretrigger data. There is an example already built for this in Help>>Find Examples by the name of "Cont Acq&Graph -Analog SW Trigger.vi".
    Hope this helps,
    Jennifer O.

  • DAQmx trigger AO from AI signal (error -200265)?

    Here's my problem:
    I have a PXI-6115 i/o card and I'm observing a waveform on ai0.  When the waveform reaches a threshold, I want to generate a waveform on ao0.  I tried looking at the example, "Cont Gen Voltage Wfm-Int Clk-Analog Start.vi," using ai0 as the trigger source but I get error 200265 (using an invalid trigger source).  I realized that the channel should be in the task if I want to use it as a trigger, but I can't add an AI channel to an AO task, so I'm kind of stuck.
    I've attached part of the code that I'm trying to use.  Any advice would be greatly appreciated!
    Attachments:
    trigger_ao_from_ai.vi ‏50 KB

    If your timing between Analog In and Analog Out is not critical, you could just use software triggering.  Get your AO setup with Start Trigger set to None.  Don't run it yet.  Get your AI setup to read 1 sample.  In a loop, put the AI read function.  Each loop iteration should return one reading.  When the reading goes below the threshold, call the AO Write function to send an output. 
    The trick is to not continuously call the AO write whenever the AI input is below the threshold, or it will be called on each loop iteration as long as the AI reading is below the threshold.  You can use a shift register to hold a boolean flag.  Drag down the shift register on the left side to create a previous state terminal.  Send the threshold compare output to the shift register.  On the left, you read both shift registers.  Trigger the AO when the top terminal is True and the bottom terminal is False (using AND and NOT).  This will trigger only once because on the next iteration, both will be True.  The threshold compare will have to go to False and then True again before the next trigger will occur.
    - tbob
    Inventor of the WORM Global

  • DAQmx trigger: start digital edge

    Buongiorno a tutti.
    Mi trovo a lavorare su un VI creato in precedenza da altri colleghi, quindi sto cercando di migliorarne alcuni aspetti.
    Lo strumento si occupa dell'acquisizione di segnali di temperatura e pressione da svariati sensori. I colleghi hanno inserito una fonte di trigger esterna attraverso un generatore di funzione (tektronix AFG3021C). In allegato una immagine della sequenza precente al ciclo while di acquisizione ed elaborazione dei segnali.
    La mia domanda è questa: "è possibile ovviare all'utilizzo del generatore esterno di funzione?"
    Grazie
    Luca 
    Allegati:
    acquisizione.jpg ‏155 KB

    Ciao Luca,
    strano che non ti compare niente, prova a cancellare l'intera funzione e richerla, dovrebbe almeno apparirti i vari PFI della scheda DAQ che hai collegato al PC... Sei sicuro di aver collegato qualcosa?
    In ogni caso ***** vuoi come trigger una forma d'onda generate internamente, quello è un trigger software, prova a guardare questo esempo:
    https://decibel.ni.com/content/docs/DOC-35941
    Buon lavoro e buona giornata,
    Valerio

  • How to sync and/or trigger NI-DAQmx devices in LabView

    I am using LabView 2009 with a cDAQ-9174 chassis that includes a NI 9263 analog out device and a NI 9222 analog input device. I've learned from the examples that I can sync the devices to the same sample rate. But I am looking to sync the devices such that the exact moment I start acquiring input data on a 9222 channel, the 9263 starts generating an output. Secondly, I am interested to know when using just this equipment, is there a way to very accurately trigger one device off the other with some delay. So in summary I am interested in two behaviors:
    1) Synchronize a 9263 output channel to a 9222 input channel, such that the start of a 9222 analog input measurement triggers a 9263 analog waveform output. and,
    2) Have the 9263's analog output start for example EXACTLY 100 samples (provided sample rates are synced) after the 9222 starts collecting data. In other words, a delayed trigger.
    I imagine this is preferably done in hardware such that no software delays occur. Is this possible using these devices? Or do I need some external clocking mechanism?
    Thank you!
    Solved!
    Go to Solution.

    Hi tzoom84,
    Going back to your original questions,
    To do 1) and 2), I don't think you need to use counters.
    The shipping example LabVIEW 2010\examples\DAQmx\Synchronization\Multi-Function.llb\Multi-Function-Synch AI-AO.vi is probably a good starting point for 1). (Possible problem: if you're using multiple AI timing engines at the same time, this example's assumption that the AI task has "ai/StartTrigger" is not valid. If this turns out to be an issue, you may need to replace Get Terminal Name With Device Prefix.vi with the DAQmx Trigger >> Start.Term property and add a call to reserve the task.)
    For 2), add the DAQmx Trigger >> Start.Delay and DAQmx Trigger >> Start.DelayUnits properties to the AO task:
    If you really do need to use counters, you can do so without the NI 9401 by using cDAQ1/_ctr0 through cDAQ1/_ctr3, which are internal channels: How do I Access Internal Channels on any DAQmx Device?
    Brad
    Brad Keryan
    NI R&D

  • How to use Counter/timer PWM Pulse as a trigger to aquire data??

    (1) I'm using the NI DAQpad 6015 multi-function card with the new DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. In addition to that, I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just at the 2.5 m.sec point of the high state).  
    (2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
    Attached is the VI i'm using (Complete PWM.vi)
    regards,
    Attachments:
    Complete PWM.vi ‏49 KB

    Hello alaali,
    It sounds like what you need is a trigger delay property node.  This property node specifies an amount of time to wait after the Start Trigger is received before acquiring or generating the first sample. This value is in the units you specify with Start.DelayUnits.  This way you can still acquire using the trigger, and you can specify the delay to be 2.5 ms so that the point that you actually acquire will be 2.5 ms after the trigger.
    Hope this helps.
    Regards,Message Edited by Raajit L on 04-23-2007 04:34 PM
    Raajit L
    National Instruments
    Attachments:
    DAQmx Trigger Delay.jpg ‏6 KB

  • How to generate sequence of pulse trains with DAQmx?

    I need to generate a sequence of pulse trains with DAQmx (the card I have is a PXI-6229 card). As an example:
    - 10'000 pulses at 20kHz every 5 seconds with an initial offset of 2 seconds (let's say 10 pulse trains in total).
    If I use the CreateVirtualChannel.vi in "CO pulse ticks" mode, I can only specificy offset, high ticks and low ticks, but not that the sequence of pulses should be repeated after some time. 
    Now I thought that I could solve this problem if it were possible to multiply two counter outputs: the first counter would generate the pulses (continuously) whereas the second one would switch between low and high on a slower timescale in order to gate the first counter, thereby providing an initial offset and the "off" phases between the pulse trains.
    Is it somehow possible to multiply two outputs with DAQmx and the card I have? Or is there another solution to the problem?
    Thanks a lot in advance for any hints!

    Hi dlanger,
    what you want to do requires a little bit more work. 
    First look at the example "Gen Dig Pulse Train-Continuous.vi" from the LV example finder.
    This example generates a continuous* pulse train. As you see, you need a sample clock VI for setting the sample mode. 
    * NOTE: Generating a finite pulse train with a M-series card requires 2 counter.
    With a pause trigger (DAQmx trigger property node) you can gate the output of that counter.
    Now you have to generate a gate-signal with the the 2nd counter. That means, only if  Ctr1-out is high Ctr0-out outputs the 20 kHz-signal. 
    Maybe you have to adjust the times in my example a bit. 
    Unfortunately there is just one "small" problem: "let's say 10 pulse trains in total" 
    This is not possible, because a 3rd counter would be necessary (*). 
    As a workaround you can modify the while-loop that both tasks are cleared after 50s. This is not brilliant, but should work fine for you. 
    A more sophisticated way is to perform a correlated DIO. So you can generate custom pattern for multiple outputs. 
    A good example can you find here: 
    Retrigger and Repeat Finite Digital Pulse Train in LabVIEW
    http://decibel.ni.com/content/docs/DOC-8473 
    or here:  
    Generating More Than 2 Pulse Trains Using CompactDAQ
    http://decibel.ni.com/content/docs/DOC-2167 
    Hope this helps.
    With best wishes,
    Ralf N. 
    Attachments:
    Gen Gated Dig Pulse Train-Continuous.vi ‏38 KB

  • How can i use an ao card (pci 6723) to output data and to trigger an ai o acquire the data coming from the ao card?card (pci 6254) t

    Hello
    I am trying to perform AO (pci 6723) and to trigger my AO card (pci
    6254) to read the data coming from the AO card. I am using LV7,1,
    win2000.
    Is an RTSI cable necessary or I can connect the trigger signals externally ?
    I am using the LV example " multi function - synch ai-ao.vi" but i can't for some reason configure the trigger lines.
    thank you in advance for your time.
    Yiannis

    Hello Yiannis,
    If I understand you correctly, you want to synchronize your analog input and analog output that are started by a trigger on the analog input board. If you don't want to use the RTSI lines, your best bet is to export the AI Sample Clock and then read it in to the AO board. There is an example on ni.com called DAQmx - Synchronized AIAO Shared Clock. It appears to be having techincal issues so I have attached the example below. To export ai/sampleclock, use DAQmx Export Signal.vi after Get Terminal Name with Device Prefix.vi. Export Sample Clock to PFI3 (There are only connections between the sample clock and PCI3/4/8/9). Connect PFI3 on your AI board to PFI0 on your AO board (with a wire). Then change the source for the AO Timing.vi to Devx/PFI0. If you want to do triggering, stick the DAQmx Trigger.vi between the Timing property node and the DAQmx Start.vi on the AI task. I have shown how to do this in the modified version below. Please take a look at it and let me know if you have any questions. If you still get an error please take a screenshot of it and post to the forum. Have a great day!
    Sincerely,
    Marni S.
    Attachments:
    Synchronized_AIAO_Shared_Clock[Modified].vi ‏140 KB

  • Sync output timing to hardware trigger (PFI?)

    I'd like to sync the output of my cards (2 PCI-6733 connected with an RTSI cable, and using  BNC-2110's) to the AC power line of the lab I work in. That is, when told to output, they will always wait and output at the same point in the 60Hz cycle.  
    To that end, I've built a circuit that gives a TTL signal that is synced to the building's AC line. I now need to find a way to take this TTL signal and use it as the starter for my experimental sequence. If there is a delay that's ok, however it needs to be a consistant delay (to within a few microseconds preferably). This is so that everytime I run my experimental sequence, I'm starting at the same point in the AC power cycle.
    Is it correct to use the PFI port to try and do this? Other suggestions?
    The sequence would be:
    Step 1: Cards are ready to write
    Step 2: Cards write once, started by hardware trigger of the TTL from the circuit I built.
    Step 3: Other Labview code runs, and then returns to step 1.
    Solved!
    Go to Solution.

    Ok. Knowing about DAQmx export signal is definitely helpful. I don't think I've got everything set up quite right though, as it's giving me an error with what I tried. 
    Error -89136 occurred at DAQmx Start Task.vi:1
    Possible reason(s):
    Specified route cannot be satisfied, because the hardware does not support it.
    Property: StartTrig.OutputTerm
    Destination Device: Dev1
    Destination Terminal: PFI0
    Task Name: _unnamedTask<1E>
    I'm not sure on the correct order of the DAQmx functions. I currently have: Create Channel -> Timing -> Write -> Export Signal (?) -> Start Task. This doesn't seem to be the correct way to do this though. The sample you linked to had the Write after the Start Task... which doesn't quite make sense to me... In addition, I'm not sure where to put the DAQmx Trigger.vi in this sequence.
    Any pointers to set me in the right direction? I've attached a screenshot and vi of my current code to show you what I do now. 
    Attachments:
    Write2PCI6733 (SubVI).vi ‏54 KB
    WriteToPCIscheme_Mar9_2012.PNG ‏59 KB

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

  • How to sync CAN (traditional) and DAQmx input on PXI?

    At the moment I am reading analogue samples and counter values on my PXI system. The counter value is incremented by an external pulse (i. e. current time). Because the pulse is the actual time, the AI sampling has to start in sync with the first incoming flank. This sync'ing is done via the DAQmx trigger VI which is set to "start at flank" (see picture). Because I am recording the counter values, too, I can always determine the time for each AI sample.
    Is it possible to start AI and CAN signal sampling in sync with the first incoming pulse flank? As before, I want to store the counter values as well, so that I have time information for each sample. Is this sync'ing solvable with VIs or do I have to use a different CAN card with an external trigger input?
    The CAN card is of type 8464 XS.

    Hello,
    please see the links below.
    http://digital.ni.com/public.nsf/allkb/95EB3CB8E92D30FB86256F2C00672C44?OpenDocument
    http://zone.ni.com/devzone/cda/tut/p/id/4204
    Regards
    Rüdiger

Maybe you are looking for