Reading incoming data 32bits at a time

I have raw binary data coming into a UDP port, from which I want to read 32 bits at a time from the actual production data. Each 32 bits will be of a different format ie 1st 32 bytes - float, 2nd 32 bytes - double precision integer etc... so I need to decode each 32 bytes in a different way. How do I separate my data stream so I can deal with 32bits at a time?
Cheers

If your data will be arriving very quickly you may want to have a separate process which does nothing more than read the data in larger chunks. This process will post the data to another process which will then process the data. In very high speed data streams it is sometimes important to read data as fast as possible to avoid any type of buffer overruns. Processing while reading can possibly slow the reading down too much. Processing in a separate task will alleviate this.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Similar Messages

  • How to read updated data from a real-time generated file?

    I have a question:
    I want to read the 10 mostly updated data from a real time generated data file. The data in this file is accumulated. how can i read mostly recently data to an applet? and further to using this data to draw a real-time graph? pls help
    kelvin t.l. tse

    Hi,
    I think there is no "typical" way. You will have to define a convention on how the new data are stored into the file, so as to know how to accessthem. If new data are simply put at theend of your file, you may use a RandomAccessFile to read only those lines that interest you (the 1 final lines).Otherwise, you should at least know how the data file is written.
    You can know if thedata file has been modified with the File.lastModified() method. This retrurns a long value corresponding to the date and hour the file was last modified. Store that value ito you appl. and perdiodically (use a Thread), compare that value with the value returned by lastModief(). If both value are NOt equal, then the file has been updated
    it's all a question of knowing how the data are stored into the datafie generated.
    Be also aware that you will probably have problem when your java appl. tries to read the file at the same time it is updated by the other application. I guess when theother application writes data into the file, you will not be able to read it. So, use try{} catch statements and first check to see if you can read the file with File. canRead(). If not, simply delay the reading process by asking a Thread.yield() or Thread.delay (1000)...
    vincent

  • Reading two data points at a time in Excel

    I would like some help on a programming issue:
    I know how to read whole excel data sets but how do you read two points at a time?  I would like to extract a number from row 1 column 1 and row 1 column 2.  I will use these numbers simultaneously as for loop counters.  Then the program should read row 2 column 1 and row 2 column 2.  This pattern should continue (number of times unknown) until the two numbers both equal 0.
    Please help me with any suggestions you have.
    Thanks ahead of time!

    Hi mtcellar65
    1. you know how to read the whole excel data -  just read the 2D Array (whole information)
    2. extract the single elements using 'Index Array' Function.
     the index for row and column can be kept in a shift register.
    3. increment the indices and repeat step 2 again
    hope this helps
    Renn
    Kudos always welcome for helpful posts

  • Reading data from the Real-Time Infocube

    Hi,
        I am using the FM RSDRI_INFOPROV_READ_RFC to read the data from the Real time Infocube..
    But it reads only the Closed request. Is there anyway to read the open request data from real-time infocube via program.
    Please suggest.
    Regards,
    Meiy

    Hi,
    I would assume that the function module can read the data only if its available for reporting.
    May be you can try the following: You can close the request during the function module execution time and then reopen it. Not sure if this is possible.
    Bye
    Dinesh

  • The Finder can't complete the operation because some data in "1-04 Time.m4a" can't be read or written. (Error code -36)" Can't fix

    I am trying to backup some .m4a files from my MacBook Pro to an external hard drive and suddenly tonight I am getting "The Finder can’t complete the operation because some data in “1-04 Time.m4a” can’t be read or written. (Error code -36)". I have searched for fixes but none of them are working. I have backed up this folder many times before with no issues. Any help is greatly appreciated.

    By the way, I have repaired disk permissions on main drive and repaired both the internal hard drive of my MacBook and the external drive. No luck.

  • How to read in date/time with ascii import

    I have an ascii data file with a time column in the following format
    ddd hh:nn:ss
    the seconds are like 11.1234567, so it would look like
    234 12:23:11.1234567
    I have tried different format options to read this in
    with no luck. The data I read in I am then using in CLIP/Insight. The video has this time on it and I need it in the data set to be able to sync them up.

    The problem with this data format seems to be the 'ddd' at the beginning of the data format.
    DIAdem expexts the 'dd' to be a day of a month, not a day in a year. I can offer you a solution though:
    Please upload or send me two of your data files and we will create a little script in DIAdem that will import your data format and make it available in DIAdem and DIAdem CLIP.
    You can upload them here in the forum or send them to me at:
    [email protected]
    Please compress the files (with ZIP or similar technology) if they are large.
    Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Hello!!!I need to read some data from the serial port and processing these, at the same time I want to see the process that I am doing.

    I read the data without problems, and I see them using Waveform graph, the problem is that I want to see the real time stamps, but in the graph appears 2:00:00,000 and 01/01/04, so the date and the time is wrong !!
    Can I change this?
    I am thinking that the problem is that I have to adquire the data and the time stamps ( using Get date/time) and after, I have to represent both!!!
    Thanks!!!

    Hello,
    As you probably know a waveform is made of a beginning time (t0), a time difference between each value (dt) and an array of values (Y). Your problem is probably that you don't initialize t0. Use the Vi 'Waveform->Build a waveform' to initialize the time of the waveform.
    Hope this helps !
    Julien

  • How to read the date and time information of a file by labview

    how to read the date and time information of a file by labview? for example, created time and modified time.
    Solved!
    Go to Solution.

    if you need to know the last modification date of file:-
    "Functions->File I/O->Advanced File Functions->File/Directory Info.vi"
    This vi returns the value of file's last modification date. This is returned as U32 number. To see it in MM/DD/YY format you must create the indicator, right-click on it and select "Format & Precision" item from drop-down menu. Then select "Time and Date" format there.
    Thanks as kudos only

  • How to reduce the run time of ABAP code (BADI) when it is reading huge data from BPC Cube and thus writing  back huge data to the cube.

    Hi All ,
    In Case of reading huge amount of record from BPC Cube  from BADI code , performing calculations and writing back huge amount of data into the cube , It takes lot of time . If there is any suggestion to read the data  from Cube  or writing data into the cube using some Parallel Processing  methods , Then Please suggest .
    Regards,
    SHUBHAM

    Hi Gersh ,
    If we have a specific server say 10.10.10.10 (abc.co.in) on which we are working, Then under RZ12 we make the following entry  as :
    LOGON GROUP          INSTANCE
    parallel_generators        abc.co.in_10         ( Lets assume : The instance number is 10 )
    Now in SM59 under ABAP Connections , I am giving the following technical settings:
    TARGET HOST          abc.co.in
    IP address                  10.10.10.10
    Instance number          10
    Now if we have a scenario of load balancing servers with following server details (with all servers on different instance numbers ) :
    10.10.10.11   
    10.10.10.13
    10.1010.10
    10.10.10.15
    In this case how can we make the RZ12 settings and SM59 settings such that we don't have to hardcode any IP Address.
    If the request is redirected to 10.10.10.11 and not to 10.10.10.10 , in that case how will the settings be.
    I have raised this question on the below thread :
    How to configure RZ12  and SM59 ABAP connection settings when we have work with Load Balancing servers rather than a specific server .
    Regards,
    SHUBHAM

  • Read Hire date in TIME Schema

    Hi All,
    In our company we have the following requirement
    Employees hired before Nov 1at 2008 gets 32 more hours of vacation than the regular employees.
    My question is how to read hire date in schema and compare it against Nov1st 2008?
    We can use HRS function to get the difference between info type 41 hire date to todayu2019su2019 date.
    But is there a way I can read hire date and compare it against the Nov 1st 2008 date?
    Any pointers will be appreciated
    Thanks,
    Mansi

    Hi,
    Usually the employee hire date is stored on info type 0041 subtype 01 - technical date of entry.  This can be read in the time schema using the Y functions of the operation HRS.
    I suggest you put this date on the employee records for IT0001 and read it from there instead of hard coding dates in the schema which is the other option.
    JB
    Edited by: Jamie Bullen on Dec 4, 2009 2:14 AM
    Edited by: Jamie Bullen on Dec 4, 2009 2:19 AM

  • Email syncs now say "Updated Mar 30", the day I upgraded to Lollipop 5.0.  The notification should read the date and time you updated email receiving.  Does anyone elsehave this problem?

    Email syncs now say "Updated Mar 30", the day I upgraded to Lollipop 5.0.  Two days later it is still saying Mar 30.  The notification should read the date and time you updated email receiving.  Does anyone else have this problem?  Is there a solution to this?

    We want to make sure your phone is in working order Mb_in_NC. I know it can be difficult when you see different times. What is your make/model of your device? When did it start? Do you have a different time on any other applications?
    AmberF_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • TCP/IP DataInputStream reads not all data send in one time?

    I have a C program that sends 4104 bytes of data to a java client.
    In my java client I have a buffer of 4104 bytes that reads the data using a DataInputStream. Now my problem is that the read function returns with only 1460 bytes instead of 4104 bytes.
    I only have this problem on a new type of PC we are using.
    Now I was wondering when you have a TCP/IP session doesn't every send results in 1 recv (read)?
    Does this differ for various platforms? (is that buffer size adjustable)
    Thanks!

    Alright then I do have a problem.
    If your application level doesn't define a blockthen
    you have problems.So I have to keep reading on the socket untill I get a
    timeout? I saw that DataInputStream has a function
    available(), this should return the available number
    of bytes that can be read without blocking. This
    hardly seems to work?
    I just want to read 1 TCP packet without knowing the
    size or the protocol of the packet without having to
    wait for some timeout. I don't want to reassemble -
    defragmentate all my packets. This question seems very
    reasonable to me, but perhaps I'm missing something?
    There's no guarantee in TCP that a block size N
    written in one application will be delivered as a
    single block to the receiver.Is there a place I can read that specification?Usually people need to understand an API in order to be able to use it. TCP sockets present a continuous stream paradigm: the data stream starts when the connection is established and ends when the connection is closed. Now reread your own question: you want to read a block of data from such a stream without knowing the size of the block. That just makes no sense. It is like trying to read first X bytes from a file stream without actually knowing what X is. The number of bytes available immediately on a socket read is subject to all kinds of random factors on the network and has nothing to do with the amount of data the server is actually trying to send as a "block". That is, a single write() on the server does not necessarily correspond to a single read() on the client.
    A common solution to this problem is to have an implicit block size (that is, it is fixed and known apriory) or prefix your payload with the block size. An example of the latter would be to send the block size as the block header (say, an int in network byte order) so that the receiving end could read the size first and then perform a loop that continuously reads from the socket until it reads exactly the required amount.
    In other words, TCP sockets just provide you with a continuous stream paradigm. You need to impose some kind of an application protocol on top of it to build client-server dialogs. This is what's done behind the scenes by CORBA, RMI, HTTP etc.
    If you need to read up on Berkely socket API specifically, Richard Stevens has written some excellent books.

  • How to read the date in Time management schema or in Payroll schema

    Dear all,
    My issue is before 16th in current month, the overtime/absence's wage type should be one and after 16th should be another.For example, before 16th,the overtime wage type is 5001 and the absence deduction wage type is 5002,and after the 16th, the overtime wage type should be 5004 and the absence deduction should be 5005.So I need to read the date in schema then I can choose which wage type should I use.
    So what can I do?
    Hope your advice.Thank you.

    If the the employee was absent upto 16the one wage type has to be generated and after 16th another wage type should get generated right and after 16the another wage tyoe has to generate
    For this
    Have two Absence Valuation rule TSAU1 TSAU2  from V_T554C 
    and built the logic the opertaion CMPER will help you in compare the periods or else you can use NUM=  FY01 like that
    or else you can write a rule based on the wage type by haveing the Customer Specific Processing Class

  • Is it possible to read scalled data in 2D Waveform (DBL) at 2M Hz Sampling rate?

    I am using PXI Real time for my acquisition.
    NI PXIe-6368
    Simultaneous X Series Data Acquisition.
    It is supporing 2MHz sampling rate; When I am reading unscaled data, there is no problem.
    But when I am reading scaled data, I am getting,
    execution get stop or 'Run Out of memory' error.
    Can you please help me on this?
    I am not able to share the code, right now. I will try to share in personal.
    Thank you,
    Yogesh Redemptor
    Regards,
    Yogesh Redemptor

    Hi Allan,
    If you provided some numbers, we may be able to nail this issue for you. Without them I will just guess.
    The error codes you reported indicate that the app is not keeping up with the incoming data. If you are sampling 4 channels at 50kS/s then the hardware is transfering 200 kS/s into its on board FIFO. Page 344 of the NI catalog indicates that the FIFO can hold 2048 samples before it over-flows. The -10846 error indicates that these over-flows are occuring. To prevent this, the app must completely empty the FIFO more frequently. Doing the math this works out to one empty operation every 10ms maximum.
    This is a rather demanding rate. This only addresses the -10846. The -10845 error is troubling. The hardware you are working with may not do the j
    ob.
    Suggestions:
    1) make sure your app is reading at least this often.
    2) slow down you Acq rate (I know, not an option)
    3) DO NOT TRUST ME! Call NI and talk to their hardware support group and ask them;
    a) "Can I do continuous acq from X channels at Y rate using a DAQCard 6024E?"
    b)If yes, "Could you point me at an example?"
    c)If no, "Can I get credit on this device toward a purchase of a device that can?"
    I hope this get you started.
    Reply to this answer if you have further inquiries,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

Maybe you are looking for