Continuous data acquisition using NiDAQmx with a start and a stop trigger

I'm sorry if this has been answered many times before, I can't quite seem to find the answer I'm looking for.
I am using LabWindows CVI version 7 and NiDAQmx with a PCI6023E.
I wish to acquire data continuously using an external clock as a timebase - I am happy with this.
I wish the acquisition to start when an external signal (say on PFI7) goes high. I am also happy with this.
What I also need is for the acquisition to stop when the signal on PFI7 goes low, or possibly when a signal on say PFI8 goes high. I'm not too concerned about which approach to use.
How do I stop the acquisition with an external signal?
Thanks in advance,
Crispie

I don't have CVI installed, but I've attached screen shots of a LabVIEW program that I believe accomplishes what you are trying to do. Translating it to the C API should be straight forward. I'll try to explain what the program is doing since it's using some of the more advanced features of the driver. Also, the DAQ device you are using doesn't support a true "stop" trigger so I'm using a reference trigger to get as close to the desired functionality as possible.
First, the program configures a finite acquisition that uses both a start trigger and a reference trigger. The acquisition is using an external sample clock and will acquire 4 samples (2 pre-trigger samples and 2 post-trigger samples). Four may seem like an odd number here, but it allows us to emulate the functionality of a stop trigger as close as possible. Given this configuration, you must acquire at least 2 samples before the "stop" trigger is recognized, and you must acquire 2 more samples after the "stop" trigger is recognized. Hopefully this restriction is acceptable. You can always discard the last two data points after the stop trigger if they're not of interest, but you're stuck always acquiring at least two points between when the start and stop triggers are recognized.
The program also overrides the default buffer size and read position. By default, the DAQmx driver will pick a buffer size exactly big enough to fit the pre-trigger and post-trigger data (4 samples in this case) and will begin reading data from the start of the pre-trigger data. Explicitly allocating a larger buffer will allow your acquisition to execute without receiving buffer overflow errors, and changing the default read position will allow you to read all of the data between the start and stop triggers as it is acquired and not just the pre-trigger and post-trigger data.
Finally, the while loop takes care of reading the data. In this case, the loop continues to read data until the task is done and there are no longer samples available for reading from the buffer. The number of samples read per iteration is the lesser of the user specified amount or the number of samples available for reading from the buffer.
I hope this helps. Good luck.
Attachments:
Stop_Trigger1.JPG ‏40 KB
Stop_Trigger2.JPG ‏43 KB

