LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting 32bit Array to Byte array

Highlighted

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
(1,812 Views)
Highlighted

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
(1,808 Views)
Highlighted

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
(1,801 Views)
Highlighted

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
(1,794 Views)
Highlighted

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
(1,788 Views)
Highlighted

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
(1,775 Views)
Highlighted
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?

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 7 of 13
(1,764 Views)
Highlighted

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
(1,730 Views)
Highlighted
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
(1,721 Views)
Highlighted
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
(1,708 Views)