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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Array to a number in TestStand

Hello 

 

Any one can give a idea abt:

 

How to convert a array with tree elemenets {0xAB , 0xCD, 0xEF} to a number 0xABCDEF in TestStand?

 

 

Thanks in advance

Message 1 of 4
(4,910 Views)

Attached is one way to do it.  Kind of a hack.

 

Another thing you can do is look at the Str() function.  It looks like it will automatically concatenate an array into a string.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 4
(4,904 Views)

Something like this:

 

Locals.combinedBytes = Locals.arrayOfBytes[0],

Locals.combinedBytes = Locals.combinedBytes << 8 | Locals.arrayOfBytes[1],

Locals.combinedBytes = Locals.combinedBytes << 8 | Locals.arrayOfBytes[2]

 

-Doug

Message 3 of 4
(4,899 Views)

Thanks, thats exactly what I needed.

0 Kudos
Message 4 of 4
(4,886 Views)