DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Set channel unit as target unit in calculation manager

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(5,467 Views)

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

0 Kudos
Message 2 of 6
(5,448 Views)

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

0 Kudos
Message 3 of 6
(5,422 Views)

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")@@'.

0 Kudos
Message 4 of 6
(5,412 Views)
Solution
Accepted by topic author MartinKozlowski

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

Message 5 of 6
(5,402 Views)

Hi Brad,

 

thank you very much for the info Smiley Happy

0 Kudos
Message 6 of 6
(5,348 Views)