From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting 32bit Array to Byte array

Hello Everybody,

We are using moveblock function to get the pointer value in that we are getting 3,07,200   (32)bit values but we want the format of 8 Byte (12,28,800) values .How to convert this.

0 Kudos
Message 1 of 13
(4,304 Views)

The easiest is to use a Typecast function with an Array of U8 as Type:

 

This will instruct LabVIEW to interpret the data as an array of U8.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 13
(4,300 Views)

Hi

In this i can able to get only 3,07200  Byte values only but i want 12,28,800 Byte values

 

0 Kudos
Message 3 of 13
(4,293 Views)

That would surprise me very much, but what code do you have?

Here is a little code snippet of what I have in mind and which shows that the number of elements has changed by a factor of 4.

 

Ton

Message Edited by TonP on 05-12-2009 08:25 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 13
(4,286 Views)

Another, less efficient, solution.

 

PS : Be kind with me and don't mention it in the Rube Goldberg Code forum !

0 Kudos
Message 5 of 13
(4,280 Views)

Hi JB,

 

I have no idea what is inside your VI but it maxes LabVIEW CPU's usage to 100% for several minutes before I decide to kill LabVIEW.

Could you attach a screenshot?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 13
(4,267 Views)
No problem here. It autoindexes the U32 array on a FOR loop, inside the loop, it  uses split number twice to get the four bytes, then uses built array to built the output array into a shift register. It's about 10x slower than the typecast. So why do it?
0 Kudos
Message 7 of 13
(4,256 Views)

Like mentionned in my original post, I expected it to be slower then the typecast but I admit to be astonished by the 10 times factor !

 

Don't do it this way ! 

Message Edité par JB le 05-12-2009 02:37 PM
0 Kudos
Message 8 of 13
(4,222 Views)
You could also get rid of that second for loop and just use the interleave 1D array function 🙂
LabVIEW 2012
0 Kudos
Message 9 of 13
(4,213 Views)
The performance ratio is even higher than 10 (about 12 on my machine) ! Obviously, the performance would be quite better with Initialize Array and Replace Array Subset but probably still far away from the typecast ! Don't do it this way...
0 Kudos
Message 10 of 13
(4,200 Views)