LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make char array into integer array

Solved!
Go to solution

Hi,

          If  i give input unsigned char array as a[]={12, 45, 89, 00, 45, 12, 67, 12} ;

 

              I want output as follows in unsined int array b[]={12458900, 45126712};

 

Thanks in Advance,

 

Regards, 

Harish. G.

 

Thanks & Regards,
Harish. G.
0 Kudos
Message 1 of 12
(4,336 Views)

Harish,

 

I think this will help you

 

http://screencast.com/t/T67yJZEjpx

0 Kudos
Message 2 of 12
(4,311 Views)

Hi Harish,

 

You should be able to do this using the following code

 

example.png

 

You will just need to stick this into a loop and read four elements at a time from the array.

 

0 Kudos
Message 3 of 12
(4,310 Views)
Solution
Accepted by harishg92

Hi Harish,

 

in your first thread you want to create BCD byte arrays from larger integer numbers and now you need to go the same way back?

The basics were shown to you: all you had to change was some simple math!

check.png

 

You really should have sticked to your first thread...

Best regards,
GerdW


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

Or without for loop.

 

4xU8-U32.png

0 Kudos
Message 5 of 12
(4,278 Views)

Hi,

 

  Thanks,

 

 

Regards,

Harish. G.

Thanks & Regards,
Harish. G.
0 Kudos
Message 6 of 12
(4,270 Views)

Hi, 

              input string is a array of unsigned char elements, in that there is no comma,

        then what is the delimeter i have to use:)

 

Regards, 

Harish. G.

Thanks & Regards,
Harish. G.
0 Kudos
Message 7 of 12
(4,263 Views)

Hi harish,

 

so it's a byte stream? Convert String to U8 array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(4,248 Views)

Hi,

 

 If you convert into U8 array. its a integer its nt a string,

How you wil give this input to Spreadsheet string.

 

Thanks & Regards,
Harish. G.
0 Kudos
Message 9 of 12
(4,242 Views)

Hi harish,

 

you don't need SpreadsheetStringToArray in that case. All you need is an U8 array for the conversion to I32 array as shown before!

 

I only used SpreadsheetStringToArray as I didn't want to type all those numbers in a U8 array constant...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(4,237 Views)