04-22-2016 03:26 AM
Hello,
i have two numeric arrays. One with MSB bytes and the other with LSB bytes.
How can i join this two bytes into a third array with the full number?
Thx
04-22-2016 08:12 AM
I would make a for loop. Inside the loop, you would have something like Array3[i] = (MSB[i]<<8) + LSB[i]
I don't think there's a join command. You need to left shift the MSB and add it to the LSB.
04-25-2016 01:27 AM - edited 04-25-2016 01:30 AM
Hi!
it is much easier than that. Join really works for that (see demo)
EDIT: Sorry I missread. I thought it was a LabVIEW question!
Best regards,
Christoph
04-29-2016 06:50 AM - edited 04-29-2016 07:15 AM
USe a For loop loopin the number of elements in the MSB array and put this statement inside the loop will join the arrays.
Locals.ResultArray+={Locals.MSB[Locals.Index],Locals.LSB[Locals.Index]}
So something like this
For (Locals.Index = 0,Locals.Index < GetNumElements( Locals.MSB),Locals.Index += 1)
Locals.ResultArray+={Locals.MSB[Locals.Index],Locals.LSB[Locals.Index]}
End
BR
Christian