LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SGL to I32 Typecast

One problem solved, another rears its ugly head.

 

Does anyone know if the "split" and "Join" number primitives also do this string-and-back journey?  I have some (less aggrevating) issues in my code I need to track down, this might be one of them.

0 Kudos
Message 21 of 26
(1,072 Views)

While I can't offer any evidence of this, I'm confident in saying that join and split numbers don't involve any strings. Depending on what you're doing, though, they may not save you any time or memory copies versus Type Cast - at least, they didn't in my application. If I remember correctly I tried converting my string to an array of bytes, decimating that, then running the resulting decimated arrays through join numbers twice to get U32s - and it was slower than Type Cast, perhaps due to the creation of so many intermediate arrays.

0 Kudos
Message 22 of 26
(1,038 Views)

I've since found out that split and join is at least a lot faster (I have no absolute values) than type casting.  My code is now up to speed with nearly all of the functionality I wanted.  Progress at last.

0 Kudos
Message 23 of 26
(1,023 Views)

Now I'm curious - how do split and join solve converting between SGL and I32, if you're able to share?

0 Kudos
Message 24 of 26
(1,021 Views)

@nathand wrote:

Now I'm curious - how do split and join solve converting between SGL and I32, if you're able to share?


It doesn't, it's a compeltely different problem.

 

I probably should have made that more clear, sorry. Smiley Embarassed

0 Kudos
Message 25 of 26
(1,017 Views)

Oh. Well, if it happens to solve the problem of converting a string (or array of U8) to U32 quickly, can you share? Because I never found a faster solution than Type Cast on the sbRIO we used, although it's possible that I got to a "fast enough" solution at the time and stopped experimenting.

0 Kudos
Message 26 of 26
(1,001 Views)