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
(1,114 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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 7
(1,110 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
(1,089 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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 7
(1,085 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
(1,073 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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 6 of 7
(1,069 Views)

Hi, 

       Thank you :).

       This solution solved my problem.

 

Thanks and Regards,

Harish. G.

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