10-08-2014 03:08 AM
Hi,
is there a way to set a channel unit as target unit in the calculation manager? I've got data with unspecified units (e.g. deg_Cel for °C) so i disabled the quantity based calculation. Now i want the result channel to have the same unit as the first input channel (something like @@ChnUnit(N)@@).
Best regards
Martin
Solved! Go to Solution.
10-08-2014 04:48 PM
Hello Martin,
just checking: Are you aware that you could easily add "deg_Cel" as an alias for "°C" to the DIAdem unit catalog ? This is just an example. Whatever unit string you have, it can added and with that DIAdem would recognize the unit. The only requirement is that the unit names have to the unique
Andreas
10-09-2014 11:04 AM
Hi Martin,
Not only can you add your own unit string aliases to the unit catalog, as Andreas suggests, but you can indeed specify a default unit to use for each physical quantity (i.e. speed --> mph). You should really give the unit catalog and quantity-based analysis a try. Once it's set up properly, simply loading your existing data channels will result in automatic unit string correlations and in some cases unit conversions to take you to the preferred unit for each physical quantity loaded. any new calculated channels will automatically receive the correct (default) unit based on the units of the input channels that created them.
If for some reason that doesn't work out for you, the array variable you're looking for is ChnDim()
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-10-2014 01:06 AM
Hi,
thank you for your clues, but that's not what I'm looking for. The unit names are highly volatile, so if a user runs the analysis he must map the new unit name on the fly.
Though i am mapping the units in a database (openMDM) and i am updating the scripts with this mapping, but this often happens after the analysis.
The ChnDim solution doesn't work either, the created channel gets the unit 'ChnDim("asdf")' or '@@ChnDim("asdf")@@'.
10-10-2014 09:52 AM
Hi Martin,
You can run the Calculation Manager without unit management (turn Quantity-Based off). You can set the unit property of the resulting channel with ChnDim() to be the same unit as the starting channel. I'm assuming you're doing all this with a VBScript. Are you in fact running the Calculation Manager by hand with the mouse?
You can add on as many lines of VBScript code as you want to the end of the normal equation. Here's an example calculation that ships with DIAdem:
P = n * ( 2 * Pi / 60) * M * (1 / 1000)
If you click on the <Extended> button, you can add the following second line underneath the VBScript call to run the equation:
Call Calculate("P = n * ( 2 * Pi / 60) * M * (1 / 1000)",CurrSymbols,CurrValues,"kW") ChnDim(P) = ChnDim(n)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-15-2014 01:09 AM
Hi Brad,
thank you very much for the info