[posted and mailed]
eodickens@excite.com (Ed Dickens) wrote in <8v3nan$ohr$1@nnrp1.deja.com>:
>I'm new to Labview so this might be a simple one.
>
>I'm trying to control a power supply on a com port. The problem I'm
>having is when trying to set the voltage and current. The power supply
>needs the string in the format of xx.xxx, it must have all 5 digits or
>it will not recognize it as a valid command.
>
>Here's the process I'm using.
>
>First I read a control for the voltage setting from the front panel,
>then use the "Format Value" function with a format string of %.3 to
>convert the value to a string with 3 decimal places. This works fine for
>any value over 10, but any lower value doesn't have the tens digit and
>only outputs x.xxx. I need to get a leading 0 on anythi
ng under 10.
>
>I've actually figured out a way to it by counting the output string
>length and using an "Append true/false String", but this ends up messing
>up the values over 10.
>
>Is there another format string syntax that will force 2 places before
>the decimal?
This has benn answered by others, but did you know you can double click on
the "Format Into String" and "Scan From String" icons. This will bring up a
dialog box that will allow you to slect zero leading, number of dp's, etc
Alex.
--
Alexander C. Le Dain, PhD
ICON Technologies Pty Ltd
http://www.icon-tech.com.au
******************************************************************
* The LabVIEW FAQ http://www.icon-tech.com.au/thelabviewfaq.html *
******************************************************************