DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Units Convert Overwrites Description

Solved!
Go to solution

Hello All

 

I'm a big DIAdem fan and evangelize for it every chance I get. One of my users encountered a problem the other day that involves unit conversion. I have not been able to fix the problem but it's easy to reproduce. I have a channel that records temperature in degrees F and I want to change it to Celsius. In data portal I click on the unit property and change it from F to C. But now the text that was previously in the description property, for instance "Reactor Core Temperature", is replaced with group number and channel name. For example: Input: [4]/Temperature_1 (16). This causes a lot of trouble because we use scripts that extract the descriptions to use as text in reports. Why does DIAdem do this and can I turn it off?

 

Dave

0 Kudos
Message 1 of 6
(3,857 Views)
Solution
Accepted by topic author DLClark

Hello Dave,

Great to hear that you enjoy DIAdem.-

This is an optional behavior. Depending on what you are doing in DIAdem this is documented in the property "description". If you go to the DIAdem settings you can switch this off.

 

Channel Settings

 

Greetings

Walter

0 Kudos
Message 2 of 6
(3,838 Views)

If you press Ctrl+Shift+c in the dialog shown by Walter you alse get the script parameter to be used to switch it off.

ChnCommentOver   = 0

you can integrate it into your scripts.

To avoid changing global state you can use an auto class that will set back if script is finished.

' create an instance of the auto class at the start of your script
' or in the scope where you want to change the behavior
dim accoo : set accoo = new AutoChnCommentOverOff

' ....

class AutoChnCommentOverOff
  Private Sub Class_Initialize()
    oldState_ = ChnCommentOver
    ChnCommentOver = 0
  End Sub
  Private Sub Class_Terminate()
    ChnCommentOver = oldState_
  End Sub
  private oldState_
end class

 

0 Kudos
Message 3 of 6
(3,833 Views)

That did the trick. Thank you so much! My users will be happy that they don't have to replace the comments when they convert units.

0 Kudos
Message 4 of 6
(3,826 Views)

I haven't tried the script yet but since the script generator created the statement "ChnCommentOver  = 0" it is likely to work. I have to ask though, what was the purpose for overwriting the comments? Why not create a new property and put the information there, avoiding the loss of information? Anyway the solutions work and everyone is happy again.

 

Thank you,

Dave

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

Hi Dave,

 

I share your frustration that property overwriting occurs at all.  The reason is that before DIAdem 9.0 there were only a static number of properties, as defined by the DIAdem DAT file format.  It was not an option to create new properties, so the only choice was whether to clobber an existing property value with information about the action that edited that channel (usually the ANALYSIS function name).  R&D decided at the time that traceability was more important than the information loss.

 

So the obvious follow-up question is why not change things now that we can create any properties we want?  That may happen, but one voice against it is that for decades customers have gotten used to this behaviour, and some of them may be relying on it.  Feel free to vote for a change in the DIAdem Idea Exchange forum.  The more customers who ask for change, the more likely it is that it'll happen.

 

https://forums.ni.com/t5/DIAdem-Idea-Exchange/idb-p/diademideas

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(3,759 Views)