DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

re-creating graph annotations in diadem?

Hi Brad,

>One problem I ran into when doing this was that I didn't find the label texts.

Yes I can't figure that out either, see my above post on that.  This to me seems like a bug in loading that information, because I know that information is present in the annotation groups.  I can load that data back into the annotation array fine in my labview based read routine.  So why would this "name" property not load properly?  Maybe a nameing conflict with the "name" field for the group in diadem?

>Why are there 2 sets of XY coordinates as well as the value index (triple redundancy?)

The structure of how I stored the annotations was really dictated by the type definition of the annotation array in the labview graph itself, over which I have no control.  The annotation array is a property of a graph, in which each element has "name", "x position", "Y position", "label offsets", "index" and a bunch of other propreties.  All I am doing when I place an annotation in my code, is add an element to this array assigning a custom "name", and "index", and how I want the label displayed, by assigning values of offset x = 0 and y = 100.  Labview then calculates the position elements (in pixels? not sure) ,and also the offsets to some other value, which I haven't figured out why, all other annotation elements remain at their default.  So at the end of the run, I have an entire array of annotations which are a property of the graph, in the format the graph control dictates. I am saving only the properties I know I manipulated, or labview manipulated based on my settings (the xy positions), which are the ones in each annotation group, to the tdms file.  The only way I could think of at the time to store these annotations to the tdms file is have each element it's own group, and have another group called "annotation" hold the number of elements, so I knew how many times to look for an annotation group when loading back in.  

I should probably explain how I am gathering the data.  Yes I am sampling at 64000 Hz, but the data is being integrated over the time period contained in "integration_period", which is 50ms.  That is to say, that each sample is an average of the samples taken over each 50ms time period, so the data is really stored at 20hz.  A subvi does this integration average calculation, then outputs and average number for each channel.  This number is added to the channel arrays of the graph.  So there is no "time" element to the channel.  I am scaling the graph itself to display the time x axis correctly, by setting the graph x.multiplier property to .05.  So I would want to be able to scale the x axis based on this integration period.  I believe I started another post on this subject in the forum, and the difficulty I was having scaling the axis. 

Since the "index" is stored in the annotation, which corresponds to the element in the channel it is placed against, could I not run a script to create a channel from the annotation elements, placing each annotation at the sample index in the "current" channel, then taking "name" of the annotation (once it is discovered where this info went), and adding it to the top axis as you have done?  This seems close to doing what you must have done to create the annotation channels in your example.  Can you possibly attach that script?

long post

Thanks
Dave
0 Kudos
Message 11 of 16
(1,671 Views)

Hi Dave,

 

Congratulations, you are the first customer I've found who has actually used the "Name" property for something other than the Group or Channel Name.  This is possible in LabVIEW but in none of the other NI application software packages that use TDMS (DIAdem, CVI, MeasurementStudio, SignalExpress).  That label is available to be read in LabVIEW but is trapped behind the overloaded "Name" property in all the other NI application software packages.  R&D knows about this and is working on ironing this out, but for the moment I can only advise you to not assign any property value to the "Name" property in LabVIEW.

 

But I'm actually suggesting that you rearrange the data you have in LabVIEW as an array of clusters of N elements into N separate arrays and send each of the N arrays toits own data channel with the TDMS Write.vi.

 

I think it would be best to continue this session in regular email.  If you agree, please send me the VI that you use to write the TDMS file.  I am willing to send you the VBScript that reorganizes your existing TDMS files, but I'd rather not do that until it works better.  And ultimately, the VBScript will not find the label text in the overloaded "Name" property, so it will never be able to fully reorganize the existing TDMS files.  We may need to write a LabVIEW program to do that instead.

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

brad.turpin@ni.com

0 Kudos
Message 12 of 16
(1,662 Views)

Hi Brad,

I'm kind of bound to use "name" in an annotation because that is what the typdef is defined as, by NI.  I am not sure why it is named "name" and not "label", because that is what it really is.

 

I can experiment with writing these channels as you suggested.  

 

But I am thinking, maybe I don't need to save the "position".  I am imagining, since only a very small subset of the samples actually have an annotation label associated, my "name" channel array data would consist of mostly empty string elements, but the non-empty elements strings would have an entry at the same index in the array as the sample in the current channel it is associated with.  Would storing the strings to a channel in this way be enough to display properly when viewing?  It seems like it would (?).   It would be pretty simple to post process the annotation array in this way, and store to another channel along with current and voltage using tdms write, with an annotation label entry and the index where it is associated with the data.

 

Thanks

Dave J.

0 Kudos
Message 13 of 16
(1,660 Views)

Hi David,

 

Yes, it would be very simple and sufficient to create one label channel with the same number of array elements as you have in your data channels.  It would be even more efficient to store a label channel and an index channel such that the label channel has no empty strings in it.  This would be more efficient, but it would be slightly more complicated.  I would be happy to go with your suggestion and show you how to get those labels on your DIAdem graph.

 

What's the longest data channel you expect to have?

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 14 of 16
(1,646 Views)

Brad,

Do you mean the index and label channel would have as many elements as there are annotations, and the index channel would hold the index tha corresponding annoation is associated with (with the current channel).  I can see how the latter would require some scripting, which is ok.  And you are right that would be more efficient.   I can actually adjust my code to do both methods temporarily to see what works better.  Once I have a tdms file with this information maybe I can post it and you can have a look.  

We are running a long duration test, up to 48 hours, so there can be 3 to 4 million samples, integrating at 50ms.  There can be 300 to 400 annotations in this data as well.  

 

Anyway I will work on making some small modifications to my code to store those channels and play around with that.  

 

I only have 7 days left on my evaluation, is there the possibility of extending 30 days?  I am still playing around with the databasing aspect as well, which if I can get some reporting done the way I want will be really good justification to my manager.

 

Thanks

David J.

0 Kudos
Message 15 of 16
(1,643 Views)

Hi David,

 

Sounds like a plan.  Try asking Otmar for the evaluation license extension-- he's the DIAdem Business Development Manager (otmar.foehner@ni.com).

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 16 of 16
(1,641 Views)