Similar Messages

  • Looking to set a combination of channels to set-up a start and a stop trigger

    Hi,
    I have already set-up a VI to acquire data using traditional NI-DAQ. I am using DAQ board PCI-6033E, which has an SCB-100 to which are connected my sensors.
    I can acquire data in LabView using this set-up. I am looking for a simple VI which will allow me to scan any of the channels that I am acquiring data through and trigger my acquisition through software. I did see a lot of triggering VI's, but most of them were for hardware acquisition.
    Furthermore, I am also looking to make a combination, wherein I should be able to set-up a combination using more than 1 channel which could act as my trigger. I.e. If certain 'n' channels that i specify are 'high' start acquisition. Similarly for the stop trigger.
    Thanks,
    -Sachin

    Hello Sachin,
    If you look in the NI-DAQmx Help, you will see that you can select any AI Channel to trigger the acquisition of multiple channels. Keep in mind that you will need to make sure that the AI trigger source must be first in the scan list. With this in mind, I have created a quick example which takes a task, checks to see what channels are listed, then reorders that scan list by putting the trigger source first.
    I hope this helps. Let me know if you have any further questions.
    Regards,
    Sean C.
    Attachments:
    SelectableAnalogTrigger.vi ‏189 KB

  • 10.9.1 used terminal with rm-rf and deleted my user data. Can I get back the deleted data? Help.

    10.9.1 used terminal with rm-rf and deleted my user data. Can I get back the deleted data? Help.  I really just need mail file and desktop files recovered.

    If data were on the SSD drive with TRIM - practically no chance. If HDD - use DIY recovery software such as DiskDrill or DataResue.
    As quickly as possible turn off the drive where deleted data.
    Use an external HDD with installed OSX for data recovery.
    Alex
    Apple Certified Support Professional

  • Standalone application for data acquisition using NI DAQ card

    I have made a standalone application in labview GUI for data acquisition and signal processing. if i have to run this application in any other computer what all softwares should be installed other than labview runtime engine...NI DEVICE DRIVER CD alone is to be installed or do i have to install any other software for data acquisition using NI daq card??
      thanks and regards
    Solved!
    Go to Solution.

    You should only need the run time engine, The device drivers for the device, maybe need VISA drivers if you are doing serial or something of that nature, You may need the channels or tasks created in NI measurements and automation if you created them there.
    There may be other things that you will need depending on what you include in your code and what tool kits that you have installed.
    Tim
    Johnson Controls
    Holland Michigan

  • How do I use the commands to start and restart the jmqbroker normally?

    How do I use the commands to start and restart the jmqbroker normally?
    Because I have tried to use "jmqcmd shutdown bkr" and then tried to type
    "jmqbroker" to start up. My screen hangs up and seems that the process
    hangs up. The message is
    [28/Jun/2002:18:29:07 GMT+08:00] [B1060]: Loading persistent data...
    [28/Jun/2002:18:29:08 GMT+08:00] [B1039]: Broker "jmqbroker" ready.
    The prompt is hanged until I press CTRL-C.
    Then I got the following message:
    [28/Jun/2002:18:32:07 GMT+08:00] [B1047]: Shutting down broker...
    [28/Jun/2002:18:32:07 GMT+08:00] [B1077]: Broadcast good-bye to all
    connections ....
    [28/Jun/2002:18:32:07 GMT+08:00] [B1078] Flushing good-bye messages
    [28/Jun/2002:18:32:07 GMT+08:00] [B1056] Cleaning up persistent
    store...
    [28/Jun/2002:18:32:07 GMT+08:00] proceessing 0 messages and cleaning
    up 0 files...
    [28/Jun/2002:18:32:07 GMT+08:00] [B1063] Done
    [28/Jun/2002:18:32:07 GMT+08:00] [B1048]: Shutdown of broker complete.
    Then, I use jmqadmin to invoke the console, I can start the broker
    again, it gives me
    Error encountered while connecting to the broker: "MyBroker":
    Broker Host: 'localhost'
    Primary Port: '7676'
    [C4003]: Error occurred on connection creation, - caught
    javax.jms.JMSException
    Please verify that there is a broker running on the specified host and
    port.
    I used ps -def | grep jmq there is no process anymore.
    Is it a bug? Would somebody have any idea on what went wrong?

    'jmqbroker' is the command to start a broker.
    When you type 'jmqbroker' in a command window,
    unless you put it in the background, the shell
    prompt won't return until the broker is shutdown.
    So when you see 'Broker "jmqbroker" ready.', it tells
    you that the broker is running and is ready.
    When you CTRL-C the process, it has the same effect
    as using jmqcmd to shutdown the broker. And so after that,
    there's no jmq processes running since you have just
    shutdown the broker.
    Remember that the jmqcmd/jmqadmin 'restart' command is to
    restart an already running broker. jmcmd/jmqadmin does
    not support starting a new broker instance.
    If you are using csh, end the jmqcmd command with an ampersand ("&")
    to have the broker running in the background. An alternative is to
    stop the process with Ctrl-Z then input the command "bg" to have that
    process resumed in the background.
    The problem with not being able to start a broker using the
    administration console is a documented limitation of the product that
    Yvonne also mentioned. Check the Administrator's Guide for that.

  • How can I use LCCS with ActionScript 3 and Flash CS4?

    Hi,
    Using Stratus I was able to create an an application using Action Script 3 and Flash CS4.  The sample code on the Adobe site was quite straight forward and easy to understand.  I now want to switch over to  LCCS but can't find anything any where on how to use Action Script 3 and Flash CS4 with LCCS.  Do I need to know Flex to be able to use LCCS?  Everything was quite simple and easy to understand with Stratus and makes complete sense.  But LCCS is really confusing.  Is there any sample code on how to establish a connection in Action Script 3 and then stream from a webcam to a client.  There is nothing in the  LCCS SDK that covers Flash and Action Script 3.  Please help!  I found the link below on some forum but it takes me nowhere.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=75 9&threadid=1407833&enterthread=y

    Thanks Arun!
    Date: Thu, 29 Apr 2010 11:44:10 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I use LCCS with ActionScript 3 and Flash CS4?
    Hi,
    Welcome to the LCCS world.
    Please refer to the SDK's sampleApps folder. There would be an app called FlashUserList. The app demonstrates how LCCS can be used with Flash CS4. Its a  pretty basic app, but should help you moving.
    We are trying to improve our efforts to help developers in understanding our samples. Please do let us know if we can add something that would help others.
    Thanks
    Arun
    >

  • "Accounting-Start" and "Accounting-Stop" with same "user name" and "session Id" recorded in different RADIUS servers.

    Hi,
    I have questions about "Accounting-Start" and "Accounting-Stop".
    1.If a NAS configured to have a primary and a backup RADIUS server. To start with all the “Accounting-Start” records will be in the primary RADIUS server. Later on the primary server goes down (Primary server won’t tell the NAS?). When sessions stop, the NAS sends the “Accounting-Stop” to the secondary. I understand the “Start-Stop” record with the same “user name” and “session-id” ideally should be recorded in the same server. If this situation happens what should both the NAS and RADIUS server do?
    2.A NAS configured to have a primary and backup RADIUS server. To start with all the “Accounting-Start” records will be in the primary RADIUS server. Later on the administrator decided to change the primary server (as there are problems with the previous primary). sessions stop, the NAS sends the “Accounting-Stop” to the new primary. This ends up the “Accounting-Start” and “Accounting-Stop” with the same “user name” and “session Id” in two RADIUS servers.
    To summarize, how to avoid the ”start-stop” pair ends up in different servers ? If it does, is it  an issue for RADIUS application ?
    Cheers,
    1.If a NAS configured to have a primary and a backup RADIUS server. To start with all the “Accounting-Start” records will be in the primary RADIUS server. Later on the primary server goes down (Primary server won’t tell the NAS?). When sessions stop, the NAS sends the “Accounting-Stop” to the secondary. I understand the “Start-Stop” record with the same “user name” and “session-id” ideally should be recorded in the same server. If this situation happens what should both the NAS and RADIUS server do?
    2.A NAS configured to have a primary and backup RADIUS server. To start with all the “Accounting-Start” records will be in the primary RADIUS server. Later on the administrator decided to change the primary server (as there are problems with the previous primary). sessions stop, the NAS sends the “Accounting-Stop” to the new primary. This ends up the “Accounting-Start” and “Accounting-Stop” with the same “user name” and “session Id” in two RADIUS servers.
    To summarize, how to avoid the ”start-stop” pair ends up in different servers ? If it does, is it  an issue for RADIUS application ?
    Cheers,

    vignesh and BalusC,
    following is the code in front controller's doFilter method. is this not thread safe?
            HttpServletRequest req = (HttpServletRequest) request;
            HttpServletResponse res = (HttpServletResponse) response;
            HttpSession session = req.getSession();
            somepackage.User user;
            if(session.getAttribute("user") == null){
                user = new somepackage.User();
                session.setAttribute("user", user);
            }else{           
                user = (somepackage.User) session.getAttribute("user");
            }user object maintains all information about a user. if it is in session scope, everything should work fine.
    another observation is after some time of usage, both people in different systems are getting same session.getId()
    in my logout page i am using
    session.invalidate();
    thanks,
    moses

  • I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    There is no more LiveType with Motion 5.  You may want to go to the Final Cut Express forum, as that's the only place it's existed for the last few years.

  • Using Icloud with Outlook 2007 and windows 7, I cannot get my calendar to list the scheduled appointments as it used to do before I cloud.  The to do bar just shows no upcoming appointments when my calendar is filled with them.  How do I fix this

    Since using ICloud with Office 2007 and Windows 7, the to-do-list will not show any appointments.  If has the notation that no appointments are available?  My calendar is full of appointments.  How do I correct this?

    I don't have a password on my phone. After attaching the phone to the Windows 7 computer, my DCIM folder is always empty. Here's the solution:  While the phone is plugged in to the computer, pick it up and select the Photos application. A dialog box appears and asks if you trust this computer. Obviously, select the "Trust" option. Then the photos will download. If you have a password on your phone, I'm guessing you have to enter it before you open the photo application.

  • I am using Firefox with OS X and suddenly I lost the slot in which I type URL's in the top of the browser. How can I get it back?

    I am using FIREFOX with OS X and suddenly I lost the slot at the top of the browswer in which to type the URL's. It just disappeared.
    How can I get it back?

    View --> Toolbars --> Navigation Toolbar

  • Hello! I'm using Aperture with Efex plugins and notice, what when I saving result in plugin and go back to aperture, preview mode is going to grey color and not working until I reboot Aperture. Did you saw this problem?

    Hello! I'm using Aperture with Efex plugins and notice, what when I saving result in plugin and go back to aperture, preview mode is going to grey color and not working until I reboot Aperture. What is intresting - in full screen mode everything works fine. Did you saw this problem?

    It seems there's a workaround here:
    https://discussions.apple.com/thread/5566037?tstart=0

  • The visual Studio Test controller service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs

    We are using VS2013 Premium. i have installed vs2013 Test controller in my dev environment. While i am configuring (https://msdn.microsoft.com/en-us/library/hh546459.aspx) getting error message in
    the Configuration summary dialog box displaying following error's : 1. Failed to Configure TFS Team Project Collection, 2. Could not complete operation as the time out expired. ''
    I have checked the "visual Studio Test controller " in the
    Services --> Administrative. Its automatically stopped the service. When i started the manually its showing message like as 'The visual Studio Test controller
    service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs'
    Please guide me how to resolve this problem. 
    Thanks in Advance...

    Hi Divakar,
    What’s the version of your TFS?
    How do you configure the test control?
    Please make sure you are specify the team collection instead of team project.
    On the other hand, you may enable test controller logs. (You could share the log file on the OneDrive)
    # How to enable test controller logs
    http://blogs.msdn.com/b/aseemb/archive/2009/11/28/how-to-enable-test-controller-logs.aspx
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    Connect an iPad to a Television or Projector
    http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
    Connecting iPad iPhone or iPod to TV or Projector
    http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    http://www.apple.com/airplay/
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    http://support.apple.com/kb/ht4108
    http://support.apple.com/kb/ht4108
     Cheers, Tom

  • Integrtion Scenario using BPM with two sender and multiple receiver

    integrtion Scenario using BPM with two sender and multiple receiver
    How many Application Components are required?

    Hi Vinod,
    1) In integration repository you can have one or many software components it depends on your landscape orchestration
    2) In integration direcory you need at least one service for bpm and one or many for each system in your bpm
    also each connection between systems and bpm must have receiver determination and so on.
    Advice: Please treat BPM as a separate system.
    best,
    Wojciech

  • I have a new ipad which needs itunes 10.7 or later to download my music onto it... but my ipad is not compatible with this as it is too old... can i use itunes with this ipad and apple laptop?

    I have a new ipad which needs itunes 10.7 or later to download my music onto it... but my apple laptop is not compatible with this as it is too old... can i use itunes with this ipad and apple laptop?

    To use itunes 10.7 you need to have Snow Leopard operating system installed
    These are the system requirements
    System Requirements:
    Mac computer with an Intel processor
    1GB of memory
    5GB of available disk space
    DVD drive for installation
    Some features require a compatible internet service provider: fees may apply.
    If you can run Snow Leopard you need to purchase it
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard

