07-22-2008 09:32 AM
07-23-2008 06:50 AM
Perhaps the diagram would help the description....
I'm sure it must be easy......when you know how...
AdeK
07-23-2008 09:16 AM
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
07-30-2008 11:16 AM
07-30-2008 03:34 PM
Hello AdeK!
Sorry, but you are right! To help you learning VBS I can give you one possible solution:
Option Explicit
Dim i
Dim d
Dim nChnX
Dim nChnY
Dim nChnZ
nChnX = CNo("X") ' get X channel number
nChnY = CNo("Y") ' get Y channel number
' allocate result channel
Call ChnAlloc("Z", ChnLength(nChnY))
nChnZ = CNo("Z")
ChnLength(nChnZ) = ChnLength(nChnY) ' DIAdem is a little bit special with this ;-)
d = ChdX(1,nChnX) ' start value
ChdX(1,nChnZ) = d
' calculation
For i=2 To ChnLength(nChnX)
d = d + ChdX(i-1,nChnY)
ChdX(i,nChnZ) = d
Next
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
07-31-2008 09:40 AM
Hi AdeK,
The calculations you want to carry out are indeed simple to accomplish in Excel, because this is what Excel was designed to do. These same calculations are difficult to accomplish in DIAdem because this is NOT what DIAdem was designed to do. DIAdem is at its best when you load long data columns into Data Portal channels and you want to graph or analyze the whole column at once. DIAdem does pretty well when you want to run calculations on multiple entire channels of the sort Ch5 = Ch1 + Ch2*sin((Ch3 - Ch4)/pi). These calculations run efficiently and they're not too hard to construct in the Channel Calculator.
But DIAdem has no native tools to assist you in setting up a relationship between individual cells in one or more channels. Excel does this elegantly by assigning the entire function to each cell. That gives you all the cell-by-cell flexibility you could wish for, but it comes at a cost. If you want to do the sort of calculations that DIAdem does easily-- long column manipulations, you have to copy the same formula into every cell of that column, potentially millions of times. Each of these cell functions has to be parsed separately and run individually. Deep array analysis is the bane of Excel the same way that arbitrary cell referencing is the bane of DIAdem. Said differently, deep array analysis is the natural domain of DIAdem in the same way that arbitrary cell referencing is the natural domain of Excel. You can accomplish both types of analysis in both DIAdem and Excel, but some analysis types are just naturally easier in each respective application.
How are you loading your data into DIAdem? Perhaps those cell values really should be loaded in as scalar properties instead of channel values. Where does your data come from and what is the data file (or data base) format? It may be that we can make this analysis much more natural for DIAdem by simply changing the way the data is being loaded into DIAdem. What is the end goal of these calculations? Do you want to display your results in a graph (if so what type), or in a table?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-01-2008 03:55 AM
Hi Matthias,
The script works perfectly !
I can delay the VBS course to another day...
Regards and thanks again.
AdeK
08-01-2008 04:01 AM
Hi Brad,
I realise Diadem is a very powerful tool for data analysis, and I cannot work without it.
Therefore because the tool is so good, I expect it can easily perform tasks which I know can be performed in excel.
But you are completely right, they should not be compared.
I can never go back to excel !
I will book a VBS course when I have some time.
AdeK