Calculation in diadem

Hi, 
I am Trying to automate  the Report Generation by using the VB  script, I can do all the calculation in the Excel sheet but how I can implement the same in the Vb script.
I want to take a mean of 2 cell in X channel and output the sum in channel Y.   Y= X+(X-1)  / 2
then Multiply the channel Y with  9.8 to give the output in Channel Z.  Z= Y * 9.8 
I need to do all the calculation in all the cells. 
also I need to query a set of command in the Specific channel with 100 and 0 as the start and end points in the channel.
If any body can know I can implement this in the VB  scripts, It would be a great help. 
Thanks
Veer
Solved!
Go to Solution.

Hi Brad, 
I have emailed you today morning and I have mentioned that "V-1" is the previous speed in the previous one row up.
We generate DAT files and convert it to excel format to do all the calculation.  Yes, I want the each incremental distance between each speed data point which I can calculate now which I have programmed in diadem by using the Diadem help section.
but One more thing I need to do is to  to Add all the incremenatal distance of the speed Data but only for a interval from 100 kmph to 0 kmph. 
this occurs for 5 times and I need to calculate the total incremental distance all the 5 stops and this is a only one data files. 
I have checked in the Diadem help and I can calculate the mean distance by using the flags and using the analysis in stastical analysis tab, but It does only for 1 interval and I need to calculate 5 interval and also if u see the excel sheet there are some data points between 0 kmph to 100 kmph in incremental order of speed which I should be able to ignore and just do the summation only between 100 kmph to 0 kmph.
I haven't checked your vb script yet , I will check tommor morning in office because I don't have diadem software in my Laptop, I am based in UK.
Thanks for all your help and will inform you about the outcome of the program.
Regards
Veer 

