How to read large blocks of data as quickly as possible in Labview?

<p>&nbsp;Hello friends,</p>
<p>I meet a problem in reading visa &nbsp;data. It's a usb-raw device, it needs a indepent thread to read the data without any delay(Thread priority Critical). I can do this in both CVI &amp;Labview. The difference is, in CVI, I can exchange the buffer data(read by Visa-read) by exchange the pointer of the buffer, this could avoid data copy. But in Labview, how can I do this to avoid data copy which would delay the Visa-read loop?</p>
<p>PS. the data block(Buffer length) is big,512KB. And the length could not be small since it would make data loss. I have tested this. The program attached could work wihout problem, but if I try to show the data, there would be a data loss. How can I get it ?</p>
Attachments:
20141220122944.png ‏8 KB

Use a Queue to send the data to another loop that can process the data.  Have a look at the Producer/Consumer architecture.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Similar Messages

  • Java NIO - reading large amount of data

    Hi,
    I have diffuculties of reading large amount of data with SocketChannel (using directAllocated buffer & allocated one). Files greater than 300KB are cut even though I tried write the data into FileChannel.
    My Code:
    ByteBuffer directBlockBuffer = ByteBuffer.allocateDirect(150000);
    buffer = ByteBuffer.allocate(6000000);
    out = new     FOS("d:\\msgData.tmp");
    fc=out.getFOS().getChannel(); // FileChannel               
    int fileLength = (int)fc.size();
    while (clientChannel.read(directBlockBuffer)>0)
    {                              directBlockBuffer.flip()                         buffer.put(directBlockBuffer);
         directBlockBuffer.compact();
    //close data file
                                       buffer.flip();
                                       fc.write(buffer);
                                       fc.close();
    FOS.close();
    // end of code
    Any ideas?
    Thanks
    AST

    I don't understand how the "write" result will help read the whole data.
    Anyway, I changed the code so the SocketChannel will read in smaller chunks (~8KB) & the FileChannel writes in every read
    but the data stream is cut again (to ~5KB no matter what size of file I send).
    In the updated code when try to compare socketChannel.read to -1 I got endless loop.
    I'm basically trying to write POP3/SMTP server program, this part of code handles attachment that is received by the SocketChannel in one unit (i.e 1+ MB of data, the other SMTP commands/lines are no more than 27 chars and simple to handle).
    Therefore I need to be ready to accept large amount of data to the buffer & write it to filechannel. (In the POP3 thread I'm using MappedByteBuffer successfully).
    Updated code:
    ByteBuffer directBlockBuffer = ByteBuffer.allocateDirect(8192);
    while (clientChannel.read   (directBlockBuffer>0&&directBlockBuffer.hasRemaining))
              directBlockBuffer.flip();
              fc.write(directBlockBuffer);
              directBlockBuffer.clear();
         }I think based on API my code is logical (and good for small files) but what about handling bigger files (up to 5MB)?
    Thanks,
    AST 

  • How to read a tab seperated data from a text file using utl_file

    Hi,
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....
    Thanks in advance...
    Naveen

    Naveen Nishad wrote:
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....If it's a text file then UTL_FILE will only allow you to read it a line at a time. It is then up to you to split that string up (search for split string on this forum for methods) into it's individual components.
    If the text file contains a standard structure on each line, i.e. it is a fixed delimited structure, then you could use external tables to read the data instead.

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • Advice needed on how to keep large amounts of data

    Hi guys,
    Im not sure whats the best way is to make large amounts of data available to my android  app on the local device.
    For example records of food ingredients, in the 100's?
    I have read and successfully created .db's using this tutorial.
    http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49. html
    However to populate the database I use flash? So this kind of defeats the purpose of it. No point in me shifting a massive array of data from flash to a sql database, when I could access the data direct from the as3 array?
    So maybe I could create the .db with an external program? but then how would I include that .db in the apk file and then deploy it to users android device.
    Or maybe I create a as3 class with an xml object init and use that as a means of data storage?
    Any advice would be appreciated

    You can use any means you like to populate your SQLite database, including using external programs, (temporarily) embedding a text file with SQL statements, executing some SQL from AS3 code etc etc.
    Once you have populated your db, deploy it with your project:
    http://chrisgriffith.wordpress.com/2011/01/11/understanding-bundled-sqlite-databases-in-ai r-for-mobile/
    Cheers, - Jon -

  • Waas, large block of data, ftp

    Hi,
    a bit new to waas. Doing some testing with waas in lab environment. Works great when tranfering data with ftp when link is not congested. But when I test with congested links I see that the ftp session times out (that is: files that is already cached works fine (is optimized), but new file transfer stops). See that the ftp transfer data in "large blocks". When testing without WAAS inpath, the ftp tranfer is more "smooth" and it never fails. Any ideas, tuning?

    You need to send it as an attachment.
    http://vamseeg.blogspot.com/2013/04/how-to-move-large-file-using-file.html

  • How to read context node/attribute data of diff UI component of same screen

    Hi,
    I am new to CRM and as well as BSP, Now the requirement is, at the time of Lead creation, when the end user enters customer code and sales area i need to fetch and display the customer group 1 value( VIP,KAM etc) based on the customer's sales area, ( these are sales area specific values).
    but the problem is Customer code is in diff UI component and sales area data is in diff UI component .
    1) customer code attribute is in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT.
    2) sales area fields are in the UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET.
    3) I have created new field(customer type to display the customer group 1 value "VIP") in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTLEADH.    
    To display the value in the context node BTLEADH, i need to know the sales area data which is entered in BTORGSET.
    Kindly let me know how to read the data which is in diff UI component of the same Lead creation screen.
    i written following code in context node BTLEADH, atttribute New Zfield, in get method, but not able solve, please guide me.
      DATA: LR_ENT TYPE REF TO CL_CRM_BOL_ENTITY,
                 LR_COL TYPE REF TO IF_BOL_ENTITY_COL.
      LR_ENT ?= ME->TYPED_CONTEXT->BuilHeader->COLLECTION_WRAPPER->GET_CURRENT( ).
      LR_COL = LR_ENT->GET_RELATED_ENTITIES( IV_RELATION_NAME = 'BuilSalesArrangementRel' ).
      LR_ENT ?= LR_COL->GET_FIRST( ).
      IF LR_ENT IS BOUND.
        LR_ENT->GET_PROPERTY_AS_VALUE( EXPORTING IV_ATTR_NAME = 'DIVISION'  IMPORTING EV_RESULT =  LV_DIVISION  ).
      ENDIF.
    I'll appreciate if you can provide me some documents to refer.
    awaiting for your responses.
    Thanks
    Bhanu

    Hi Gangadhar,
    I think i have not clearly explained my requirement, let me put it once again. My requirement is, I have to read two UI component data, validate and display some value in one new zfield which is in one of the UI components.
    I need to display customer's sales area specific data like customer group 1 value in that new zfield. for that i need Customer code and as well as sales area data from the screen.
    1) customer code attribute is in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT.
    2) sales area fields are in the UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET.
    3) I have created new field(customer type to display the customer group 1 value "VIP") in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTLEADH.
    As per my understanding, in the context node BTLEADH, GET_METHOD of atttribute New Zfield, i have to read customer code from UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT and Sales area data from UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET based on the values, validate and display the data.
    But as per your recent reply you are asking me to write the code in get_property_attribute---division. so i didnt understand.
    Kindly clarify if i am wrong.
    awaiting for your response.
    Thanks
    BHanu

  • How to remove a block of data in memory?

    hello:
    there is a block of data in memory, now i should add 4 bytes in them , so i should remove some data behind, i don't know what function i should use?
    i think remove some data from one place to another is copy data from one place to another , is that ok?
    Best regards!
    future

    I have some records in the internal table t_int1. I want to retrieve some set records from that table and put them all in some other table, based on a single field which is not a key. Can i use READ statement to achieve this.
    Could you please let me know any simple way of doin this.
    Answer :
    data:
    itab2 like standard table of  t_int1 with header line.
    Loop at t_int1.
    read table t_int1 with index 1.
    check ur condition----
    check each line and insert it ---work out the syntax for this
    IF t_int1-xyz = data1
    append  line of t_int1 to itab2. or try insert
    cnt = cnt + 1   -
    u will get no. of records added to next itab.
    else.
    cnt1 = cnt1 + 1 -
    u will get no. of records not added to next itab.
    endif.
    end loop.

  • How to read certain span of data from SQL-databa​se ?

    Hi All,
    I'm using LV 8.5 with Database Connectivity Toolset
    My aim is read certain time span data from MySQL-database. Let's assume that I have rocorded data from 1.1.2008 to 25.1.2008. My database table contain two columns "timestamp" and "data". How  I can select  e.g. span 20.1.2008 10:00 - 21.1.2008 14:00? I think that I have to use VI "Select Data" and write something to connector "optional clause". I can't find any example how to write clauses to this connector.
    I managed to select all data but that consumes quite much CPU time and I usually need only smaller data sets.
    BR,
    Jim

    The VI DB Tools Select Data has an input called (at the top) called "optional clause". You can wire an SQL predicate to this input that control the rows that are returned by the VI. In your case, you want to use what's called a WHERE clause to filter the rows to be the subset you need.
    For the toy database I was playing with I had to set the optional clause to: "where startdate > #3/1/2008#" to make the VI return rows which had a startdate field of later than 01-Mar-2008. I was using the JET DB engine, not sure if the same syntax will work for other SQL engines, so your mileage may vary. :-)
    Let me know if you need more information or want to take a look at my example VI.
    Cheers!
    Pramod
    Message Edited by PramodS on 04-09-2008 01:26 AM

  • How to read .db file for Data services in Linux Environment

    Hi all,
    Can anyone tell me how to read a .db file for SAP BODS 4.0 which got installed in Linux?
    This is Urgent...

    If we are talking about MS Access, AFAIK there is no native support of that format in SAP Data Services. You may try to find ODBC driver fot that.
    Thank you,
    Viacheslav.

  • How to pass large amount of data between steps

    Hi all,
    I have some LabVIEW VIs for data acquisition。
    I need to pass large amount of data(array size >5000000 each time) from one step to another.
    But it is not allowed to set array size larger than 5000000.
    Any suggestion?
    czhen
    Win 7 SP1 & LabVIEW 2012 SP1, Teststand 2012 SP1
    Solved!
    Go to Solution.
    Attachments:
    Array Size Limits.png ‏34 KB

    In your LabVIEW code, put the data into a data value reference.  Pass this reference between your TestStand steps.  As an added bonus, you will not get an extra copy of the data at each step.  You will need to use the InPlace element structure to get your data out of the data value reference.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How InfoSpoke reads time dependent master data ?

    Hello Experts !!
    How InfoSpoke reads the time dependent master data ?
    What key date it reffers to ?
    Can you please explain, I want to use this concept in writing master data lookup for time dependent attributes of 0MATERIAL.
    Thank a lot !

    You can either specify the time period in the filtering area of infospoke or you can implement a transformation BAdI -OPENHUB_TRANSFORM to manipulate the data whichever way that suites your requirement. All time dependent infobjects have datefrom and dateto fields which you can use to choose your data range accordingly.
    Hope this helped you.

  • How to read Inspection Method classificatino data

    Hi all,
    Can anyone let me know about how to read the Inspection Method Classification data.The transaction code for Inspection Method Classification is QS34.
    Thanks,
    Balaji

    Hello gopi,
                  i know that but I am asking whether there is any FM to read just like for Material classification,Batch classification etc we have FM's.
    Thanks,
    Balaji

  • How to read inspection method classification data?

    Hi all,
            Can anyone let me know about how to read the Inspection Method Classification data.The transaction code for Inspection Method Classification is QS34.
    Thanks,
    Balaji

    Hello gopi,
                  i know that but I am asking whether there is any FM to read just like for Material classification,Batch classification etc we have FM's.
    Thanks,
    Balaji

