How to abort Continuous Acquisition (which is set to acquire a constant number of samples per channel each iteration)?

Hi all

I would like to continuously acquire an input channel analog and, if necessary, be able to stop the acquisition as quickly as possible.

I use a card NI USB-6289. I implemented a DAQmx (voltage) analog input task, set the clock sampling DAQmx 'continuous samples' and the rate required (IE 1000, which is 1 kHz). For the acquisition, I used a while loop with inside the DAQmx Read with Terminal 'number of samples per channel', wired (IE 1000). The while loop waits until 1000 samples are acquired and therefore continuously reads the channel in uniform batches of 1000 samples every second ticking. The while loop can be easily interrupted when the DAQmx has completed the acquisition of the lot being 1000 samples, but it takes the DAQmx finish their current task.

My problem is how to stop the loop while the DAQmx Read lies in the middle to get 1000 samples WITHOUT delay all 1000 samples are received? Is it possible to interrupt the DAQmx Read?

I could reduce "the number of samples per second", increasing the responsiveness of the while loop, but this is not the solution I prefer. I tried to destroy the task (outside the while loop), but that does not stop immediately the acquisition, Read DAQmx still finish acquire 1000 samples. I've included an example Subvi. When I was using a PCI card, I used a timed while loop with inside the DAQmx Read with Terminal 'number of samples per channel' wired-1 (= which means ' read everything in the buffer "). In this case, it was easy to stop the acquisition at any time: the timed, while the loop is abandoned and the acquisition has ceased immediately. But it does not work with an NI USB-6289 map (see thread http://forums.ni.com/ni/board/message?board.id=170&message.id=386509&query.id=438879#M386509) because of the different way the data are transferred to the PC.

Thank you very much for your help!

Have a great day,

LucaQ

Hi LucaQ,

Your solutions are decrease of the number of samples, or record the time you want to stop and remove samples that have been acquired beyond this time. There is no other way to stop the actual reading out of the hardware store.

Flash

Tags: NI Software

