From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

convert array of numbers to one decimal number

Hi all...

 

How can I convert an decimal array to decimal number ????

 

eg: I have an array (element 1: 1, element2: 2, element3: 3..... ) now, I want to convert this array to a decimal number (like 123...)

 

hope I am clear.

Thanks

0 Kudos
Message 1 of 8
(14,684 Views)

It's just a rough idea, but see the attached VI.  Let me know if it's too confusing.

 

Jeremy

0 Kudos
Message 2 of 8
(14,678 Views)
Message Edited by Ravens Fan on 07-06-2009 01:10 PM
0 Kudos
Message 3 of 8
(14,677 Views)

mets501 wrote:

It's just a rough idea, but see the attached VI.


 

Jeremy, you need to initialize the shift register (with zero), or anything except the first run will be wrong. 😉

0 Kudos
Message 4 of 8
(14,664 Views)

Here's a loop-free alternative. 😉

 

Message Edited by altenbach on 07-06-2009 10:53 AM
Message 5 of 8
(14,648 Views)

Dear all, thank you very much for your response. I wanted to avoid using the for loop.

I tried parallelly and I think we can also use the Array to Spreadsheet String vi and then convert the derived string to whatever number we choose... let me know your comments...

0 Kudos
Message 6 of 8
(14,612 Views)

If you used the Array to Spreadsheet String what did you use as the delimiter? You can't use an empty string because if you do then the function ends up using the default of tab. This gives you a string with tabs between numbers. If you use any other character then you end up with numbers that have a character in between the numbers. Thus, you cannot directly convert this to a number using the Decimal String to Number function. It seems to me that the solutions provided are more appropriate.

 

You also said "convert the derived string to whatever number we choose". What does this mean? Your original post did not give any indication that what you want the final number to be was "selectable". What would be "selectable" about it?

0 Kudos
Message 7 of 8
(14,590 Views)

"You can't use an empty string because if you do then the function ends up using the default of tab"

You are right. It did not help me because of the tabs.

 

"convert the derived string to whatever number we choose"

Means that the string I have derived can be converted to decimal number or hexadecimal number depending upon which VI I have choosen (eg: hexadecimal string to number).

 

I am not sure which "Selectable" number are you talking about. But anyways, I am sorry if I have conveyed my req'ment wrongly.

0 Kudos
Message 8 of 8
(14,580 Views)