LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos
Message 1 of 5
(2,266 Views)

32 bits is equal to 4 bytes.  So you just have to read 4 bytes at a time.  Then what you do is use whatever typecast you need to convert it to different data types such as float, integer, etc.

0 Kudos
Message 2 of 5
(2,254 Views)

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
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 5
(2,247 Views)

How do I create this separate process? I am receiving data at 100 Hz and it seems my program cannot handle this speed as the timing starts to inherit errors.

0 Kudos
Message 4 of 5
(2,226 Views)

Look at the programming constructs such as:

Application Design Patterns: Producer/Consumer

Application Design Patterns: Master/Slave

 

 

SAME question asked again here and here. Smiley Mad

0 Kudos
Message 5 of 5
(2,219 Views)