Is there a Diadem script or command to determine the maximum lag of cross correlated data?

I am analyzing multiple data sets and ultimately need to plot and align 3 similar curves based on the the maximum cross correlation lag.  Is there a function that will do this in Diadem or has anyone written a script to do so?  I am new to Diadem and am still learning how to do this.  I know I can do it in Matlab...the generic coding is
%calculate cross-correlation
c = xcorr(a,b - mean(b),'coeff');
% return maximum value and its index
[d,f] = max(c);
timelag = (length(a) - f) * timestep;
I would really like to figure out how to do this in Diadem as it seems like it will be easier based on the amount of data I am going to have to analyze.  Any thoughts would be greatly appreciated.  I have found and was looking at the cross correlation function in the signal analysis toolbar but I do not see where lag is calculated.
thanks!

Hi jgabe,
Here is an example VBScript that uses cross-correlation to time shift all equivalently named channels across the various groups in the Data Portal.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Attachments:
Linearize Data.zip ‏43 KB

Similar Messages

  • Is there a DIAdem Script command that can automatically create folders/directories in Windows?

    Hi there!
    I need to automatically create folders/directories in the Windows file system? Is there a DIAdem Script command to do this (like the way you do it in DOS/Unix or even Matlab (mkdir command)? Thanks!

    Hi,
    there are two ways to create folders within a DIAdem script:
    Call FolderCreate("d:\New Folder")
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    Call fso.CreateFolder("d:\New Folder 2")
    Christian

  • I bought a second 4s, when i try to make new ID, there is a message comes:cannot sign in the maximum number of free accounts have been activated on this iPhone, is there any way to solve this problem?

    i bought a second 4s, when i try to make new ID, there is a message comes:cannot sign in the maximum number of free accounts have been activated on this iPhone, is there any way to solve this problem?

    Sure. You can do it on a Mac at the following website: https://appleid.apple.com/account

  • Is there a way of not displaying entries in the Blog based on today's date

    Hi,
    I'm using the Blog layout in iWeb for a calendar.
    Somewhere in this discussion forum, I found how to sort the entries by increasing date (many thanks for that).
    The question I have: Is there a way of not displaying entries in the Blog overview of which the date is in the past ?
    Thanks

    Hi Cyclosaurus,
    the link you refer to (http://test.cyclosaurus.com/Site/Blog/Blog.html) seems to be broken. I can't see the script.
    Can you sent me a script to automatically hide events from the past (based on today's system date) ?
    please note that I use following script to reverse the summary (which i found in the discussion forum):
    <script type='text/javascript'>
    function reverseSummary() {
    blogSummaryWidget = parent.document.getElementsByClassName('com-apple-iweb-widget-blogSummary flowDefining')[0].widget;
    blogEntries = blogSummaryWidget.blogFeed.itemCount();
    blogSummaryWidgetID = blogSummaryWidget.instanceID;
    blogSummaryContentDiv = parent.document.getElementById(blogSummaryWidgetID + '-summary-content');
    if (blogSummaryContentDiv.childNodes.length > 0) {
    for (be=1; be<blogEntries; ++be) {
    bi = (blogEntries - 1) - be;
    blogSeparator = parent.document.getElementById(blogSummaryWidgetID + ('-separator-template$' + bi));
    blogSummaryContentDiv.appendChild(blogSeparator);
    blogEntry = parent.document.getElementById(blogSummaryWidgetID + ('-item$' + bi));
    blogSummaryContentDiv.appendChild(blogEntry);
    clearInterval(chkSummary);
    chkSummary = setInterval('reverseSummary()', 1000);
    </script>

  • What sort of error handling is ther in Diadem SCRIPT?

    I know and am using:
    On Error Resume Next
    On Error GoTo 0
    However, I want to be able to go to the bottom of my script and finish some items and end the script as if everything executed properly. 
    I was hoping to do something along the lines of a try...catch block, but appearantly there is not anything like that inside VB.
    Thanks!

    Hi
    There is an Err object to get or clear the last error. Search for "Err Object" in the help:
    On Error Resume Next
    Err.Raise 6   ' Raise an overflow error.
    MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
    Err.Clear      ' Clear the error.
    On other solution are some special Events: Try this small script. There is an spelling error in the second line but the Event_terminate event is executed properly.
    Set SystemEvents = New SystemEventClass
    Msgbx "hallo"
    Class SystemEventClass
      Private Sub Class_Initialize   ' Initialize Event
        Call MsgBoxDisp("Initialize")
      End Sub
      Private Sub Class_Terminate   ' Terminate Event
         Call MsgBoxDisp("Terminate")
      End Sub
    End Class
    Hope this helps
    Winfried

  • Is there a short cut key/command to repeat the last action?

    In excel Alt F4 (I think) repeats your last action.  I can't find a similar command or short cut key in numbers.  Can anyone help me?

    Kappy wrote:
    Isn't it supposed to be a clone of Excel within limits?  I don't use iWork.
    Who said/wrote that ?
    Numbers is not a clone of Excel. I doesn't share the Microsoft philosophy which include every asked feature.
    Apple engineers carefully select what may be added and what must remain as dreams/wishes.
    Basically, they apply the good old rule :
    ++-+-+-+-+-+-+-+-++
    Apple Human Interface Guidelines:
    Apply the 80 Percent Solution
    During the design process, if you discover problems with your product design, you might consider applying the 80 percent solution‚ that is, designing your software to meet the needs of at least 80 percent of your users. This type of design typically favors simpler, more elegant approaches to problems.
    If you try to design for the 20 percent of your target audience who are power users, your design may not be usable by the other 80 percent of users. Even though that smaller group of power users is likely to have good ideas for features, the majority of your user base may not think in the same way. Involving a broad range of users in your design process can help you find the 80 percent solution.
    +-+-+-+-+-+-+-+-+
    At this time they offer around 250 functions when Excel have about 500.
    Tables are limited to 256 * 65635 cells
    Numbers is slooooooooooooooooooooooooowwwwwwwwwwwwwww
    Excel offer some database features, Numbers doesn't
    In Excel, macros are back, they never arrived in Numbers.
    Yvan KOENIG (VALLAURIS, France) samedi 30 avril 2011 22:58:32
    Please :
    Search for questions similar to your own before submitting them to the community

  • 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

  • When looking for a document, there used to be a "Today" tab on the left side of the Finder window. After updating my computer with the most recent update (I think it was Mountain Lion, but I could be wrong...), the "Today" tab seems to have disappeared.

    I really prefer using the "Today" tab instead of the "All My Files" tab, because it loads much faster and only shows me the documents that I want to see. Is there any possible way to get the "Today" tab back?

    In Finder, go command - F. On the top left set "Kind" to Date Created, finish selecting the criteria and hot "Save" on the top right. You'll get a new smart folder with an option to add it to the sidebar.

  • Is there a breeze export option that defines the maximum opening resolution of the browser ?

    Hi,
    The maximum resolution of a breeze presentation slide is 720
    x 540 correct?
    Does anyone know if there is a way to prevent that a breeze
    presentation gets too big when it is opened in a big resolution
    screen?
    What I’m asking is if there is a breeze export option
    that defines the maximum opening resolution of the browser that
    contains the breeze presentation, preventing the images and flash
    animations to loose too much resolution…
    When I play my presentations from the breeze server, it
    doesn’t load in the web browser but in a window that not fit
    the entire computer screen, what is good to the definition of the
    presentation…It is possible to do this locally??
    (I may be wrong, but in the breeze server is it opening the
    swf file directly?)
    I sure can, after exporting, place the swf file of the
    presentation, manually, in an html file (instead of using the
    index.html that is created in the publishing) this way it will
    never get bigger when opening it in the browser, but if I do this
    it will affect the SCORM or anything else??
    What do you suggest?

    Set the Integer pref browser.sessionstore.max_resumed_crashes to 0 on the about:config page to get the about:sessionrestore page immediately with the first restart after a crash has occurred or the Task Manager was used to close Firefox.
    * http://kb.mozillazine.org/browser.sessionstore.max_resumed_crashes
    That will allow you to deselect the tab(s) that you do not want to reopen, but will allow to reopen other tabs.
    See:
    * http://kb.mozillazine.org/Session_Restore#Restoring_a_session_after_a_crash
    * http://kb.mozillazine.org/Browser.sessionstore.max_resumed_crashes

  • Is there any changes in the DIAdem script between DIAdem 9.x and DIAdem 10.x ?

    Hello,
    I have got a question about DIAdem Script.
    I saw the compatibility problem described in KB.
    'Why do my DIAdem 9.1 Scripts not work in DIAdem 10?'
    Many problems were solved, but some case were not.
    So I guess there is some changes in the DIAdem script between DIAdem 9.x and DIAdem 10.x
    Thanks for your help.

    Hi supportko...
    Yes, there were a lot of new features introduced in DIAdem 10.0, and 10.1.  These are described in detail in each product's ReadMe file, and also in the Online Help under  the "Index" tab at the node "DIAdem>>New Features>>New Commands and Variables"-- you will see 2 sections there:  "Version 10.1", and "Version 10.0", showing you exactly what has changed.  In most cases there is a compatability switch whenever a new feature creates a compatability issue for scripts developed in a previous DIAdem version.  R&D works very hard to minimize the impact of new features on existing VBScript applications.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Message Edited by Support on 05-02-2007 03:56 PM

  • How to execute a "real" VBS command in DIAdem script?

    Hello,
    I've some troubles to execute specific "real" VBS command lines in DIAdem script: 
    e.g.: 
    Workbooks.OpenText filname, DataType:=xlDelimited, tab:=True, DecimalSeparator:=",", ThousandsSeparator:="."  
    Using other writings as
    Workbooks.OpenText(filname, DataType:=xlDelimited, tab:=True, DecimalSeparator:=",", ThousandsSeparator:=".")Workbooks.OpenText filname, "DataType:=xlDelimited", "tab:=True", "DecimalSeparator:=','", "ThousandsSeparator:='.'"  
    don't help, I always get error messages. It seams, that DIAdem has problems with recognition of  := .
    How can I include such kind of VBS command line in a DIAdem script without getting problems?
    Sven

    Hi,
    thanks for answer, but unfortunately its not over yet.
    I tryed the following possibilities:
    Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,xlDelimited,,,True,,,,,,,,".",",",,True)Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,xlDelimited,,,1,,,,,,,,".",",",,1) Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,"xlDelimited",,,True,,,,,,,,".",",",,True)  Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,"xlDelimited",,,1,,,,,,,,".",",",,1)  Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,1,,,True,,,,,,,,".",",",,True)Set create_tabfile = Excel.Workbooks.OpenText(Filename,,,1,,,1,,,,,,,,".",",",,1)but always I get some error messages. I assume, that there is just a format error in the command line, may you help me out with some hints, how to do it right?
    Regards
    Sven

  • Difference between Word basic and DIADEM script

    I'm trying to program some things in Word via a DIAdem script. One thing I want to do is move to the end of the document. When I turn on the macro editor in Word and press End to move to the end of the document, the Word basic editor comes up with this
    Selection.EndKey Unit:=wdStory
    If I enter the above in my DIAdem script (adding Word. in front of it) DIAdem of course doesn't like the "Unit:=wdStory" part. When I execute
    Word.Selection.EndKey
    it only goes to the end of the line.
    There are some other commands I want to do that also have qualifiers like this. How do you tell DIAdem script about the qualifier?
    George

    George,
    Word (and Excel, Powerpoint) come with a large number of constants like the one you used. When you want to use more of them, I recommend to include the type library which comes with those products. DIAdem makes this very easy : Go to the menu in SCRIPT : "Script"=>"type library overview". From the dialog you select the product your are interested in e.g. "Microsoft Word 11.0 Object Library".
    Then click the button "Clipboard". This generates a little code snipped. Goto to your script and insert from clipboard (ctrl+v). What you will see is something like this :
    ' Microsoft Word 11.0 Object Library
    ' D:\Programme\Microsoft Office\OFFICE11\MSWORD.OLB
    Call AutEdTypeLibAdd("00020905-0000-0000-C000-000000000046", "8.3")
    If you now add a line like "MsgBox("wdStory : "&wdStory)" you will teh result you expecct.
    Andreas

  • Controlling dialog boxes in a DIAdem script from LabVIEW

    I have a DIAdem script that prompts the user for the data file it will process. The datafile was created from a labview test routine.   I can now run the script from LabVIEW using the "DIAdem Run Script.VI", but in the interest of automation, I would like to have LabVIEW place the filename in this dialog.  I would like to keep the dialog in the script, since sometimes we run this script manually. (without LabVIEW)
    Bill W.

    Bill,
    Which dialog are you using to prompt for the file name?  It
    appears that you cannot send any information to the script through the
    Run Script.vi.  However, you can call automation commands using
    the "DIAdem Run Automation Command.vi".  If you want to pass data
    to the script, then you can set a Global Variable, or a DIAdem Script
    Variable.  As an example, you could use the global variable, T1,
    and send "T1 := 'myfile'".  When the script is executed, that
    variable will be accessible within the script and it will be set to
    "myfile".  You could also set the FileDlgName variable to your
    file name.  Then it may be possible to send those variables to
    your dialog so that they are automatically populated.
    Good Luck!
    Tyler Tigue
    NI

  • Turn off screen updating while a DIAdem script is executing.

    Hello,
    Does anyone know what line or lines I would add to a DIAdem script to prevent the screen from updating as the script runs?  I have tried UIAutoRefreshSet and the similar commands I found in the help file, but my screen still flickers and flashes while the code is running.  Can someone please help me?
    I am changing marker styles (removing and adding markers to all curves in a VIEW sheet) using DIAdem 11, if that helps.
    Thanks for the help.

    Hi Internati...
    Well, the other thing I would try is to use the View object property:
    View.AutoRefresh = FALSE
       (your code here)
    View.AutoRefresh = TRUE
    But you might also want to check and make sure that you don't have any VIEW events registered:
    View.Events.OnActiveSheetChanged = ""
    View.Events.OnCursorChanged = ""
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • DIAdem script

    Hi Forum,
    I am encountering a simple problem with DIAdem script: when automatically creating a report, I am not able to change the orientation of my report by script. Code is as follows:
    Call ReportMasterLoad("D:\Projects\bdrimmel\iTest\UniPlot\DIAdem\\DIAdem_DRef_Master.TDRM")
    Call PicDelete() ' DIAdem Graph löschen
    Call ReportMasterAdd("D:\Projects\bdrimmel\iTest\UniPlot\DIAdem\\DIAdem_DRef_Master.TDRM")
    Call GraphSheetNew("Pussnelda" & intSheetNo)
    PicPageOrient = "portrait"
    Call PicUpdate
    Changing PicPageOrient would not affect my report layout at all. Is something missing there?
    Solved!
    Go to Solution.

    I know -  this is not directly connected to this problem- but maybe it is of interest for some users:
    http://zone.ni.com/reference/en-XX/help/370859H-01/cmdvarlist/cmdvarlist/varlist_report/

Maybe you are looking for

  • "New Augmented User Recoreds" in WGM not working

    So I was excited with the release of 10.5.3 that importing users to add an iCal server was added to Workgroup Manager, since I have a 10.5 server (that was supposed to be) for iCal among other things, and a 10.4 server hosting files and running as a

  • How to "force" user to enter a valid value in a TextBox

    How can one create a TextBox in which the user is not able to leave (commit the value, change focus, or perform the action of another control) unless a valid value (the value to be committed) is displayed? The following is the best I've come up with

  • Current User & Key Date in Web Reports

    Hi, I want to default the current user name & current date (could be different from the varaible key date) in the header or footer of the web report. I tried text elements in the web template where we can default only the variable values entered by t

  • How to run insert/update/delete from CDC Change table to target using OWB

    I am planning to set up CDC and publish CDC change table as source data into to OWB. I have come across where I am confused how to apply changes from CDC change table to target database using OWB. For i.e. change tables is containing information like

  • After Effects and the new Mac Pro

    I recently got one of the new Mac Pros and it doesn't get along great with After Effects, particularly when it comes to ray-tracing.  There is no Nvidia GPU option for the new machines, so ray-tracing defaults to CPU.  But then, even with a simple so