Similar Questions

  • DAQmx: (almost) synchronous Continuous Acquisition / how to trigger Council transfer buffer?

    Hi :-) :-) :-)

    We have an NI USB 6289 acquisition card. I would like to continuously acquire an entry of 'almost' analog synchronously. How synchronous 'almost', I mean that when a Read DAQmx is executed (anytime), I would be able to recover all the data present on the PC AND buffer all data present on the stamp on the card at the time of the read command.

    In order to test the behavior of the DAQmx Read, I used the following DAQmx vi (for a life-long real I would need a loop structure, but it's just a theoretical experiment):

    DAQmx create task

    DAQmx Create Channel (polymorphic instance HAVE voltage)

    DAQmx Timing (instance polymorphic sample clock, Mode sample set on samples continues, the rate set at 1000)

    DAQmx Start Trigger (polymorphic instance Start / None)

    DAQmx beginning

    Here the program waits n seconds (variable), then

    DAQmx Read (instance polymorphic analog Wfm/1Chan N Samp, number of samples per channel-1).

    Buffer FIFO of Council seems to be large 8192 samples.

    If the time between the beginning of DAQmx and DAQmx Read is less than the approximately 8.2 seconds, DAQmx Read recover whatever it is, if it is more than 8.2 seconds, DAQmx Read retrieves 8192 samples. I expect this behavior: fills up the buffer Board it triggers the transfer of all data in the PC buffer and DAQmx Read reads the buffer of PC, it cannot recover data after the transfer has taken place.

    What should I do in order to force the transfer of data from the buffer of (even if not full) Board to the PC at the time of the DAQmx Read buffer while the timing is in CONTINUOUS mode? I would like to be able to recover all the data from the buffer of PC and the Board of Directors in order to have all the most recent data and without having to put in place an acquisition of finite samples and a circular buffer of software.

    I tried the DAQmx channel property node Analog Input/Properties Advanced options/General / Data transfer and data/memory transfer mechanism and set set of e/s, but it doesn't work or the DAQmx channel property node Analog Input/Properties Advanced options/General / Data Transfer and status of application for data/memory and set it to Onboard memory Custom threshold but I could not access the property of Custom threshold (this is not there!).

    I'm sure there's an easy way to do this but I did not understand as yet...

    Thank you!!! LucaQ

    I am inclined to agree with Ravens Fan.  However, assuming that you must use the USB DAQ for your application, a better way to implement your code would be as follows:

  • Error 50103 during continuous acquisition and triggering

    Hi all

    I'm ai0 data acquisition: 3 4 analog inputs (voltage) in continuous mode, display the data (tables and graphs) and data flow to TDMS files in a loop of the consumer.

    The same time, I want to be able to save "time windows" with my purchase. For example, I want to be probe ai1:2 and when the voltage exceeds a certain value, that is to say 0, 5V, I can trigger with analogue reference and get a certain amount of samples (finished samples) after and before (samples before). I am aware of how I can achieve this, an example of NOR is more useful: http://sine.ni.com/devzone/cda/epd/p/id/4840 .

    The problem is this: I don't want to stop the continuous acquisition which is already underway. If I try to start a new task (somehow "copy & paste" the example) that I get, as expected, error-50103, "the specified resource is reserved.

    So, is it possible to accomplish this task without having to fall on reserving resources problem? And if there is not a way could you suggest a way to make this front trigger and trigger sampling?

    Please find enclosed a snapshot of the code. I use a PCI-6254 with two SCB-68.

    Thank you and looking forward for you advice!

    Best regards

    Panos

    Have you seen this?

  • How to add items to a table 1 d with each iteration?

    Hello

    I have a 3 loop iteration For which gives a table of 5 elements after his execution. At each iteration of the loop, how can I add each item to its previous value to form a final picture of the cumulative sum of the parts? For example:

    Array of values for 1st iteration: [A, B, C, D, E]

    Array of values for 2nd iteration: [F, G, H, I, J]

    Array of values for the 3rd iteration: [K, L, M, N, O]

    How can I make the Final table being a cumulative amount of IE: [(A + F + K), (L + B + G), (C + H + M) (D + I + N) (E + J + O)]?

    Your help will be apreciated, thanks!

    The Add function is polymorphic. So, if you give 1 2 tables you will get a table that corresponds to the sum of each item. With a loop, you must use a node registry or feedback shift to keep track of the sum of the currents.

    For example:

  • How can I continue (the CS6 download, which stopped at about 75% re)?

    How can I continue (CS6 re download)? It stopped at about 75%. Thank you.

    Ready answer #1 in my upgrade to adobe photoshop is NOT download... It is said he is in action to do but has not moved an inch and continues to spend telling me, it will take 5 days to download 5 hours... Please help me! for ideas

  • How to stop the acquisition with a relaxation with the NI PCIe-6323

    Hi all

    I wonder if it is possible to stop data acquisition or pcie-6323 with a trigger pulse the same way that I begin to acquire samples with a finished sample mode trigger pulse.

    Thanks in advance

    M.

    The samplesPerChannel that you can show what the sample clock configuration defines the total number of samples for the acquisition of finishes.  In your case, you will read the data previously triggered so permanently in force this setting really only sets the size of the buffer.  If you want to just be large enough to avoid overtaking (although...) If the window you buy is potentially very short, you might want to explicitly configure the size of the buffer to something bigger and maintain the value of samplesPerChannel down so that the reference trigger can be accepted earlier).

    The numberOfSamples you specify when you start the player defines the number of samples for the next call for reading.  If you can read the small windows of streaming data to avoid having a blocking with a large timeout call.  If you do not want to change the time-out period, it is a property of the DAQStream class.

    The "continuous" examples (e.g. this one) should show how you can read back data asynchronous as it is acquired.  Your configuration looks more like a "continuous" example

    Since you want to start and stop using the same line as the trigger, perhaps an alternative to the evolution of the default read pointer would be to set up a central task of analog input with a relaxing break.  The caveat to this is that the break does not stop at the task and as soon as the line goes back to you will begin to acquire the data again - I would say using a meter to separate groups of samples in the buffer zone continued.  If you wish to purchase multiple windows of data in short succession well, then I would go with that instead to avoid having to restart the task (and potentially Miss samples during the restart of the task).

    Best regards

  • Continuous acquisition and synchronization of two scanners

    Hello!

    I use two scanners high-speed NI PXI-5124. I'm running a continuous acquisition as in the attached example. I have two questions:

    (1) is it possible to make life-long using another source of trigger software INSTEAD?

    (2) depending on the answer to the first question - how to synchronize two scanners? In the attached example scanners have the same source of the clock, and they receive the same synchronization synchronization signal so the sampling rates are the same, but there is a lag of random phase each time I start the acquisition.

    Thank you!

    IVA

    Hello, Mateusz!

    I just apply the idea in the examples, as well as ideas from here, and here is the solution that works.

    Thank you!

    IVA

  • How to read continuously from the rs232?

    Hello

    I'm new to LabVIEW and my questions would be obvious for some for you. So please help if you know the solution.

    It's for my school project. For your information, we need to schedule a Committee of Altera DE2 to control traffic lights (something like that) and at the same time, the Commission shall forward the States of enlightenment to a computer with LabVIEW installed via an RS-232 cable.

    The rest of the project was fine except for the part of LabVIEW, because as I said earlier, I'm new to LabVIEW.

    We use the "basic series write and Read.vi" in the folder examples of NEITHER. The problem is that we do not know how to change the vi in order to receive the data that come the DE2 Board permanently. Each time, the vi stops reading after receiving 24 bytes of data.

    So, the first question is:
    1.) how to read continuously from the RS-232 port? (We tried to use while "loop" but without success, maybe we were doing it the wrong way.) If you know the solution, please enlighten us for us in a detailed manner.

    (2) Secondly, once we have received the 'chain', how can convert us to bits (0 and 1) so that we might be able to manipulate the bits, for example turn on the LEDs that correspond to the bits.

    Thank you.

    Instead of reading the bytes of the port so to read that many bytes (which may be zero), just do a VISA read for 1 byte.  He will wait for this next byte.

    To get an array of Boolean out of this byte, use this code.  He turns the characters into a byte array.  Takes the first and the only element of this array, and then converts this single U8 number into an array of bytes.

    Which country are you?  I've never seen or heard lights orange before.  Only the yellow lights.

  • going on a computer: how to cancel the password which is necessary for the opening of the computer

    How to cancel the password which is necessary for the opening of the computer

    Do you mean that a password is required immediately after you turn on the computer or when you arrive at the Welcome to Windows screen? If the first case, it is a BIOS password and how you disable it depends on what type of computer you have. If the latter:

    Set up Windows to automatically connect (MVP Ramesh) -http://windowsxp.mvps.org/Autologon.htm

    If you would like more information or is not what you mean, please explain your post.

    MS - MVP - Elephant Boy computers - don't panic!

  • "Windows needs your permission to continue" - where is the setting to remove this message when you perform tasks?

    "Windows needs your permission to continue" - where is the setting to remove this message when you perform tasks? Thx a lot...

    Windows needs your permission to continue, where is the setting to remove this message when you perform tasks? Thx a lot...

    Windows needs your permission to continue, where is the setting to remove this message when you perform tasks? Thx a lot...

    You probably means User Account Control. Here's how to disable: http://www.howtogeek.com/howto/windows-vista/disable-user-account-control-uac-the-easy-way-on-windows-vista/

  • How can I continue to use the serial number I already paid?

    . I have a student 2013 Adobe Suite, but when I download creative cloud on my new laptop, there is not even a prompt to enter the serial number? How can I continue to use the serial number I already paid?

    To continue to use the serial you paid for you simply continue using the software that the license has been purchased is valid for (which is all what you have bought in 2013).  Your Adobe Suite has no relationship with the creative cloud.  Your serial number is only valid for the product for which it was purchased.  If you want to use cloud products, you must purchase a subscription.

    Creative cloud plans

    https://creative.Adobe.com/plans

  • How focus a JavaFX Group properly and set the pivot (reverse) by using translations in 3D space?

    Description:

    I m referring to the Oracle tutorial http://docs.Oracle.com/JavaFX/2/transformations/jfxpub-transformations.htm using the transformations.zip source code, which is available for download on this page. I Don t understand why they Center the xylophone in space 3D like this and why they calculate the pivot (reverse) using translations. So they are creating a large number of groups, including rectangles, representing the xylophone, in addition to finally to a group called "cam".    

    class Cam extends Group {     
         Translate t  = new Translate();     
         Translate p  = new Translate();     
         Translate ip = new Translate();     
         Rotate rx = new Rotate();     
         { rx.setAxis(Rotate.X_AXIS); }     
         Rotate ry = new Rotate();     
         { ry.setAxis(Rotate.Y_AXIS); }     
         Rotate rz = new Rotate();     
         { rz.setAxis(Rotate.Z_AXIS); }     
         Scale s = new Scale();     
         public Cam() { 
              super(); getTransforms().addAll(t, p, rx, rz, ry, s, ip); 
         }     
    }    
    
    final Cam camOffset = new Cam();    
    final Cam cam = new Cam();    
    ...    
    camOffset.getChildren().add(cam);    
    ...    
    final Scene scene = new Scene(camOffset, 800, 600, true);    
    ... 
    

    The Group "cam" is added to another group called "camOffset", which is added to the 'scene' as root the node.

    Until there , everything is understandable to me, but there is a method, called "frameCam (.)" which calls 4 other methods: ""

    public void setCamOffset(final Cam camOffset, final Scene scene) {         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         camOffset.t.setX(width/2.0);         
         camOffset.t.setY(height/2.0);     
    }    
    
    //=========================================================================    
    // setCamScale    
    //=========================================================================    
    
    public void setCamScale(final Cam cam, final Scene scene) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         double scaleFactor = 1.0;         
         double scaleFactorY = 1.0;         
         double scaleFactorX = 1.0;         
    if (bounds.getWidth() > 0.0001) {            
         scaleFactorX = width / bounds.getWidth(); // / 2.0;        
    }        
    if (bounds.getHeight() > 0.0001) {            
         scaleFactorY = height / bounds.getHeight(); //  / 1.5;         
    }        
    if (scaleFactorX > scaleFactorY) {            
         scaleFactor = scaleFactorY;         
    } else {            
         scaleFactor = scaleFactorX;         
    }        
         cam.s.setX(scaleFactor);         
         cam.s.setY(scaleFactor);         
         cam.s.setZ(scaleFactor);     
    }    
    
    //=========================================================================    
    // setCamPivot    
    //=========================================================================    
    
    public void setCamPivot(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;        
        final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
    
    //*1*        
         cam.p.setX(pivotX);         
         cam.p.setY(pivotY);         
         cam.p.setZ(pivotZ);         
    //*1*        
    
    //*2*        
         cam.ip.setX(-pivotX);         
         cam.ip.setY(-pivotY);         
         cam.ip.setZ(-pivotZ);         
    //*2*     }    
    
    //=========================================================================    
    // setCamTranslate    
    //=========================================================================    
    
    public void setCamTranslate(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         cam.t.setX(-pivotX);         
         cam.t.setY(-pivotY);     
    } 
    

    If the method ' setCamScale (...) 'is understandable,' setCamOffset (...) ' puts the root node ('camOffset') in the center of the screen, but I Don t understand the 2 following methods at all. Of course, the child ("cam") is not centered, by putting just the root node ('camOffset') in the center of the screen, but how they focus the xylophone / "cam" and set the pivot, using translations:

    Questions:

    1. Why they use 3 different translations (', 'ip', 'p')?
    2. Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called? That would be my guess, because I expect that an object is placed in the same position as before, if I first move with the values X, Y, Z and then return with the same values - X, - Y, - Z in the opposite direction.
    3. Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    Annotations:

    Of course it works, the xylophone is located in the center of the screen and could turn perfectly, without change of rotation point / pivot point, but I Don t understand how they did it. I read everything about layoutBound, boundsInLocal, boundsInParent, blogs about page layout and page layout goes into javaFX https://blogs.oracle.com/jfxprg/entry/the_peculiarities_of_javafx_layout and http://amyfowlersblog.wordpress.com/2011/06/02/javafx2-0-layout-a-class-tour/ and finally a large number of questions to stackoverflow, but I still Don t understand the meaning behind the methods stated.

    Before the call of ' frameCam (...) ', they ask:

    double halfSceneWidth = 375;  // scene.getWidth()/2.0;     
    double halfSceneHeight = 275;  // scene.getHeight()/2.0;    
    cam.p.setX(halfSceneWidth);    
    cam.ip.setX(-halfSceneWidth);    
    cam.p.setY(halfSceneHeight);    
    cam.ip.setY(-halfSceneHeight); 
    

    I deleted these lines, because it doesn't change anything.

    The base in place, is that there are three defined different rotations, one around each axis. Of course, these could be combined into a single rotation, but doing so would make the geometry in the mouse dragging very complex managers. As it is, the degree of rotation around each axis can be calculated and changed independently.

    In general, the rotations are defined by an angle, an axis and a (pivot) point. The axis is a 3D vector and goes through the pivot point; the rotation is around this axis through that point.

    In the configuration in the example, the pivot of each of the individual rotations is set to the default (0,0,0). Because we really want the rotation to be around the center of the group, not the original, the Group translates first point appropriate pivot (ip), the rotations are applied then (around (0,0,0) after translation by ip), then the group is reflected in its location of origin (p). These operations are not commutative, yes show ip, then the rotation, then p is not the same as when you run ip, then p, then the rotation (in the second, ip and p would cancel and rotation would be about (0,0,0) instead of around the Center).

    For good measure, there is a scale, that is also applied after ip (so that scaling occurs from the Center, not the original) and then a final translation.

    The final effect is that there is a lot of transformations that can be controlled independently. There is a scale (s), a rotation about each axis (rx, ry, rz), and a translation (t). The p in translations and its inverse ip are just "housekeeping" to ensure that rotation and scaling are done from the center of the screen, instead of (0,0,0).

    So:

    1. Why they use 3 different translations (', 'ip', 'p')?

    p and ip are translations for the rotation and scaling are done from the Center and not to the origin. t is a general translation, the user sees.

    Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called?

    He puts the group to its original position, but other changes are between p and ip. These transformations behave differently (in a planned way) because the group is translated when they are applied.

    Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    The t values are changed in the mouse Manager (with alt-middle mouse button-drag, which I can't test actually using my trackpad...). As you have noted, the effect of p and IP translation cancel out, so we end up with t, which can be changed by the user. They could have combined t and p a single transformation, but updated since the mouse Manager would have been more delicate, and the intent of the code would be less clear.

  • How to create a script which gives all depedencies an object in 11g

    How to create a script which gives all depedencies an object in 11g

    You can use dba_dependencies for this... go through the manual.

    I don't know in this thread, someone will come up with the query for you, but there is another approach is:

    in sqlplus:

    SET SERVEROUTPUT ON SIZE 1000000
    EXEC  dbms_utility. get_dependency ('TABLE','SCOTT','EMP');   -- object_type,user,tablename as parameters
    

    See you soon,.
    Manik.

  • How to customize my editable which create a page template?

    I created a set of templates. It contains an edit box in each model. There is a problem when I create a new page of models, I can not add tables inside. He said: "this change should change the code which is locked by a model or a translator. The changes will be rejected. "I need to open any freedom for my clients to customize their editing area. How can I solve the problem? Thank you

    I have to ask - are you certain that your cursor is in a combo box when you try to insert a table?  I always use the code view because it is difficult to determine where the cursor is in design mode.  I have a few set models in place on another machine, I'll play with the table insert.

    -Is John is-

  • In Thunderbird, how can I import more than one set of subfolders to my old e-mail program?

    I recently changed my Thunderbird in Microsoft Outlook Express (which I still installed), on which I had two separate 'identities', each with its own address book and all of the subfolders. The installation successfully put in place two new sets of files in Thunderbird (Inbox, etc.), one for each of my previous and identities managed to recover all the data from these two address books, combining them in the process, but it has recovered only a set of subfolders. Is there a way I can copy the another set of folders everywhere?

    I'm sure I've answered this question this morning. have posted us more than once on the same topic?

Maybe you are looking for

  • How to start the connection broadband with Portege R930

    HelloThe manual doesn't really explain how to start a connection with the R930 broadband.I have a SIM card but not express or the smart card into the card slotWhich one should I buy? The blue button on the touchpad is always turned on, but there is 2

  • Unknown device on Satego P100-10U

    First of all, sorry for my very bad English :-( I install XP and now the system to say that I have an unknown device and a PCI device without driver. I think one of them is the sound card, but I can't install the rather. "Device not found" is the mes

  • Iteration of the loop only to store data

    Hello wouldn't be a good practice to use a while loop with: his terminal State forced true, Register shift not initialized The idea is to store information useful to a VI only and avoid the addition of a registry to offset for the moment inside the m

  • BlackBerry Z10 do not Enter / symbol then in text conversations!

    In the conversations of text... im not get symbol of entry when sending text. It seems if I start a fresh text.

  • Inspiron e1705

    My aunt recently gave me this computer and it turns out it was a corrupted hard drive so I corrected and upgraded windows xp to windows 7 currently, I have the same 1 GB of ram (2 STICKS OF 512 MB each). I would like to upgrade to the limit of 7 Home