Similar Messages

  • Load Collective / Duty Cycle calculation in DIAdem

    This is probably quite simple to do, but as yet I have only got part way there, so I could use some help!
    Basically I have some shaft torque and speed datalog files, from which I like to extract a table of number of shaft revolutions at discrete torque levels for use in CAE fatigue analysis, like this:
    423 revs @ 1000 Nm
    569 revs @ 1200 Nm
    143 revs @ 1400 Nm
    The "quantize" script gets me part way there - this can reduce the torque curve to 200 Nm steps, and it's easy enough to integrate the speed to give the cumulative number of revolutions, but now I need to count the number of revolutions at each quantized torque step, and output the results.
    There must be a way to do this with all the tools available in DIAdem, but being a new user, I'm struggling to find the correct method.
    Any help would be appreciated, thanks.
    Solved!
    Go to Solution.

    Im not intending to steal this thread but I have a quesiton very similar to this...
    I have some RPM and Load data in addition to Fuel Consumption data. Attached are some pictures of an example an individual from Germany has done along these same lines but I cannot seem to replicate the process.
    My goal is to generate a 3D plot with Engine Speed (RPM) and Engine Torque (%) on the x and y - axis respecitively and % Fuel used on the z-axis. I've been playing around with the Compound Classification function in the ANALYSIS tab.
    Can someone point me in the right direciton regarding this?
    Thanks,
    ~Nate 
    The first attachment is the example from the German individual
    The second attachment is my current setup
    Attachments:
    Germany Load Collective Example.JPG ‏296 KB
    MySetup.JPG ‏202 KB

  • Execute Excel Macro Through DIAdem

    Hi All,
      I am currently trying to run a script in DIAdem which exports certain material properties to an Excel Macro-enabled workbook.  Inside the Excel workbook the user executes a macro to perform some calculations.  The results of that calculation will then be re-imported into a DIAdem report.  I have the import/export data part down, but the million dollar question is how can I execute an Excel macro from DIAdem's VBScript?
      I know some are going to say this makes no sense, just do the calculation in DIAdem.  I know this, but the file/calculations are an industry accepted toolbox and it must be done this way. 
      Thanks in advance and here is some dumbed down code to showcase the example:
    Option Explicit 'Forces the explicit declaration of all the variables in a script.
    Dim excel
    Dim excelbook
    Dim a
    Set Excel = CreateObject("Excel.Application")
    Excel.Visible = True
    Set excelbook=Excel.Workbooks.Open("My File")
    excelbook.Sheets("InputResults").range("B5").value = Data.Root.ChannelGroups(ChanGrp#).Properties("myProp").Value
    'Call 'My_Macro' !!!!!!!!!!!!!!!!!!!!
    Msgbox("Result is: " & excelbook.Sheets("InputResults").range("B5").value)
    Solved!
    Go to Solution.

    Hi GT_Mark
    You simply can use the methode Run
    Call Excel.Run("MyMacro")
    Of course you have to make sure that you refer only to data that are available in Excel.
    To obtain CodeCompletion for Excel in the script editor select Microsoft Excel x.x Objects Library in the "Registed Type Libraries" dialog box. The x.x value depends on your installed Excel version.  To open this dialog box, select Script»Type Libraries in DIAdem SCRIPT.
    Hope this helps
    Winfried

  • DIAdem 2010 Advanced Edition

    Is it possible to do probabilty distribution calculation in DIAdem??
    For a some analysis, i need FFT and PDF(Probability Distribution Function) calculations.
    I got FFT but unable to get PDF... 
    Just wanted to know where to find that function in DIAdem 2010.
    Regards.
    Solved!
    Go to Solution.

    Hi Bijay,
    Here's an example you can run.  It uses older DIAdem 10.x functions, but it still works in DIAdem 11.x/20xx.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Normal Distribution.zip ‏41 KB

  • Diadem FFT script

    Hello
    I’m trying to do an FFT and a PSD on some acceleration data that varies from amplitude in (g’s) to zero then to an amplitude.
    I would like to remove the part when the data goes to zero then to amplitude before I run the FFT.
    I currently do it manually using the band cursor in DIAdem. I’m new to the DIAdem and I was wondering if somebody can help.
    Thank you,

    Hi DSP_ott,
    You can remove the offending values in your channel by using the CTNV function in the calculator:
    Ch("YourChannelName") = Ch("YourChannelName") + CTNV(Ch("YourChannelName") = 0 Or Ch("YourChannelName") = AmplitudeValue)
    This will replace all channel values equal to zero or AmplitudeValue with NoValue, which will be ignored when computing the FFT.
    For more information about working with NoValue in the calculator, please refer to this KnowledgeBase:
    Working with NoValues in the Calculator in DIAdem 10.1
    Regards,
    Message Edited by James M on 06-05-2007 10:57 AM

  • How does the ASI calculatio​n find place

    Hello, we have some questions about the ASI criteria calculation in DiaDEM. Wich channels do we need? Does the ASI Calculation filter the data? If so, with what filter? Is it possible to draw the calculation on paper so we can compair it with ouor version in Mathlab?

    Hi JoeBar,
    The ASI calculation does not contain a filter, but rather a running average, which is what the "Length of interval" parameter is for. The other 4 inputs are the time channel and the X, Y, and Z accleration channels.
    Refer to Norm EN 1317-1, Road Restrain Systems, Part 1: Terminology and General Criteria for Test Methods for more details on this crash function.
    Regards,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to create Coloured bar scale

    Hi,
    I am working on Diadem12 and I want to create a colour graded bar scale showing the current performance of my test result in percentage of the allowable limit.
    Detail : Consider I have a variable calculated in Diadem which corresponds to perfomance of my test and I have upper limit for this value. I want to show the calculated value for my test as a percentage of the limit and if the percentage is
    less than 80%, then it should be filled  with green
    between 80 to 100% then it should be filled with orange and
    more than 100%  then it should be filled with red.
    (pls see attached snapshot)
    For example: Lets say the upper limit for max acceleration measured is 150 and the x be the measured value in my test (in percentage of the upper limit). Now if x is less than 80 then bar should be filled with green, between 80 to 100 to be filled with orange and more than 100 to be filled with red.
    Please let me know possible ways to do this.
    Regards,
    Fazil Shah.
    Attachments:
    Picture1.jpg ‏57 KB

    I was able to do this by creating a 2D axis in the report (which can be include in the template file) and then creating rectangular frame with fill and then positioning it same as the 2D axis by the following code.
    Dim oMyFrame, oMyBackgroundColor, oMyPosition, oMyBorderLine, oMyShadow
    Set oMyFrame = Report.ActiveSheet.Objects.Add(eReportObjectFrame,"MyFrame")
    Set oMyBackgroundColor = oMyFrame.BackgroundColor
    Call oMyBackgroundColor.SetPredefinedColor('colour variable depending on value))
    Set oMyPosition = oMyFrame.Position.ByCoordinate
    oMyPosition.X1 = 60 -----------------------------------------------------(X1 position of 2D Axis)
    oMyPosition.X2 = 70 -----------------------------------------------------(X2 position of 2D Axis)
    oMyPosition.Y1 = 60 -----------------------------------------------------(Y1 position of 2D Axis)
    oMyPosition.Y2 = ValMin(Y1+(% value ),80) ----------------------(80 is Y2 for 2D axis)
    Now a problem I am facing is that, this works only in Diadem 12, can any1 help me in modifying this so that this works in Diaden 11 also?
    Attachments:
    bar scale.jpg ‏12 KB

  • Replace text values

    Hello.
    I have problem with replacing values in text channels and I can't find solution.
    I have couple of channels filled with only 2 values: OK and NOK. How can I replace these values with for example 1 for OK and 0 for NOK ?
    This replacement is needed for a chart drawing. With current values I can't draw the chart because Diadem don't accept text values as a scale.
    Thanks in advance :-)
    Solved!
    Go to Solution.

    Hello Domin,
    Here is another easy way to solve this.
    Open the Calculator in DIAdem (either in VIEW, ANALYSIS or SCRIPT) - it's in the toolbar.
    Type the following line into the calculator:
    Ch("New Test") = -(Ch("[1]/Test")="ok")
    In this line of code, I am creating a new data channel called "New Test," and I am referencing the channel "Test" in group one in the Data Portal. Make sure to subsitute your chanel group and name. Please note that this is also case sensitive, so use "OK" instead of "ok" depending on how this is written in the data channel
    A new data channel will be created that contains "0" (for any line that's not "OK") and "1" (for the lines that contain "OK").
    You can turn this into a Script by adding a call to the calculator:
    Call Calculate("Ch(""New Test"") = -(Ch(""[1]/Test"")=""ok"")",NULL,NULL,"")
    I hope that helps, it doen't really get much easier than that. And this is very fast as well, if you have long channels.
    Let me know if I can be of further assistance,
          Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • 3D Trigonometric Formulae

    Hello, I have written a piece of VB Script that uses Diadem to translate outputs from a configuration of 3 rotary potentiometers to relative x, y and z displacements. The equations are quite complex but the code is running very slowly. At present I calculate Sine and Cosine of each output (12 outputs - 24 new channels) then use formulae within ChnCalculate command to get x, y and z and finally use ChnOffset to get relative x,y and z. Any suggestions as to a way of doing this that would give a more efficient running speed? (It's the formula calculations that seem to be taking the time.) Ta!

    Hi cxw,
    I'm surpised.  The Calculator in DIAdem is usually very fast.  How long are these channels you're analyzing?  Can you post the VBScript that you're using to do all this, or an example data set?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Moving average calculatio​n

    Hello,
    Is there a way to optimaize a moving average calculation?
    This is currently how I'm doing it:
    intEndRange=cint(dblFreq*sngInterval)-1 'get the number of points given the time interval and sample rate
    intStartrange=1
    do
      Call STATBLOCKCALC("Channel",intStartrange & "-" & intStartrange+intEndRange ,intDataChannel) '... STATDIREC,ROWNOSTR,CHNNOSTR
      if abs(statarithmean)>abs(dblMaxValue) then
        dblMaxValue=statarithmean
        dblMaxTime=(chd(intStartrange,intTimeChannel)+chd(​intStartrange+intEndRange,intTimeChannel))/2
      end if
        intStartrange=intStartrange+1
    loop until intStartrange+intEndRange>cl(intDataChannel)
    This works but it is slow for long channels.
    Thanx,
    Bill.

    Hi Punkmonkey,
    My understanding of the THIV calculation is that at time zero the value of ΔX.c (i.e. the integration of vehicular acceleration in ground reference - step 4 in the NCHRP350 document and equation (23) in the EN 1317-1:1998 document) is always set to be zero. In my speadsheet this can be seen in cell J4. Does this answer your question? 
    I don't have a copy of TRAP so I can't comment on that. However, whenever I compare my calculations with Diadem, I also find that the velocity is higher in Diadem - generally by about 0.5km/h.
    I too have wondered whether the integration technique would change the values, but what I can't understand is why I always get the same Time of Flight as the Diadem function. If the problem is the integration, it would affect the displacement even more than the velocity (as this is integrated twice), which would affect the impact time, but this has never been a problem when comparing my calculations with Diadem. Do you get the same Time of Flight with your script or TRAP?
    Message Edited by David Corless on 02-04-2009 03:48 PM

  • ChnEnvelopes gives error "Target Channel is too short for results"

    I have 3 channels (1-3) of data loaded, 1 is time, the other 2 are data channels. I am trying to run ChnEnvelopes from within VBS with this command.
    call ChnEnvelopes(1,2,4,5,6,7,5)
    The size of the original data is 34127.
    If I use the dialog it works fine.

    Hi,
    When you perform calculations in DIAdem, the results will be stored in a channel in the data matrix. When you load a data file, it will occupy a channel for each data channel in the file. If the data channels in the file are longer than the maximum channel length selected in the DIAdem settings, DIAdem will use 'dynamic' channels versus the channels you have configured in the settings menu.
    There are two things you can do:
    1. Go to the 'Window' menu in DIAdem and select 'Close all'.
    2. Then select the 'Settings' menu and choose 'Data management'.
    3. Click the 'Data Matrix' button and set the maximum channel length to something larger then your channel length (i.e. >= 34,127). The default value here is 8,192.
    Another way to do this is to use dyn
    amic channels for the calculation, i.e. use this command:
    call ChnEnvelopes(1,2,,,,,5)
    Altough the result channels are shorter than 34,127, the software will use these channels for some temporary data storage.
    This should hopefully work for you. Let me know if you have any additional problems or questions.
    Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Using variables in a calculation function in Diadem script

    Hey guys,
    I'm new to working with Diadem Scripts.  I have tried the two different ways below to make the values of a channel equal to the results of a formula containing created variables.  I can do it if the formula contains values in place of the variables using the calculator method.  I would appreciate any guidance on how to correct the syntax in the below scripts.
    Option Explicit 'Forces the explicit declaration of all the variables in a script.
    dim a, b, c
    a = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Value
    b = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    c = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    Ch ("[2]/ROP (ft/hr)") = a + b* Ch("[2]/Backhead Pressure (psi)") + c* Ch("[2]/Backhead Pressure (psi)")^2
    Or
    Option Explicit 'Forces the explicit declaration of all the variables in a script.
    dim a, b, c
    a = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Value
    b = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    c = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    call ChnCalculate("Ch(""[2]/ROP (ft/hr)"")="&a+&b"*Ch(""[2]/Backhead Pressure (psi)"")+"&c"*Ch(""[2]/Backhead Pressure (psi)"")^2")

    I think you need to use channel name strings of the format "Group Name/Channel Name" in your ChnCalculate function.  I usually use a formula, a symbol array, and a value array to get this done:
    Dim a, b ,c, sFormula, aSymbols, aValues
    Redim aSymbols(6), aValues(6)
    aSymbols(0) = "a"
    aSymbols(1) = "b"
    aSymbols(2) = "c"
    aSymbols(3) = "A"
    aSymbols(4) = "B"
    aValues(0) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Va
    lue
    aValues(1) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    aValues(2) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    aValues(3) = Data.Root.ChannelGroiups(2).Channels("ROP (ft/hr)").GetReference('ref type')
    aValues(4) = Data.Root.ChannelGroiups(2).Channels("Backhead Pressure (psi)").GetReference('ref type')
    sFormula = "Ch(A) = a + b*Ch(B) + c*(Ch(B))^2"
    Call ChnCalculate(sFormula,aSymbols,aValues)
    CLAD

  • Calculating FFT using the FFTAverageType variable in DIadem

    Hi,
    I have some doubts about how should I use the averagingType variable. I want to define this variable as "Arithmetic" and get the combined FFT of two trials of the same process, i.e I have two signals which represent the same process.
    What I do is just calculate the FFT of each signal separately. Then I calculate the amplitude of each FFT signal and finally i combine these two signals by doing the mean for each amplitude. I.E if i have signal1FFT = (1 , 2 ......23 ) and signal2FFT = (2,4, ...43 ) the resulting signal should be ( 3/2 , 6/2 ...... 66/2 )
    Am I correct about what this averaging type variable does? When i try to do the same in other mathematic programs I get different results but I don't know exactly what I am doing wrong,
    Thank you so much for the help!

    There are several ways to approach averaging in the FFT environment.
    FFTAverageType is should be "Arithmetic" which means that all FFTs are weighted equal.
    The Exponential averaging is kind of a running average for special calculations which are typically done during a running measurement.
    Much more important is the parameter in "Calculate average from:" (Amplitude or Autospectrum)
    Amplitude is giving a linear result and Autospectrum is giving the result based on squared values. The squared result is the correct result from an energetic point of view.
    Example:
    If you have a sine with a peak of 2 for one second and a peak of 4 for another second, you might want to get and averaged peak of 3.This might be wrong.
    The RMS value of a sine with a peak of 3 would be 2.121.
    The RMS which is representing the energy in a signal is the root of the average of the squared values. The RMS of a signal with half the time 2 and half the time 4 is 2.236. This means, that a sine with the peak of 3.162 for two seconds has the same RMS as the signal with a peak of 2 and 4 for one second each.
    If you average FFTs in DIAdem you need to decide between the linear average (based on the peak Amplitude) and the energetic correct squared average (based on the Autospectrum). Right or wrong depends on your circumstances.
    Usually, other mathematic programs are giving you the choice to decide or they might just use one or the other method.

  • Calculating 10 - 90 % Rise Time in Diadem

    Hi Everyone,
    I would like to know how to calculate the 10-90% rise time in diadem of a simple pressure wave.  Is there a particular function?
    Thank you in advance.

    You should post your question in the DIAdem forum.

  • Difference between diadem and LabVIEW Report Generation Toolkit

    I want to expand LabVIEW's reporting capabilities.  Can someone tell me what the difference is between DIAdem and the LabVIEW Report Generation Toolkit for Microsoft Office.

    Hello Mr Bean,
    There are several major differences between the two solutions. I'll try and outline them as good as I can ...
    The biggest different is that LabVIEW and its toolkits are programming tools and DIAdem is a ready to run application.
    The LabVIEW Report Generation Toolkit basically provides an extensive library of VIs that allow you to connect LabVIEW to the MS Office library and create and edit reports in Word and Excel.
    DIAdem is a stand alone application that was designed to post-process data from various sources. The tools included in DIAdem are:
    1. NAVIGATOR: Allows you to import data from files (ASCII, binary, Excel, etc.) as well as DataBases (SQL/ODBC, Citadel, ASAM, etc.). The unique DataPlugin technology available within DIAdem allows you to import vitually and data file by creating a DataPlugin that describes the data format and gets linked to DIAdem. More information at: http://www.ni.com/diadem/dataplugins.htm
    2. VIEW: Graphical and Numerical data inspection tool. Use cursors to zoom and scroll through your data, edit your data graphically and numerically and compare different tests.
    3. ANALYSIS: DIAdem has a wide range of analysis functions, ranging from simple functions like integration and differentiation to FFTs, Order analysis and 3D data analysis.
    4. REPORT: The DIAdem REPORT tool allows you to create reusable report layouts that can contain multiple axis systems (2D, 3D and polar plots) as well as tables (2D and 3D) and variables. The REPORT tool generates templates that can be usedwith multiple data sets due to the inclusion of automatic (or manula if required) scaling as well as extensive use of variables for annotations. Finished reports can be exported to printers, graphics files, the Windows Clipboard, HTML pages and PDF files (PDF writing is build into DIAdem, no extra software required). Using Scripts, it is also possible to create Word, Excel or Powerpoint reports from DIAdem automatically.
    5. SCRIPT: The DIAdem scripting tools allows users to record macros or write scripts that automate complete sequences, for the import of data, via extensive analysis, to creating a publication ready report. Scripts can make reports "intelligent" by modifying the appearance of a report based on the data or calculation results that are going to be displayed in the report.
    I recommend you check out the following link for more information: http://www.ni.com/diadem/
    DIAdem is an extremly powerful tool for report generation. I am leaving to go on a business trip to Asia, but I would be more than happy to give you an Web presentation on DIAdem after I have returned. We could use your data and create a DIAdem report Script together online. My Email address is [email protected] and I will be back the week of Thanksgiving.
          Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

Maybe you are looking for

  • Error generating while adding PO through DI

    Hi All, I got an error while creating Purchase Order through DI API by taking an Excisable Item and non-excisable Whs and non CENVAT TAX The error is  ' There are Excisable Item(s) with non-CENVAT tax code' But if we are creating PO as same through U

  • TestStand API in C#

    Hi, we develop a software in C# which uses the TestStand API. we note that TestStand API allocates memory at the first execution of a TestStand sequence All the memory of this first execution is not deallocate at the end. why ? Is it a problem with A

  • Using CS_BOM_EXPL_MAT_V2 how to find last children of material in the bom.

    Hi, I want to find last children of a material.I am using FM CS_BOM_EXPL_MAT_V2. Although STPOX internal table as STUFE for level but we can't get all the last child of material directly. For example material A as child A1 and A2 this sub divided int

  • Urgent: Assigning Permissions to the P6Reports Folder Error

    Hi, I have installed the primavera6 Release 8.3 in windows 2008. For configuring BIP in p6, some steps available in connecting_bi_publisher_to_P6 documnet. As per the document, while assigning permissions to p6reports folder am getting error. "oracle

  • I need to know the user who has created/modified a SAP Bex Query and WAD

    Hi! I need to know the user who has created and modified a SAP Bex Query and SAP  Web Application Designer. Does it possible to know this information by a table or view? Best Regards Ramon Sanchez