DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Assign units with a script

I am struggling to assign a "proper" unit from the unit catalog to my channels using a script.

 

At the moment the "unit_string" property of my channels simply has a string e.g. "N" or "degC" written to it.

 

I thought I would be able to return a unit object from the UnitCatalog object and assign it to the channel but I don't seem to be getting anywhere.

 

Many thanks,

Steve.

0 Kudos
Message 1 of 4
(5,715 Views)

Hey St3ve,

 

Just to check, have you enabled the CalcQuantBased variable?

If this doesn't help, would you be able to send me your files so I could try to debug them for you?

 

Regards,


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 4
(5,684 Views)

Hi St3ve,

 

I'm sorry about my previous post, it seems that I misread your question.

Have you looked at this article on assigning channel units?

 

When referencing the channel "unit_string" and manually entering the units, what sort of output do you receive? Which units are you trying to reference, are they user defined?

 

As for the "unit_string" property only containing limited values, have you enabled the appropriate units in DIAdem?  You can do this by navigating to DIAdem » Settings » Options » Units to ensure that the appropriate selection have been enabled for use.

 

For configuring channel properties through referencing these sets, please see this article.

You can also define your own unit set programmatically as shown in this tutorial.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 3 of 4
(5,681 Views)

Hi St3ve,

 

DIAdem's unit management works like this.  Each channel has a string unit property which displays as "Unit" but which you programmatically save and read as "unit_string".  DIAdem has a Unit Catalog which provides lookup information for (ideally) all the unit strings that you could have in your channels.  You can change the unit string of a channel by changing the value of the "unit_string" property.  You can convert channels from one unit to the other using the ANALYSIS unit conversion functions and the starting and ending unit strings.  The conversion factors are stored in the Unit Catalog, and if you need to edit the Unit Catalog, you can do so either interactively in the dialog, or you can programmatically make changes with the UnitCatalog object.

 

You can not assign a Unit object to a channel, only the corresponding unit string.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,673 Views)