This widget could not be displayed.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

processing the array elements

Solved!
Go to solution

@josy wrote:

Hi,

@     How can we convert a byte array into its original form?Suppose one data is represented as 4 bytes in a byte array how can we reconverted it into one value.I tried some ways using 'flatten to string' but it is returning the values in a non readable form(ie: @^,.5%..).Anybody any suggestions?


I don't know what you mean by "its original form".  What is the data type you have now and what are you trying to convert to?  An example of an input and its corresponding output would be helpful too.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 31 of 42
(2,190 Views)

Sorry.If my way of explanation is not good.I will specify an example:-

If we are representing the value '2' in IEEE byte conversion as '63 00 00 00'(4 bytes 1 byte per array index).How to reconvert it into 1.If array contains some more elements we have to take 4 bytes and reconvert them into string.

 

Thankyou.

0 Kudos
Message 32 of 42
(2,186 Views)

I'm still not understanding.

 

My best guess is you either want the Byte Array to String or the Number to Hexidecimal String.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 33 of 42
(2,182 Views)

You want typecast to convert those 4 bytes into a Single precision floating point number.

0 Kudos
Message 34 of 42
(2,176 Views)

Thanks guys I did it.In my former post I asked about converting a time stamp into byte.Now I want to know how to reconvert it again into time stamp?

Also If Iam displaying it in a listbox.I want to see the previous time also.That is the previous time I dont want to be deleted.To be more clear 8:30 in first row of listbox,8:31,8:32.....in the coming rows.How can it be?

0 Kudos
Message 35 of 42
(2,164 Views)

Ok, so what you are calling byte is really a string.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 36 of 42
(2,153 Views)

Thanks crossrulz,

                            But Iam asking can we convert the 'appended array'(Format Timestamp.png 19 KB ) into the timestamp.And not by directly taking from Format Date/Time String.And Iam trying to do the same thing from 'appended array' it is showing Error1 in Scan From String Function.

0 Kudos
Message 37 of 42
(2,135 Views)

You have to reverse the conversion of the array into a string again.  Index out the array using Array Index, use the Format String function with "%s-%s-%s%s%s%s.%s" as you format.  You can then use the same conversion I showed earlier.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 38 of 42
(2,116 Views)

Hi crossrulz,

                   I tried but it is giving the error that too much of format specifiers.So I tried using only one %s.And then used the same conversion as you showed earlier.

                   That time  it is giving error 1.Why it is giving such type of error?

0 Kudos
Message 39 of 42
(2,105 Views)

@josy wrote:

Hi crossrulz,

                   I tried but it is giving the error that too much of format specifiers.So I tried using only one %s.And then used the same conversion as you showed earlier.

                   That time  it is giving error 1.Why it is giving such type of error?


Post your code an we'll see what we can find.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 40 of 42
(2,099 Views)