07-27-2017 08:41 PM - edited 07-27-2017 08:42 PM
Hey guys,
I have two clusters being sent over a queue and I am having difficulty extracting the correct data.
The data being sent is split into 4 parts. Position, Velocity, Boolean and an Enum. The size of the elements are 48, 48, 1 and 8 respectively. This means that the data has to be split before being sent in the queue (since 64 is the largest amount that can be sent at any one time.)
The data is first broken into a boolean array before being built and split into two 64 bit numbers that get put on the queue and sent down.
I have (as a somewhat fluke) gotten the position and velocity data extracted but cant seem to get the boolean. I am yet to try to extract the enum. I am also not certain why I had to bitwise and the velocty with 2^32 and then divide by 256. I was looking at the output and this ended up working.
I think I may have confused myself. I have two 64 bit numbers that I want to split into its 48,48,1,8 bit counterparts. Any help would be appreciated. Thank you!
Solved! Go to Solution.
07-27-2017 08:51 PM
Why not just send the clusters directly in the queue? Or if the are different, flatten to a string first and Enqueue the string.
07-27-2017 08:54 PM
This is simulating information that I have on the FPGA that is being stored in a custom memory control. For the purposes of this post and my own testing i just made a quick example of packing and unpacking. The queue is acting as the memory block that is being stored in the real code.
for this question though assume the cluster cant be sent in the queue. just trying to figure out the unpacking of bits.
thanks!
07-27-2017 10:04 PM
You're making it way too complicated.
07-27-2017 10:26 PM
Is this data from an FPGA going over a DMA-FIFO to the Host?
07-27-2017 10:27 PM
Thanks for the reply paul_cardinale! However this doesnt send through the boolean or the enum for some reason 😞
07-27-2017 10:29 PM
Being sent through the FPGA as a custom memory control
07-27-2017 10:49 PM
the problem with typecasting seems to be that having fixedpoint always has 8 bits (no matter the data format being 64, 16, 8 etc)
07-28-2017 06:39 AM
@Muri777 wrote:
the problem with typecasting seems to be that having fixedpoint always has 8 bits (no matter the data format being 64, 16, 8 etc)
The real problem with Type Cast is that it is not supported in FPGA.
But all you really need to do is the opposite and how you built up the data. This would include using Number To Boolean Array, Build Array (to now have a 128 element boolean array), Array Subset (to get the parts you need), Index Array (for the boolean), Boolean Array To Number (right-click on them and go to properties, there you can set the output data type), Integer To Fixed Point, and Bundle By Name.
07-30-2017 06:46 PM
Thank you! I seem to over complicate things.
Thanks again!