cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert array of integer to character String

SOLVED
harishg92
Member
Solved!

How to convert array of integer to character String

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 Smiley Happy

 

Thanks & Regards,

Harish. G.

Thanks & Regards,
Harish. G.
6 REPLIES 6
GerdW
Knight of NI

Re: How to convert array of integer to character String

Message contains an image

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
harishg92
Member

Re: How to convert array of integer to character String

Thank u very muchSmiley Happy

 

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.
GerdW
Knight of NI

Re: How to convert array of integer to character String

Message contains an image

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
harishg92
Member

Re: How to convert array of integer to character String

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.
Highlighted
GerdW
Knight of NI
Solution

Re: How to convert array of integer to character String

Message contains an image

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
harishg92
Member

Re: How to convert array of integer to character String

Hi, 

       Thank you Smiley Happy.

       This solution solved my problem.

 

Thanks and Regards,

Harish. G.

Thanks & Regards,
Harish. G.