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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert array of integer to character String

Solved!
Go to solution

Hi, I am trying to convert 32 bit Integer array to  character string. For ex: if array contains {1234, 4567, 8, 9} i need string as {00,00, 34,12, 00, 00, 45, 67, ....}

How to do this one. 

Please Help 🙂

 

Thanks & Regards,

Harish. G.

Thanks & Regards,
Harish. G.
0 Kudos
Message 1 of 7
(3,080 Views)

Hi Harish,

 

- Do you need bytes containing your numbers?

- What is the byte order? 1234 should result in 00,00,34,12 and 4567 results in 00,00,45,67???

- What are "characters" by your definition?

 

Please provide a really good example&explanation of the desired result!

 

Straight-forward solution by following your descrition word-by-word:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,076 Views)

Thank u very much:)

 

It is a ver good solution for me.

 

But here you are storing 1234 as 00 00 12 34. In this 00, 00, 12, 34  is two bytes. I need 00, 00, 12, 34 as single bytes.

 

Thank you for showing a very good example.

 

Thanks & Regards,

Harish. G.

Thanks & Regards,
Harish. G.
0 Kudos
Message 3 of 7
(3,055 Views)

Hi Harish,

 

your description is still very vague. Do you need commas between those bytes?

check.png

Converting the decimal I32 numbers to BCD bytes...

 

GIVE A GOOD DESCRIPTION OF WHAT YOU REALLY NEED!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,051 Views)

Hi, my requirement is 

 

    I have 32 bit integer array, that contains a[] = {11223344, 55667788};

 

   I need output as follows in 8 bit integer array b[]= {11,22,33,44,55,66,77,88};

 

Thanks & Regards,

Harish G.

 

 

Thanks & Regards,
Harish. G.
0 Kudos
Message 5 of 7
(3,039 Views)
Solution
Accepted by topic author harishg92

Hi Haris,

 

use the solution shown above as it seems you really want BCD numbers...

 

Or this slightly improved version:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,035 Views)

Hi, 

       Thank you :).

       This solution solved my problem.

 

Thanks and Regards,

Harish. G.

Thanks & Regards,
Harish. G.
0 Kudos
Message 7 of 7
(3,009 Views)