DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

re-creating graph annotations in diadem?

Hi,

 

I am currently going through the demo version of diadem, and am impressed with it's reporting capabilities.  I have an application where I am automatically placing graph annotations during my test, then when I save the .tdms, I store the annotation information (index, name etc) in groups named "annotation01", "annotation02" etc, to the tdms file.  Currently, I have a separate labview utility in which I load the tdms file, and place the annotations back in the graph, so I can post process the data and see the annotations.  It seems that if diadem can display text over graphs when viewing the data, I may be able to make a script to place these annotations using diadem.  Is diadem capable of this?

 

 

Thanks

David J.

0 Kudos
Message 1 of 16
(5,468 Views)

Hi David,

 

Yes, DIAdem can place texts automatically onto a graph from strings stored in the TDMS file.  Do you want these texts to display at the beginning/end of certain curves, or do you want them to display above/below certain X values?  In the former case I'd recommend storing them as properties, while in the latter case I'd recommend storing Xlabel and Ylabel channels with the X value and Ylabel string, respectively for each of these text annotations.

 

In both cases DIAdem has curve properties than enable you to automatically reference these texts from the loaded properties/channel values from the TDMS file and place them at the correct locations on the graph.

 

Brad Turpin
DIAdem Product Support Engineer

National Instruments

Message 2 of 16
(5,449 Views)

Hi,

I would want them to display above/below certain X values, the latter.  I attached an example of how they are currently displayed. 

Each annotation element in the annotation array has an "index" value associated with it, which is the location in the array of data it should point to on the graph.  Each annotation element also has an x and y associated with it, that is stored along with the information.  Would diadem be able to reference this index and locations somehow and place the associated text correctly?  Or do you mean that, in addition to (or rather than) storing the annotation into groups of the tdms file as they are currently with this information contained, that I should store additional channels, in which I would store the x and y position values of the labels and associated texts?

 

Thanks

David J.

Message Edited by david_jenkinson on 10-07-2009 12:57 PM
0 Kudos
Message 3 of 16
(5,444 Views)

Hi David,

 

OK, so the simplest way to do this would be to create Xlabel and Ylabel channels in DIAdem which contain the X value (not array index) and the Y text to display, respectively.  It looks like it'd be best to rotate the label 90 degrees so they don't overlap as much.  DIAdem can add text labels to any plot from additional X and Y channels, so you can configure this to be part of the regular line display you have in your LabVIEW graph image.

 

The vertical arrows pointing down can also be done but not easily or elegantly or robustly-- do you really need them?  A vertical line displaying at each marker point would be moderately easy and robust, but to actually get the arrow head at the bottom you'd need to use the DIAdem "decorations", which you position as a % of the REPORT sheet (i.e. NOT relative to any X axis).

 

If you send me the raw data file I can assist you with the REPORT layout file and any scripting necessary.

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 16
(5,423 Views)

Hello Brad,

If the text were rotated, there is less need for the arrows, and could probably be omitted.  The annotations are purely for post processing purposes, to give some idea as to what was happening at that point in time in the test, and don't need to be super accurate as to the exact sample it is associated with, but very close.

I'd appreciate the help with the scripting.  If you could please just afterward tell me the high level steps you go through to create the scripts I'd appreciate it, as I really want to get a handle on the scripting aspect.  I've done very little VB in the past but it looks rather straight forward as compared to other languages (I do have some C and Basic experience).

 

Attached is an example of a tdms file with annotations which were saved along with our automated test.

 

Dave J.

0 Kudos
Message 5 of 16
(5,418 Views)
BTW, the channel which the annotations are associate with is the "Current" channel.
0 Kudos
Message 6 of 16
(5,416 Views)

BTW, I am noticing something very strange when loading my tdms file and annotation information.  When I am saving the annotations, I am saving the annotation name (string that gets displayed in the annotation), index, label offsets, and positions of the annotations.  I notice that when browsing the annotation elements when in the data portal, the "name" is displaying the name of the group, and not the string which was saved to the property "name".  Perhaps diadem is getting confused by a property being called "name", when a field is already using "name" to display the group string?  I know it exists, because the vi I use to repopulate the annotation array of the graph loads the array fine and displays it properly. 

 

There is also a property called "index" which I save with the annotation, and it appears diadem is renaming it to "index1" because an  index field already exists (by default?).  So maybe diadem should be creating a "name1" for the annotation name?

Message Edited by david_jenkinson on 10-08-2009 03:13 PM
Message Edited by david_jenkinson on 10-08-2009 03:14 PM
0 Kudos
Message 7 of 16
(5,413 Views)

Hi David,

 

You don't have any Channels in that TDMS file!  All your values went into Group properties.  In order to graph anything in DIAdem you need to have Channel data.  It looks like you used the "TDMS set Properties.vi" to write each value, instead of putting all those values into an array or a waveform and writing each array/waveform to a separate Channel with the "TDMS Write.vi".  Make sure you wire up the Channel Name input with the name you want to have display in the Data Portal.  Please send me another TDMS file when you have Channel data values in the TDMS file.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 8 of 16
(5,396 Views)

Brad,

I am actually saving the graph data to channels using "tdms write".  The tdms write inputs are group, channel name(s), and data.  I am assigning the group input the string "Battery", and the channel names "Battery current" and "Phone Voltage".  Do you see what I am seeing in diadem?  (attached).  I can indeed graph the channels with the view tab, using the file I posted.  All of the annotation info, uut info, test info etc is using the "tdms set properties" tool.  

 

 

 

 

Message Edited by david_jenkinson on 10-12-2009 04:12 PM
0 Kudos
Message 9 of 16
(5,365 Views)

Hi David,

 

Sorry, I got lost in all those "AnnotationArrayElement" Groups.  You're right, your first Group has two data channels, and I can also graph those in DIAdem.  But all your label information is stuck in Group properties, and this is the information I was referring to that should be written to Channels with the "TDMS Write.vi".  I've written a DIAdem VBScript to reorganize your TDMS file into the structure I think is ideal for your data and am attaching a representative TDM/TDX file as well as a picture of what the labeling could look like.

 

One problem I ran into when doing this was that I didn't find the label texts.  Your first attached image above showed text event labels on the LabVIEW graph, but I don't see these texts anywhere in the TDMS file.  So what I did instead was to pretend that the "Index1" property was the text label to display.  Also, you have 2 separate XY coordinates in each "AnnotationArrayElement" Group, I just randomly picked the "Position" properties instead of the "Label_Offset" properties.  Why are there 2 sets of XY coordinates as well as the value index (triple redundancy?), and how should that information be translated into the desired XY coordinate to display the event marker or label?

 

Finally, you have several Groups that just contain set up properties-- I'd strongly recommend you fold all those properties into the same data Group that has your measured data arrays-- that will make for much better DataFinder querying down the road.  I also found a "Sample_Rate_Hz" property in one of the Groups, so I used that to turn your "Battery Current" and "Phone Voltage" channels into waveform channels in DIAdem, and I added unit assignments of "mA" and "V" respectively.  But if they were waveform channels in LabVIEW you should have just wired the waveform up to the TDMS Write.vi and they would have loaded into DIAdem as waveforms automatically.  As a result, I scaled the "PostionX" property from X value to Time value.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

 

Download All
Message 10 of 16
(5,352 Views)