Maybe you are looking for

  • Internal Order - Detick revenue posting

    Hi We have created an Internal Order type (KOT2) couple of months ago allowing revenue posting. Now I want to detick the allowed revenue posting of that perticular Internal Order type and transport it to the production server. My question is if I det

  • Retrieve data from AD from within a custom sharepoint 2010 webpart

    Hi, I have a requirement to retrieve user data from AD and display from within a custom built webpart. I am using the PrincipalContext class etc to get the info from AD, i have sucesfully done this in a console program without having to specifiy a us

  • Wireless connection between 2 routers

    Hi All, I have 2 wireless routers. Router A is connected to the internet, and router B is a WRT54G and is connected to a computer. I want to have a network set in the following way INTERNET--wired-->ROUTER_A--wireless-->ROUTER_B--wired-->COMPUTER How

  • Urgent help for linking file

    hi i am a noob in this area..can someone plz help me.. well i have to do a link where it will open the latest file.. how do i do tat...................... String file = "C:/"; File f = new File(file); String [] fileNames = f.list(); File [] fileObjec

  • Error on loadjava with log4j

    Hi. I have a problem loading jar file: oracle 9.2.0.7.0 on unix server with jvm 1.3.1 Using sqlplus I didn't receive any error (PL/SQL procedure successfully completed.) on loading log4j-1.2.14.jar with the following command 6 java class (org/apache/