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.
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.
08-08-2005 01:13 PM
08-08-2005 01:35 PM - edited 08-08-2005 01:35 PM
Message Edited by altenbach on 08-08-2005 11:36 AM
08-08-2005 01:38 PM - edited 08-08-2005 01:38 PM
The key is the Join Numbers VI in the Advanced>>Data Manipulation palette.
Use Index Array on the byte array. Join elements 1 and 0 and elements 3 and 2, then join the results and you have your U32. Note that because of the endianess, the bottom number has to go into the hi byte (that was why I said 1 and 0 and not 0 and 1).
Edit: As usual, Altenbach's code is cooler (and probably more efficient. You can bench them if you like).
Message Edited by tst on 08-08-2005 09:40 PM
08-08-2005 01:39 PM
08-08-2005 01:49 PM
Wow,
That's great! I've improved my perfermance by 4.5 times! Thanks to all, and yes, as you suspected tst, Altenbach is a little more efficient, but thanks anyways. As for tbob, thanks, but I can't view it. I'm still using 6.1. Thanks guys,
PP
08-08-2005 01:53 PM
I also couldn't read tbob's VI. Probably it's the same I would suggest: simply use 'Reverse String' and then type cast, it is 5-6 times faster than altenbach's
@Perl Peril wrote:
Wow,
That's great! I've improved my perfermance by 4.5 times! Thanks to all, and yes, as you suspected tst, Altenbach is a little more efficient, but thanks anyways. As for tbob, thanks, but I can't view it. I'm still using 6.1. Thanks guys,
PP
08-08-2005 01:54 PM
08-08-2005 02:00 PM - edited 08-08-2005 02:00 PM
Actually, my second idea was the similar to tbob's and I just finished a few benchmarks with something very similar (great minds think alike ;)). It seems to be faster than my original draft. On my rig, it is about 100x faster than the original by Perl Peril. (80ms vs 8000ms for 1 million conversion in a loop).
(On the same benchmark, fahlers VI takes about 600ms. I don't know why it is slower, it looks pretty elegant, too :))
Please test for yourself. 🙂
Message Edited by altenbach on 08-08-2005 12:01 PM
Message Edited by altenbach on 08-08-2005 12:11 PM
08-08-2005 02:06 PM
I've implemented tst's modified version of altenbach's code and did indeed find it to be about 3x faster that altenbach's original. But I've never seen the symbol in Altenbach and tbob's code. What does it do? Is it only in labview 7? (Again, I'm on 6.1). Thanks.
08-08-2005 02:14 PM
SOME ORDER, PLEASE!!!!
tbob's and Altenbach's second solution are identical to mine, so you can read my post.
The optimized code was not mine but Franz's (Way to go, Franz, 5 stars).