LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a 680x480x2 array of values into binary and then joining adjacent elements to make a 640x480 array?

Hi cowboy,

 

"essentially I want a 640 x  480 array with each cell containing 16-bit value. The original array is double the size, with 8-bit."

Pick the corresponding bytes in correct order (as mentioned by Altenbach) and join them!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 16
(615 Views)

Would this do what you want?  You might need to change representation or order of pages to get the right values.

 

Lynn

 

Join elements.png

0 Kudos
Message 12 of 16
(603 Views)

That would be correct for a 3D 680x480x2 array, but I don't think this is customary for 10 bit data. More likely is flat arrangement in memory, such as in a 1360x480 array for example, with the bytes to be merged adjancent to each other.

 

Assuming big endian, the following might work.

 

 

 

Modify as needed. There are probably bugs....

0 Kudos
Message 13 of 16
(598 Views)

Thank you all so much for your feedback.

 

Here is some additional information I have obtained about the situation:

 

The camera provides 8-bit data in an array on labview. Ultimately I would like to aquire 10-bit data by converting the 8-bit data into 16-bit. In binary, the last six digits would be 000000 and to my understanding, those zeros can be "cut off" to enable a 10-bit solution.

0 Kudos
Message 14 of 16
(577 Views)

cowboys99 wrote:

The camera provides 8-bit data in an array on labview. Ultimately I would like to aquire 10-bit data by converting the 8-bit data into 16-bit. In binary, the last six digits would be 000000 and to my understanding, those zeros can be "cut off" to enable a 10-bit solution.


I'm sorry, but this still isn't making much sense.  Why do you want 10-bit data?  How does "converting the 8-bit data into 16-bit" give you 10 bits?  Also, you're going to end up storing your 10-bit data in 16-bit values anyway (the computer can naturally address 16-bit values, but cannot do so for 10-bit values), so losing the lower 6 bits won't gain you anything in terms of memory use unless you're willing to write a lot of code to pack and unpack 10-bit values.

0 Kudos
Message 15 of 16
(574 Views)

cowboys99 wrote:

The camera provides 8-bit data in an array on labview. Ultimately I would like to aquire 10-bit data by converting the 8-bit data into 16-bit. In binary, the last six digits would be 000000 and to my understanding, those zeros can be "cut off" to enable a 10-bit solution.



Obviously, words are insufficient. Why don't you attach a VI that contains a typical input array, either as default data in a control or indicator, or as a diagram constant?

 

You cannot cutoff individual bits from a 16 bit value, but you can ingore certain bits.

0 Kudos
Message 16 of 16
(569 Views)