02-09-2009 02:14 PM
I need to use some of the constant values on the Math & Scientific Constant palette to scale measured values. Some of them contain inherent associated units. Scaling my data using them results in error "you have connected numeric data types that have incompatible units - Source = NoUnits, Sink = XXX"
I prefer not to have to use the Convert Units vi and figure out what units to delete, etc. Is there a way to automatically just remove any and all associated units so they can be used directly as a simple constant ?
I have made a suggestion to NI for an option to be added to Convert Units to "remove all units" that would automatically do this. Or perhaps avoid the need to even use Convert Units by being able to popup on the constant and select a "unitless" setting option but perhaps there is an existing method I have overlooked ?
02-10-2009 09:21 PM
Hi SteveP,
I am not very clear on what your question and will try to answer to the best of my understanding.
I get the impression that you are using the Convert Units even when you nothing to add units to. You get the "you have connected numeric data types that have incompatible units" when you haven't specified units themselves. The Convert Units VI function is add units to a given value. So in your case, if your value does not need units, you are better off not using the function itself.
If I have misunderstood your post, please post back with an example of how it is working and how you would like it to work.
Thanks!
02-10-2009 09:35 PM
I am not using Convert Units. I just have some constants from the Math & Scientific Constant palette. When I use those constants and try to multiply, divide, etc and otherwise scale some other numerical data, I get an broken wire with the error saying "you have connected numeric data types that have incompatible units - Source = NoUnits, Sink = XXX". This seems because the constant has a unit associated with it and my numbers I am trying to scale do not have units.
One solution would be to remove the units from the constant using Convert Units.vi But I would rather not have to do that. I am wondering if it is possible to have these units be accessible without units associated with them ? I gave some suggestions on how that could be done (a new feature request basically).
Steve
02-11-2009 12:24 AM
The physical constants have physical dimension and thus you can't specify them without an explicit or implicit unit. Perhaps there could be an option for a "standard implicit unit", but this might not be the right unit for your calculation. If I were you I would use "convert units" to add explicit units to your numbers, then do the calculation, and finally convert the answer to the explicit unit of your choice. Such a method would have the advantage of being less prone to bugs.
-- James
02-11-2009 08:03 AM
Just because a number has units doesn't mean it cannot be used to scale another number.
Measured values from a DAQ card have units as well (volts). Yet I am not required to have units when I multiply such a value by some constant number in LV in order to change it to a number that represents something else to me (such as a pressure).
Likewise, if I mutliply two numbers together on a piece of paper, I do not have to write down units in order to do that.
Same idea here for what I am asking.
Steve
02-11-2009 05:48 PM
Hi Steve,
I have attached an example for you to take a look at to ensure that I understand your question correctly. If I understand it right, you are using one of the math/scientific constants and it uses the units that associated with the constant. However, you want to strip the units from it?
I used the output from my result and wired it to a Convert Unit function. This stripped the associated unit from it.
Is that what you need?
02-11-2009 06:11 PM
Your question is confusing to me because what you want (a way to strip the unit from the dimensioned constant) already exists in "Convert Unit". If you want the speed of light in meters/second, for example, just feed the "c" constant into a Convert Unit with "m/s" in it, then the wire coming out can be used in any way you want. Trivial. So I don't understand.
-- James