07-30-2008 10:12 AM
07-30-2008 10:22 AM
07-30-2008 10:30 AM - edited 07-30-2008 10:30 AM
07-30-2008 10:31 AM
07-30-2008 10:34 AM
07-30-2008 10:50 AM - edited 07-30-2008 10:51 AM
07-30-2008 12:46 PM
Sorry - my typo mistake - the Labview data does contain the correct 2E code for decimal point. Also, I made an incorect statement in any earlier post. The constant conversion was not skipping white spaces. I had entered 3235 362E and the conversion resulted in 3235, stopping at the whitespace.
If I could, let me lay this out once more from the beginning. It's getting a little confusing.
The data it coming from an external tachometer via an RS485 interface. The data format is ASCII string, formatted as xxxx.xxx (length varies with data as leading 0s are not transmitted). I want to be able to convert the data to a decimal number.
I'm receiving the data with a VISA read VI, removing the string termination CR charater (0x0D) and converting the remainder of the string to a decimal value. To test the conversion problem I've added a data select mux which chooses between the string output of the VI and a string constant.
If I control the speed the tachometer measures, set the mux to the VISA read output and run the VI so it reads a string, say 3233 342E 3130 300D, the resulting output from the 'Fract/Exp String to Number' VI (FESN) is 234. It stopped converting at the decimal point. Also, the Offset Past Number (OPN) output of the FESN VI contains 7, indicating that it converted 3233 34 as 234 and left the string 2E 3130 300D as not convertable.
If I enter 3233 342E 3130 300D into the constant, point the mux at it and run the VI the output is 23 and the OPN is 2, so it stopped converting at the whitespace.
If I enter 234.100 into the constant, point the mux at it and run the VI the output is correct with trailing 0s dropped at 234.1 and the OPN is 6.
07-30-2008 01:47 PM
07-30-2008 02:32 PM
Do you change the representation between those two actions of the constant?
fr@nk wrote:If I enter 3233 342E 3130 300D into the constant, point the mux at it and run the VI the output is 23 and the OPN is 2, so it stopped converting at the whitespace.
If I enter 234.100 into the constant, point the mux at it and run the VI the output is correct with trailing 0s dropped at 234.1 and the OPN is 6.
07-30-2008 02:37 PM
I had the thing torn apart before getting your last post and when I rebuilt it it worked just as it should. Unfortunately I don't know what I did wrong before but obviously I did something. Thank you for all of your help.
Frank