DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Build graph from single point data in multiple files

I need to build a XY graph made up of points from multiple files (maybe hundreds and not always the same number of files). The X points would come from each file in a custom group property called "Energy" and all the Y points would come from each file in a custom group property called "Count". I'm not quite sure how to get started on this one.
 
George
0 Kudos
Message 1 of 6
(3,819 Views)

Hello George,

You could help me to understand your requirements better. Looking at the files which belong together, how do you know they belong together ? Do they have a common element in their names or are they all in the same directory ? Can you provide an example of the file ?

Andreas

 

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

I figured that all of the files (or maybe more correctly, data) would be loaded in the data portal. As an aside it might actually be nice if the files didn't have to be loaded there. It can take a long time to load that much data. All the files will be exactly the same in structure. After some thought I came up with the following script. I doubt if it's very efficient. It'd be nice if I could send it right to a graph instead of having to create channels.

MyChnName = ChnAlloc("AllCount", 1000, 1, ,"Numeric",1,1)       'Allocate pulse count channel
MyChnName = ChnAlloc("AllEnergy", 1000, 1, ,"Numeric",1,1)      'Allocate energy channel

For i = 1 to ChnNoMax/2 - 1           'There are two channels per group. The - 1 is because I just created two channels
  ChD(i,"AllCount") = GroupPropGet(i,"Pulse_count")
  ChD(i,"AllEnergy") = GroupPropGet(i,"Energy")
Next

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

Hello George,

the approach you have choosen seems OK to me. DIAdem requires the data to be in a channel to be displayed in a graph.

Andreas

0 Kudos
Message 4 of 6
(3,803 Views)
Hi George,
 
You're talking about doing this in DIAdem 10, aren't you?  In that case you could use the new NAVIGATOR api and it's context menu customization features to create a context menu method which will read only those two group property values from each of the queried (and selected) elements, without having to load the bulk data from the queried (and selected) data sets.  The rest of the VBScript would be similar to what you have posted.
 
I'm still coming up to speed on this myself, but I will be working on exactly this sort of thing today, so I'll have example code I can send you soon...
 
Feel free to contact me directly for it,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 5 of 6
(3,795 Views)

I wasn't sure if I could use any of the DIAdem 10 specific functions or not. But what you mentioned sounds great. I anxiously await your examples.

 

George

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