LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I split a cluster into its elements when transferred through a queue as an array?

Solved!
Go to solution

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!

Download All
0 Kudos
Message 1 of 10
(5,058 Views)

Why not just send the clusters directly in the queue?  Or if the are different, flatten to a string first and Enqueue the string.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(5,051 Views)

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!

0 Kudos
Message 3 of 10
(5,049 Views)

You're making it way too complicated.q.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 10
(5,020 Views)

Is this data from an FPGA going over a DMA-FIFO to the Host?


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 5 of 10
(5,014 Views)

Thanks for the reply paul_cardinale! However this doesnt send through the boolean or the enum for some reason 😞

0 Kudos
Message 6 of 10
(5,013 Views)

Being sent through the FPGA as a custom memory control

0 Kudos
Message 7 of 10
(5,011 Views)

the problem with typecasting seems to be that having fixedpoint always has 8 bits (no matter the data format being 64, 16, 8 etc)

0 Kudos
Message 8 of 10
(5,007 Views)
Solution
Accepted by topic author Muri777

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 10
(4,970 Views)

Thank you! I seem to over complicate things.

 

Thanks again!

0 Kudos
Message 10 of 10
(4,938 Views)