LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert 2D string array to 2D number array.

Hello,
 
I have the following problem. I need to convert a 2D string array to a 2D number array. My array exists out of 2 columns and x rows. So what I first did was this. Just splitted the array in two parts for each column. At that moment I had two 1D arrays next I converted it with a solution I found here at the forums. It works perfectly only isn't there a way to convert a 2D string array to 2D number array. I myself tried several things but unfortunaly I didn't manage. Anyone can help?
 
Thanks in regards,
 
- Wouter
0 Kudos
Message 1 of 11
(21,594 Views)
You don't need aything special, the string/number conversion tools take arrays of any dimension. 🙂
 
 
 


Message Edited by altenbach on 12-13-2007 03:32 PM
Message 2 of 11
(21,592 Views)
You should use nested for loops and the Decimal String to Number.vi in the inner for loop, and use auto indexing coming out of each for loop to rebuild your array.  See the attached vi for an example.  Or use Altenbach's method as I suppose I should have advised you to do as well.

Cheers!


Message Edited by jmcbee on 12-13-2007 04:29 PM
0 Kudos
Message 3 of 11
(21,590 Views)
Oh!!! Thanks man really Smiley Very Happy thank you both. Really thats awesome. I didn't know that was possible.
0 Kudos
Message 4 of 11
(21,585 Views)

the problem i have that i need to send hex string with lingth of 4 as (503D XX54) and the value of XX must change from (0 - FF) by switch array so i made constant strings (503D) and (54), and string (XX) must change by Switch array  then the three strings collected togather but with difreent format  so please if anyone can help me to solve this problem

0 Kudos
Message 5 of 11
(21,089 Views)

Hi soliman,

 

the problem is you didn't provide any default data in your controls nor did you really describe what you want ("hex string with lingth of 4 as (503D XX54)" - that's a length of 9 chars for me...).

There's a difference between a string in hex display mode or hex numbers or simple strings! But that has been discussed so often in the forum you could easily find threads discussing your question... (Why the hell you're using mathscript to convert a number to a different number?)

 

In the meantime you may play with that:

17501iD36BAEEE083DF07D

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(21,072 Views)

 

hi sir

i realy thank you alot GerdW because your advise helpt me so match in my project

 with all of my respect

and thanks again and again

 

0 Kudos
Message 7 of 11
(21,024 Views)

Hello, if you are still responding to this thread...I have a question.  How do you extend the significant digits to the number array?  I am trying to retain the forth number down in the attached array of text files: 15.0.txt - including the decimal ".0" after the 15.  The result I get is just ("15").

0 Kudos
Message 8 of 11
(12,886 Views)

I am not sure what you want to achieve here (maybe a VI would help ?) but have you tried to play with the array Display Format ? Right click on it and see what's available 😉

CLAMaxime -- Kudos are a great way to say thank you
0 Kudos
Message 9 of 11
(12,879 Views)

Hi Newton,

 

what about a better format string when creating those filenames?

Maybe "%.7f" would help!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 11
(12,875 Views)