Maybe you are looking for

  • Error in uploading the PO while running Direct Input porgram RM06EEI0

    Hi all i have written one conversion program to upload PO. Here in the program i am populating the batch input structures MBEPOH and MBEPOI and finally writing it to the unix file. Finally when i execute the direct input program RM06EEI0 using the lo

  • Problem:  short filenames from Windows apps

    Whenever I save a file from a Windows application on Solaris, if the filename is 8 characters or less, it converts the filename entirely to lowercase, but with 9 characters or more, it works fine. ie: 1234567890 abcdEFGHI.txt --> abcdEFGHI.txt abcdEF

  • Help! Getting error "The file could not be written" when exporting

    When I attempt to export a group of approximately 50 photos from LR4, a window opens at the end of the process saying "The file could not be written" along with a list of approximately 10-15 NEF file names.  I have never had a problem exporting befor

  • Importing pictures from a CD into iphoto

    I have a CD full of pictures (I don't have the camera the pictures came from) that I want to import to iphoto. Can this be done, and if so, how? iMac   Mac OS X (10.4.6)  

  • How do I enable php in OSX 10.9.3

    I downloaded webserver and have a apache and mysql and the site is working when i connect but only the html pages, the php pages dont work and i noticed the webserver says PHP is disbaled how do I enable the PHP?