01-06-2009 04:49 AM
Hi, i have a problem
in my measurement i get permanently measurement data as an 1d arrays. This data goes in a queue, and from there i want to unpack this array in a singel 32 integer word stream and this very very fast, because the measurement data input is up to 50 MHz.
The question is: How can i unpack this 1d array in a single 32 word stream???
THX for answer
there is a picture, where you can see the measurement data in put in this queue and the data output.
01-06-2009 05:10 AM
The data is allready in a DoubleWord (unsigned) format.
What kind of data-type do you want to store to disk?
If you want to sent the data over a serial connection (TCP/IP) you can use 'Typecast'
You propably want to turn of the 'Prepend Array Size?' boolean on the top of the write to file primitive.
Ton
01-06-2009 06:03 AM
THX for the answer,
at first i don't need to send the data via ethernt.
i only want to unpack the 1d array in a 32 bit integer word by word to delete some bits from each 32 bit word...like in the picture.
here i open this file (this 1 d array and i can easy unpack this array in single words, but it is not possible to do it direkt in the record-programm (last picture)...why??
01-06-2009 06:04 AM
01-06-2009 08:30 AM
Hi chefcomma...,
instead of transform your data to bool, using the delete from array function and transfer it back, you should use the logical shift function.
Mike
01-06-2009 11:52 AM - edited 01-06-2009 11:52 AM
As Mike already indicated, all you need is a "-3" shift (or scale by 2^-3). On integers, both are identical, so use the one that better documents the code for readability.
You actually only have an array with a single element, so you should leave the "count" unwired to get a scalar output instead. No need to index out later. (top image)
If you want to read the entire array at once, wire a -1 to the count and do the same operation on the entire array. (bottom image)
Simple as that! 🙂
