08-16-2017 10:59 AM
Hi, I have an input string and I want to grab exponential value 0009.578e-01 from it. I could only get data up to the "e-". What am I doing wrong?
Thank you in advance!
Solved! Go to Solution.
08-16-2017 11:15 AM - edited 08-16-2017 11:17 AM
You don't have any separation between your numbers. How do you know when one number ends and the next begins?
You really aren't extracting any exponential numbers, you are just doing some string manipulations.
But you do have more after that e-. Your string indicator is just not wide enough to show it.
08-16-2017 11:18 AM
There is no way to know if the number is:
0009.578e-01
0009.578e-013
0009.578e-0130
etc. You definitely need to know how many digits the exponent has. Once you cut at the right place (using string subset), fract/exp string to number will work just fine.
08-16-2017 11:52 AM
Sorry, I should mention that the data field is 12 bytes
0009.578e-01.
Anyhow, it did work--I had my String Subset substring length too large and the indicator box too small so the string was not properly shown.
Thank you for the prompt response!
08-16-2017 12:41 PM
I think you should still look into your communication method so you get a distinctive delimiter between your numbers. What happens if one of your numbers happens to have the same combination of digits as you are using in your search function? Searching the string won't know if it found a tag or a value.
08-16-2017 12:59 PM
Yes, I do agree with you. Thank you.