03-01-2012 07:26 AM
Hi everybody. A funny question.
Using the "Convert Unit" function I try to convert a time string with units (i.e. "1Gs") into a double number represented in the correspondent base unit.
For example:
String In: "10ms".
A simple code separates the "numeric string" from the "text string". This is <10> and <ms> respectively.
Using the "text string" as the selector input of a case structure I use the "Convert Unit" function to convert the unitless "numeric string" into a double with time units.
I have done this for all SI prefixes (m or mili, M or Mega, etc.).
The point of my question is the following. When construction the units for Gigaseconds, or Gs, LabVIEW detects it as a Gauss. This causes a broken wire error because LabVIEW believes I want to connect magnetic flux density units (tesla or gauss) with time units (seconds).
Is there a way to especifity that the "G" in "Gs" is actually a prefix and not part of the unit itself?
Thanks!
Solved! Go to Solution.
03-01-2012 08:05 AM - edited 03-01-2012 08:05 AM
Let me state first that I don't use units, so this may be wrong, but as far as I know, there's no way to change the order in which units are interpreted, so I think the only thing you can do in this case is to do a double unit conversion. You'd have to take the unitless numeric value and multiply it by 1E9 to change it to the equivalent number of seconds, and then set the unit to seconds. Then you could follow that with another Convert Unit that changes it to Gs.
03-01-2012 08:05 AM - edited 03-01-2012 08:07 AM
Simple solution: just put a space in between.
So: "G s" is gigaseconds
and: "Gs" is gauss
03-01-2012 08:11 AM
Ha! Now that's much better. Makes sense, since a space is used to indicate multiplication.
03-01-2012 12:14 PM
The gauss is not an offical SI unit. Using the preferred tesla (T) should avoid the problem. 1 gauss = 10^-4 T.
Information is from the Guide for the Use of the International System of Units (SI), NIST Special Publication 811, 2008 edition.
Lynn
03-01-2012 02:04 PM
I know that. Thanks for your comment but that does not really solve the problem. As concluded, Gauss units (Gs) can be distinguished from Gigaseconds (Gs) by introducing a space between prefix and unit, so "G s".
03-01-2012 06:01 PM
The gauss is also not listed in the LV help. Search the help for
Lynn