reading non-blocking

Hello

I'm trying to implement a lock read along the lines of peekdata() in matlab http://www.mathworks.de/access/helpdesk/help/toolbox/daq/index.html?/access/helpdesk/help/toolbox/da...

I found I can do readings not blocked from using the reading + http://forums.ni.com/ni/board/message?board.id=230&thread.id=2862 reminders

Is there another way to get non-blocking reads?   The reason is that if the above, I've implemented the matlab Matlab mex interface calls the file (mex) C and I do read (must wait the trigger occurs) before returning from the C file (aka it becomes again blocking). So that callbacks are not really useful if the thought in a single thread passing that matlab works.

Thanks for reading.

The way in which the driver is written is to block on a reading DAQmx.  In a single threaded method will always call blocking as I know.

Tags: NI Hardware

Similar Questions

  • Web HTTP proxy using IO Non blocking

    Solved thank you...

    customer. Register (selector, SelectionKey.OP_READ
    | SelectionKey.OP_WRITE);

    OP_READ only at this stage. OP_WRITE is always 'ready' unless the socket buffer is full, so your selector will turn only. Do not save OP_WRITE until you have something to write.

    ByteBuffer bferClient = ByteBuffer.allocate (4096);

    You do this each time around the loop, and you don't even know if the key is still readable. Do it when you accept a connection, and then save it as the essential accessory for this channel.

    client.configureBlocking (false);

    It is already in non-blocking mode. Why you do it again?

    try {}
    If ((bytesRead = client.read (bferClient))! = - 1) {}

    bferClient.flip ();
    String msgFromClient = new String (bferClient.array ());

    new String (bferClient.array (), 0, bferClient.limit () - 1), but you're assuming that you've got a complete command here. You do not have. This is another reason why you need a ByteBuffer by channel.

    Channel.Connect (SocketAddress);

    You should do it in non-blocking mode, save the channel for OP_CONNECT and leave the select loop to take care to complete the connection.

    Channel.Write (bferClient);

    The incoming command is CONNECT. You do not write than upstream.

    If (!) » ». {Equals (msgFromClient.Trim ()))}
    int bytesReadServer;
    response from Byte [] = new ubyte [4096];
    try {}
    ByteBuffer bufferNIO = ByteBuffer.allocateDirect (1024);
    While ((channel.read (bufferNIO))! = - 1) {}
    bufferNIO.flip ();
    customer. Write (bufferNIO);
    bufferNIO.clear ();
    }

    And you don't do that here. Register the new channel for OP_CONNECT, then when you get finishConnect() and then save it to OP_READ, and moving forward in your select loop. You also need to associate the channel with the channel that read you the CONNECTION since. If you really need an object of attachment key for the original channel that contains the buffer of bytes and the channel upstream; Similarly, the channel upstream must a key attachment that contains sound buffer and its channel downstream. The effect of making all this stuff here rather than around the loop of selection is that you're never going back to the loop of the selection: you manage what a customer here in blocking mode, until the connection is dropped. Completely wrong.

    } catch (IOException e) {}

    Hang up. If bytesRead a-1, you must close the channel.

    e.printStackTrace ();

    And if you get an IOException here you must also close the channel.

    If (channel! = null) {}
    try {}
    Channel.Close ();

    This is a really strange place to close this channel.

    When you get this fixed upward, your zip code and I will tell you how to handle the OP_WRITE.

  • Adobe Reader is blocking internet access to a file. How to enable?

    Adobe Reader is blocking internet access to a file. How to enable?

    Edit-> preferences-> trust manager-> access PDF files outside of the web browser Internet-> settings

    Unlock Amazon.com in this screen.

  • I deleted Adobe Reader 11 and rebooted and reinstalled Adobe Reader 11 and I still get the error message "Adobe Reader is blocked because it is outdated". Using Windows XP with the latest updates (SP3).


    I deleted Adobe Reader 11 and rebooted and reinstalled Adobe Reader 11 and I still get the error message "Adobe Reader is blocked because it is outdated". Using Windows XP with the latest updates (SP3).

    Screenshots attached to e-mail responses will not come back on the forum. You must connect to the forum and post in your topic using the camera icon in the editor.

    Google Chrome is a problem:

    • If you use the clean Chrome PDF Viewer, the results are unpredictable.
    • If you use the Adobe Reader with Chrome plugin, it can reject (block) If this isn't the latest version.  11.0.08 drive is the latest version for Windows XP, but Chrome can insist on the current version 11.0.10.

    My suggestion; Use a different browser!

  • Non-blocking with Perl VI API monitor task

    I am writing a perl script that needs...

    1. Suspend a virtual machine
    2. Do 'some other supervision' while the virtual machine in the suspension process
    3. Make sure that the task is complete suspension

    I was looking at the documentation for the API, but also the code example and there are many examples which have helped me understand how to do #1 and to some extent #3 by calling SuspendVM() on the managed virtual computer object (see my sample code "Option 1").  But it is not perfect for #3 and does not allow me to do #2 at all.  API documentation leads me to believe that I should be able to use SuspendVM_Task() on the virtual computer object for a task monitor-a measure of object (see 'Option 2') in my sample code.)

    However, I can't understand how to use this object task to track progress.  I think it must be something like "Block monitor" in my code, but that doesn't seem to work.  Watching a dump of the task object, "info" property seems to not even be there.  I can bless the object to its class real slot (instead of the generic ManagedObjectReference, it starts as), but then the property of the info is just empty.

    I know I probably stopped next to a simple shade of perlOO/perl/perlReference, but can not find where I'm going wrong... any help out there?

    Output of dump of the object of the task

    ========================

    $VAR1 = bless ({}
    'value' = > ' haTask-1808 - vim.VirtualMachine.suspend - 1852795401',
    'type' = > 'task '.
    (}, "ManagedObjectReference");

    Code example

    ==========

    #! / usr/bin/perl - w

    use strict;

    use warnings;

    Use Data::Dumper;

    use VMware::VIRuntime;

    past #./vmSuspend.pl--mot, username - XXXX XXXX - Server XXX.XXX.XXX. XXX - vmname XXXX

    My % opts =)

    'vmname' = > {}

    Type = > "s =",

    help = > "the name of the virtual machine.

    required = > 1,

    },

    'filter' = > {}

    Type = > "s =",

    help = > 'filter to select corresponding virtual machines. "

    required = > 0,

    },

    );

    OPTS::add_options (%OPTS);

    OPTS::parse();

    OPTS::Validate();

    Util::Connect();

    My $retval = 0;

    my $name = Opts::get_option ('vmname');

    My $vm_view = Vim::find_entity_view (view_type = > 'VirtualMachine',)

    filter = > {'name' = > $name});

    my $state = $vm_view-> run - > powerState-> val;

    Print "$name is $state\n";

    # Option 1 - blocking

    # $vm_view-> SuspendVM();

    # Option 2 - non-blocking

    My $suspendTask = $vm_view-> SuspendVM_Task();

    print Dumper ($suspendTask);

    # Block monitor

    # everything in ($suspendTask-> info-> status-> val eq 'running' | $suspendTask-> info-> status-> val eq 'pending') {}

    # < < some other surveillance > >

    #}

    $vm_view-> update_view_data();

    $state = $vm_view-> run - > powerState-> val;

    Print "$name is $state\n";

    Take a look at this script for example: http://communities.vmware.com/docs/DOC-10269 there is a method in there called getStatus() that shows you a task queue is complete before continuing. You are on the right track, but must do a few more things to get the display of the task and make sure that you update the view after sleep/wait and then check again.

  • How to use a KeyManager custom in SSLSocketChannel non-blocking

    In our existing project I had to replace the SocketChannel non-blocking by SSLSocketChannel no blocking. My implementation of the SSLSocketChannel non-blocking mask all the SSL stuff and can be used as a SocketChannel overall of the project that just use the SSLSocketChannelProvider instead of SocketChannelProvider in one place.

    Now I have a new requirement. Different server-certificate should be used for various IPS on the same SSLServerSocket. The relationship between the IPs and certificates is well known. The first idea was to use a custom KeyManagerDelegate that extends from X509ExtendedKeyManager to select the certificate from the server. The KeyManagerDelegate should delegate calls to a KeyManager obtained by
    KeyManagerFactory.getInstance("NewSunX509").getKeyManagers();
    It works if I use a blocking SSLServerSocket obtained by SSLContext.getServerSocketFactory () .createServerSocket ();

    But the KeyManagerDelegate is never called by the SSLContext if I use my own non blocking SSLServerSocketChannel. Instead of calling my KeyManagerDelegate the SSLEngineImpl throws an Exception
    javax.net.ssl.SSLHandshakeException: no cipher suites in common
         at com.sun.net.ssl.internal.ssl.Handshaker.checkThrown(Handshaker.java:951)
         at com.sun.net.ssl.internal.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:466)
         at com.sun.net.ssl.internal.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1092)
         at com.sun.net.ssl.internal.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1064)
         at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:452) 
    The next thing I'm going to try would be to get the SSLContext to use my own SSLSocketChannelProvider as ServerSocketFactory.

    Or I use different SSLContext for each incoming connection, which would break my own design because the server had to waste his time with the construction of new SSLContext. Another possibility is to implement a callback in the ServerSocketChannel to get a new SSLContext for each accepted connection. It would be sure my design but looks like a ugly workaround solution for me and I do not know if it works.

    All the best ideas?

    Thanks Domi

    I just tested this with my SSLSocketChannel and it works like correctly, the KeyManager methods called as expected. You hurt something else ;-) Do not extend X509ExtendedKeyManager to work properly with the engine.

  • Modal dialog box non-blocking

    Hello world

    I want to display a modal dialog box, capture user input and use it for further processing, as below:

    showWindow(); PopupManager.createPopUp () calls
    code to deal with user input

    My problem is that the showWindow() call is non-blocking, i.e. the code to deal with user input is executed immediately after the posting of the modal window. How can I do to run when the modal window is closed?

    Any help will be greatly appreciated.

    Thank you

    Rajesh Jayaprakash

    You can register a listener for the event of closure of the pop-up window and then on this listener, call the method that you want to run when the window is closed.

  • UTL_TCP (mode of blocking or non-blocking sockets)

    Hi all,

    Please, does anyone know if the UTL_TCP using blocking or non-blocking mode sockets? I did a search but cannot find this information.

    Kind regards

    UTL_TCP.open_connection has a parameter of tx_timeout. If set to 0, the connection is not blocking. A value of n will trigger the connection block for n seconds before exhaling. Null value causes the connection to block indefinitely.

    Published by: Cyn on February 11, 2010 10:49

  • more physical reads the blocks (in this partition)

    Hi all

    I have the partitioned table hash on an indexed column 'id', which is non-unique and a part of my primary key. Inside each partition, lines with the same id are located close to each other which is done by dbms_redefinition reorg using orderby_cols. The intention is to reduce the amount of physical reads as there are no requests that don't filter on the column id.

    However, what I see is a large number of physical reads. The first partition has roughly 80K lines, a length of 347, block size of 8K and compression mean line... resulting in 821 blocks. And when (after flushing cache in the memory buffer and shared pool) submit a query that filters on 'id' only and results is 106 selected lines, I see to roughly 1400 physical reads.

    --------------------------------------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |
    --------------------------------------------------------------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 106. 36782 | 3 (0) | 00:00:01 |
    | 1. SIMPLE HASH PARTITION | 106. 36782 | 3 (0) | 00:00:01 | 1. 1.
    | 2. TABLE ACCESS BY LOCAL INDEX ROWID | XXX MOVIES | 106. 36782 | 3 (0) | 00:00:01 | 1. 1.
    |* 3 | INDEX RANGE SCAN | XXXXX | 1 | | 1 (0) | 00:00:01 | 1. 1.
    --------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    3 - access ("ID" = 49743)


    Statistics
    ----------------------------------------------------------
    22243 recursive calls
    0 db block Gets
    66651 compatible Gets
    physical reads 1404
    0 redo size
    10933 bytes sent via SQL * Net to client
    299 bytes received via SQL * Net from client
    9 SQL * Net back and forth to and from the client
    150 sorts (memory)
    0 sorts (disk)
    106 lines processed


    I expect to see around 10-15 physical reads. And I don't understand how it can be 1400 physical reads with only 821 blocks in this partition. Can someone explain this behavior to me?

    Thanks in advance,
    Dirk

    DRabbit wrote:
    However, what I see is a large number of physical reads. The first partition has roughly 80K lines, a length of 347, block size of 8K and compression mean line... resulting in 821 blocks. And when (after flushing cache in the memory buffer and shared pool) submit a query that filters on 'id' only and results is 106 selected lines, I see to roughly 1400 physical reads.

    --------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                          | Name  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    --------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                   |       |   106 | 36782 |     3   (0)| 00:00:01 |       |       |
    |   1 |  PARTITION HASH SINGLE             |       |   106 | 36782 |     3   (0)| 00:00:01 |     1 |     1 |
    |   2 |   TABLE ACCESS BY LOCAL INDEX ROWID| XXX   |   106 | 36782 |     3   (0)| 00:00:01 |     1 |     1 |
    |*  3 |    INDEX RANGE SCAN                | XXXXX |     1 |       |     1   (0)| 00:00:01 |     1 |     1 |
    --------------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    3 - access("ID"=49743)
    
    Statistiken
    ----------------------------------------------------------
    22243  recursive calls
    0  db block gets
    66651  consistent gets
    1404  physical reads
    0  redo size
    10933  bytes sent via SQL*Net to client
    299  bytes received via SQL*Net from client
    9  SQL*Net roundtrips to/from client
    150  sorts (memory)
    0  sorts (disk)
    106  rows processed
    

    For me, the most important statistic is recursive calls. Even for a partitioned table with (for example) a few thousands of partitions, this seems very high for a simple analysis and perform call that eventually access a single partition known by index.

    Test strategies - rerun the query immediately to see if you get similar results, run the query again ONLY after a buffer_cache (not shared_pool) hunt.
    It is possible that more work on optimization, or calls to (for example) a pl/sql function embedded. The behavior of the repeated executions can give you a clue on this subject.
    (And if none of these options can help, then activation trace and check the trace file should help).

    Concerning
    Jonathan Lewis

  • How to create the TCP non-blocking server?

    Hello

    I would like to have a TCP server at my request.  It will go about their business as usual, but in the background a TCP server sits waiting for a client connection.  If such a link exists, the normal code will send stuff on this topic otherwise it will just not send.  Currently, I do not see how to stop this blocking while it waits for a client (block waiting on TCP listener).  I looked at the example of client/server TCP, but it remains blocked in the same way.

    I would like advice on how I'm framing such a request.  I also want to do the same on the client side.  Go about business as usual and if a connection can be established at a time given, then send stuff on that connection otherwise just not worth it.

    Concerning

    Ashley

    LabVIEW parallel code usually runs in parallel. This is true even a wait - if inside a loop, you wait 100ms and other code in parallel, it is not delay execution of other code, rather he runs forward and the other code at the same time. When both have completed, the loop can proceed to the next iteration. So yes, if you have a loop with a 1000ms wait and another with an expectation of 100 ms and waits take longer to execute any parallel code in loops, then the loop of 100ms will last about 10 times as many times as the loop with the 1000ms wait.

    I recommend that you put the waiting on the listener in a separate loop and also have another parallel loop that manages the communication when the connection is established. You can then use a timeout (forever) of-1 on waiting on the listener, and this loop will be almost never run or use resources except what is first of all establish a connection. To kill this loop, close the listener somewhere which depends on waiting on execution of the listener. When a new connection is established, put the link in a queue, where the communications loop can pick it up.

  • TestStand Non blocking deportees to interface (c#)

    Hello

    I wish to have a graphical interface (c#) for managing TestStand (read/write variables FileGlobals, Notifications of waiting/Set,...). This interface must be enabled during the activity of TestStand (graphical indicators of the status of tests, allows the activation of the subsequences, etc.), and it must use the TestStand interface (make a break, step by step debugging, see variable, States in discussions, etc...).

    I start from the example of NI TestStand '\TestStand 4.2.1\Examples\Demo\DotNet' and make a few changes:

    -call the constructor of the windows dialog with a new SequeceCall thread

    -Added management of Notification (unsing TSSyncLib, modify the constructor of the dialog box and send my FileGlobals.Notifier variable create during the stage of creation of Notification).
    -Added a button. When you press on, a variable FileGlobals number is read, + 1, then write and display in the label. And another button set a Notification.

    -Add a breackpoint in the step next to the SequanceCall of the dialog Windows

    My problem is, as long as I do not close the windows, TestStand still 'running' and do not stop on my breakpoint and unresponsive when you "Break everything" change watch Variables...

    If I change this.mDialog. ShowDialog (by this.mDialog). Show(), TestStand responds but the mistake of report of dialog Windows with FileGlobals read/write and Notification.

    My need is achievable?

    As an attachment, the file .seq (TS4.2) with the generated dll and the DotNet project.

    Thanks for help; (o)

    You must use Thread.ExternallySuspended (see using the API for more details) while your dialog box is running. Also you should consider using Execution.InitTerminationMonitor and Execution.GetTerminiationMonitorStatus.

    That said, the description of what you want to do, I thought you were going to start with a UI examples. If you really want to write a custom user interface, it is perhaps a better way to go.

    Hope this helps,

    -Doug

  • Subvi non-blocking output terminals?

    Is it possible to prevent an output jack of a Subvi of blocking during the Subvi execution?

    Thank you

    Mike

    Consider the following excerpt

    When you run this you'll (almost) immediately see the value of "Numeric outside." You can see the results in the table after one second. If you were to do a Subvi and calling it from another VI you will see two update indicators after a second. One quick expected a slow. This is normal and is how LabVIEW and has always worked. It makes sense, and the code is easy to follow and debug.

    But what happens if you inline the Subvi? What would be the expected behavior? In fact what is happening is that LabVIEW encapsulates a barrier synchronization of the structure sequence around the code like this before to apply inlining a VI

    That's why the VI Inline act as a normal VI. NOR said that it would be very easy to just not put the barrier around the code as a configuration option online. I call this hard line , but there is probably a better name for it. (Either by the way, there is an excellent exchange of views in this thread)

    To be honest I don't know what I'd do with this option. At the back of my head that nagging voice always tells me that it could be a very useful option someday. It gives us the opportunity to do something that isn't currently possible. Someone will come up with a very clever trick if it becomes possible.

  • 6036E PCMCIA + DAQmx (analog input) seems to only read in blocks of 512 samples of data

    Hello people,

    I ask this question before I post any code or software versions etc to see if there is a simple answer.

    I use a PCMCIA card 6036E to read an analog input channel (DAQmx... i. e create task, create the channel, set the altimeter (continuous samples), task, read in a programmed software loop while (ASAP)).  No matter how I put my sample rate, number of samples per channel (i.e. size of buffer), or the number of samples to be read, it looks like I can get multiples of 512 samples.

    Here are some samples freq (Fs), the 'number of samples to read' asked and the actual number of samples read:

    FS numberOfSamplesRequested numberOfSamplesActuallyRead

    200Hz   20                                                 512

    1000 1024 5000Hz

    2000 2048 5000Hz

    QUESTIONS RELATING TO THE:

    1 is this 'normal' behavior a 6036E PCMCIA card?

    2. in the case, has anyone who may have seen this problem determined the cause and how to "fix it"?

    Best regards

    Chris

    chassan wrote:

    Hello people,

    QUESTIONS RELATING TO THE:

    1 is this 'normal' behavior a 6036E PCMCIA card?

    Sort of.

    2. in the case, has anyone who may have seen this problem determined the cause and how to "fix it"?

    Best regards

    Chris

    Systems PCI DMA is used to transfer
    the data, daqmx and receive messages when the number of samples are
    acquis. Now on PC-card that does not work and the data is transferred
    When the edge buffer is full (after 2 k of data) to 2 channels
    10 Hz, it can take some time.
    There is a work-around, there is a property where you can set the transfer mechanism (I have not daqmx on this PC), or the daqmx polling mechanism. Try these.

    Found a document KB.

    Tone

  • How to create a non-blocking Popup screen?

    Hello

    Basically, I want to do something similar to the State. Show (String message, bitmap Bitmap, int, long, style, boolean allowDismiss, boolean, int priority block) API where I can display a modeless popup containing various fields and still allow the user to continue to work on the screen below the pop-up window.

    Thanks for any help and suggestions.

    It is not possible. you could draw directly on the screen, it would look like a popup, but would in fact part of the screen. We do overlays in this way, for example.

  • non-blocking applications

    Hello

    Can you help
    I blocked the apps so that my kids can not access things like McAfee or Netgear parent controls, I click on save and reboot the laptop, but when its reloaded, I find that the applications are still there and totally accessible to my children under their log in. That is something I don't want, I'd rather not, they have access to these and be able to change them.
    could you tell
    your

    Thank you

    I restarted the laptop several times and everything seems to work fine now.
    Fortunately I had nothing to do more.

Maybe you are looking for

  • Remove shared albums of old Apple ID?

    I have an old Apple ID that I use no more (but it still exists). Years ago I had shared several streams/albums photographs under this old Apple-ID. Now, I want to delete those. But as I am not more with this old Apple ID on any of my devices, I don't

  • PMC charger have stops working properly

    Unfortunetly I have no idea what want to say... Please

  • Games purchased on the internet that have been downloaded, rather than a cd copy?

    Is it possible to copy a game I bought off the internet that I could use to reinstall the game with if my computer goes down? I went back to my computer it is 'out of the box state"twice and lost a lot of things. I am a member of an online gaming sit

  • How can I save my HP exactly as it is today?

    Can someone tell me please how to backup my PC w/Windows 7, exactly as it is today? Use discs or Flash Drive? If I upgrade to Windows 7 Professional can it be stored in the PC? Thank you Peter

  • Smart object and anti alias

    Hello worldI have a document with a rectangle shape in the PS as a smart object. I use it to model where I can change the cover on a screen of magazine, etc.BUT, I get a ragged line with smart object layers and anti alias (activation tool for transfo