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/

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • Split-screen in DIAdem SCRIPT

    When working in DIAdem SCRIPT, it is often necessary to work on more than one file at once. The way this is implemented at the moment is with tabs:
    However, it can be quite tedious to switch back and forth between 2 scripts for things like copy/pasting, comparing code or simply editing code on 2 files concurrently.
    My suggestion would be for a SCRIPT editor with split screen functionality, roughly like this:
    With many users working with widescreens today, this would better make use of screen real-estate.

    Obviously coding without it is a pain.
    Louval

  • Wie Diadem Script im LabView am besten erstellen?

    Guten morgen zusammen,
     ich bearbeite im Moment ein Projekt, in dem Messdaten aus LV in Diadem Report umgewandelt werden, dazu übergebe ich die Messkanäle und ein Script. Das Script habe ich in einen großen String getippt, der Schlüsselworte wie "PFAD1" enthält, die dann mit "String suchen und ersetzen gegen die richtige Werte ausgetauscht werden. Dann wird dies in eine Script Datei gespeicher, die an Diadem übergeben wird.
    Gibt es eine Möglichkeit dies "eleganter" zu lösen?
    Ich fände es praktisch, wenn man Diadem Code so erzeugen könnte, wie mit dem "Formelknoten", dies wäre viel übersichtlicher.
    Gruss
    N.Schnitzler

    Ja das wäre eine Lösung, aber ich kann es den Usern nicht zumuten sich selber mit Diadem-Script zu beschäftigen, die Möglichkeit mit den String Konstanten habe ich als erstes getestet, dies wird aber viel zu unübersichtlich.
    Meine jetzige Lösung sieht so wie im Anhang aus. 
    Ein VB-Script/Diadem-Script - Knoten wäre eine sinnvolle Ergänzung, da man ja den Export eines Scriptes an Diadem anbietet, sollte man auch die programmatische "Konstruktion" des Scriptes ermöglichen.
    Gruss
    N.Schnitzler
    PS. Dies ist nur ein kleines Script als Beispiel
    Message Edited by N.Schnitzler on 01-16-2009 04:46 AM
    Attachments:
    Script.JPG ‏163 KB

  • Frage zu Kanalbenennung in DIAdem-Script

    Ich habe mir im DIAdem-Script folgende Kanalbenennung erstellt:
    Data.Root.ChannelGroups("Statistik_pcs_Q3").Channels("ArithmeticMean").Name = "ArithmeticMean_alle40"
    Zu dieser Benennung hätte ich jetzt gern noch automatisch den Dateinamen hintendran gehangen.Wie kann ich das lösen?

    Hallo SAFU,
    Wenn Sie diesen Dateiname schon in einer VBScript Variable zu Verfuegung haben ( sagen wir "DateiName" ), dann koennen Sie den neuen Kanalname auf dieser Weise zusammenstellen:
    KanalName = "ArithmeticMean_all340" & " - " & DateiName
    Wenn Sie aber den Dateiname dynamisch ablesen moechten, Koennen Sie das durch die Kanaleigenschaften "SourceDataFilePath" und SourceDataFileName" oder durch die globalen Variablen "DataFile" oder "DataFileName" realisieren.
    Gruss,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • 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

  • Creating executable or installer of diadem script

    Hi,
    Is there any way to create executable or installer of script of diadem. Which we can run on different machines without installing diadem. I mean the distribution kit creation for diadem script.
    Thnks
    HS

    Hello Lesterino,
    As I wrote in my previous reply, DIAdem is not a programming language and you thus require a license of DIAdem (at least DIAdem Base) to run Scripts, use layouts and create PDF files.
    This is no different than - for instance - Microsoft Excel. If you want to create graphs in Excel and export these, you have to own a license of Microsoft Excel as well.
    Is there anything in the DIAdem materials (our Website or the DIAdem documentation itself) that made you believe that DIAdem could be distributed for free? If so, I would like to know where that information is located so that I can have that clarified to avoid future confusion.
    Let me know if there is anything else we can help you with,
        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."

  • Save settings for rainflow-analysis at DIAdem-Script

    I wrote a script with DIAdem-Script. This script does a rainflow-analysis from a signal.
    My problem is that I need 64 steps but the standard setting is 8 steps.
    I program the rainflow-analysis with 64steps in DIAdem-Script and the script does is till I shut down DIAdem.
    If I restart DIAdem and load the script with the 64step-rainflow-analysis, it makes only 8steps (the standard setting at my Diadem).
    Now I want to know what I can do to solve these problem.
    I want to have a script that makes a rainflow-analysis with 64steps at any time.

    Hi Christian,
    We should be able to get this to work as you desire it.  These are the variables behind the class number dialog in the Rainflow calculation:
    CLASSMETH2      = "Automatic"
    CLASSNO         = 10
    CLASSWIDTH      = 0.0389656847322041
    CLASSBEGIN      = 0.50634440282565
    CLASSRANGEWIDTH = 0.389656847322041
    CLASSEND        = 0.896001250147692
    What combination of these variables are you using and which values are you assigning them?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Diadem Script von 9.0 nach 2012

    Hallo DIAdem-Gemeinde,
    ich befinde mich leider in der glücklichen Position, ein altes DIAdem Script, welches unter Diadem9.0 geschrieben wurde, in Diadem2012 anzupassen.
    Im Moment macht mir folgendes Problem Sorgen:
    Vor jeder Berechnung werden die aktuellen Kanalnamen in ein array gespeichert mit name(i)= ChnName(i). Wenn ich das mit allen 501 Kanälen machen möchte, geht das ganze nur bis i = 450. Gibt es eine max. Begrenzung der Einträge eines arrays in DIAdem bzw. vbs?
    Wenn ich nun versuche das ganze anders sinnvoll zu lösen, verstricke ich mich nur in mehr Fehler... Das ganze wir dazu gemacht, um nach der jeweiligen Berechnungsroutine die Kanalnamen wieder zurück zu kopieren. Sonst steht da nur noch Copy1 bis... und MatScalMul1 bis....
    Gibt es dafür eine sinnvolle Alternative? Und wie greife ich generell auf Kanäle zu? Wenn ich mit den alten Befehlen wie ChnName(i) z.b. darauf zugreife, benutzt DIAdem dann den Index oder die Kanalnummer?
    Vielen vielen Dank schonmal im Voraus,
    ich hoffe ich finde eine geeignete Lösung, langsam geht mir die Puste aus
    Grüße

    Hallo ihr beiden,
    also vielleicht kann ich ein wenig mehr über das Skript erzählen. Weil es an die 5500 Zeilen hat und ich nicht weiß ob ich es der "Öffentlichkeit" zugänglich machen darf, mal ein paar Erklärungen. Im Prinzip besteht das Skript aus einzelnen Subroutinen, die die gewonnenen Messdaten erst einlesen und dann sukzessive weiter verarbeiten (Nullpunktverschiebung, Umrechnung in physikalische Einheiten, andere Berechnungen mit Hilfe einer DLL und darin befindlichen c++ Routinen).
    Da das vbs Skript unter Diadem 9 von (leider wenig begabten) Programmierern erschaffen wurde, gibt es bei meiner "Implementierung" in Diadem 2012 einige Probleme.
    Mit das größte Problem ist jedoch, dass die Übergabeparameter für die dll bzw. die c++ Routinen in die Kanäle 470-500 geschrieben werden. Die dll(gpiexl) ist so (schlecht) programmiert, dass sie sich aus Diadem die Werte (Kanäle 470-500) nimmt und die Ergebnisse der Berechnung wiederrum in Kanäle zwischen 470 und 500 schreibt. Nun konnte man im alten Diadem ohne dynamische Kanalverwaltung noch auf Kanäle mit beliebig großem Index zugreifen, diese wurden direkt erstellt. Im neuen Diadem kann man leider keinen Kanal 400 erstellen wenn die bisherigen Kanäle nur bis z.B. 45 gehen. Daher habe ich zuerst 500 Kanäle mit jeweils 32768 1sen erstellen lassen in die dann die Werte eingelesen werden (zumindest erstmal in die ersten 58).
    Im alten Skript wird vor jeder Operation der Name und der Typ des Kanals folgendermaßen gespeichert:
    for i=1 to GlobUsedChn
    name(i)= ChnName(i)
    sondentyp(i) = CC(i)
    next
    und nachher wieder andersherum zurück gelesen.
    Alle Operationen wie Messwerte verkürzen, einzelne Abschnitte ausschneiden wurden bis jetzt auch immer für jeden Kanal ausgeführt. Nun habe ich das Skript soweit angepasst, dass es vor jeder Berechnung die Kanalnamen wie oben angegeben speichert und nachher zurück liest. Problematisch wird dies jedoch in den Subroutinen wo eine Zwischengruppe erstellt wird, in der die Werte der Berechnung abgelegt werden. Im alten Diadem 9.0 konnte man auf die jeweiligen Kanäle im aktiven Datenset noch mit (i) zugreifen, im neuen muss ich das auch irgendwie ändern. Daher war meine Frage ob ich bei einer Operation wie 
    call matscaladd(i,mittelwert,1)
      den Namen des Kanals erhalten kann und damit nicht vorher alle Namen einlesen und nachher wieder überschreiben muss? Denn kommen neue Kanäle durch kopieren etc. hinzu, verzettelt man sich schnell und es gibt Chaos...
    Noch eine Frage: Ich habe Diadem 9.0 neu installiert und plötzlich gibt es bei dem Befehl:
    call chncopy (cno("A"),C_Zwischenspeicher1)
     die Fehlermeldung dass auf den Kanal C_Zwischenspeicher1 nicht zugegriffen werden kann. C_Zwischenspeicher 1 = 493 wird aber vorher zugewiesen und funktioniert auch einwandfrei unter anderem in anderen Diadem 9.0 Installationen. Es existieren nur Kanäle bis ca. Index = 63. Sollte aber in den alten Diadem Versionen kein Problem sein. Gibt es vielleicht eine kleine versteckte Option der dynamischen Kanalverwaltung in Diadem 9.0 die ich bei der Neuinstallation übersehen hab?
    Noch eine letzte Frage zum Schluss: 
    Sollte ich mir jetzt lieber angewöhnen das Skript konsequent in die Objekt-orientierte Zugriffsweise umzuschreiben oder lieber bei den alten Codes bleiben?
    Vielen Dank schon im Voraus für eure Hilfe!!!
    P.S.: Raphael: Ich hatte wohl übersehen, dass ich bei den arrays nur dim name(501) initialisiert hatte aber sondentyp() übersehen hatte -.- Nachts um halb zwei darf das dann auch schonmal passieren... 

  • Working with DIAdem REPORT in DIAdem SCRIPT

    Hello,
    I am working with DIAdem 9.1 Advanced. I would like to create a report with a 2D graph object containing one curve (X,Y1) or (X,Y2). The user has to choose between (X,Y1) and (X,Y2) via a dialog box. I want to generate this report with a VBS script without loading a predefined TDR report.
    I tried the following sample code:
    '1. Load "Example.CSV" from the DIAdem DEMO folder
    '2. Load a new blank report
    Call GraphObjNew("2D-Axis","MyGraph") 'Creates a new 2D-graph object called -MyGraph- in the report
    Call GraphObjOpen("MyGraph")      
      D2AXISSYSTEM     ="one system"
    ' The user selects which channels he wants to plot via a dialog box
    ' If the channel "Sine" is selected, we need to create a new curve on the 2D-graph
    ' Do I need to create a new object for the curve? Which type of object ?
      Call GRAPHObjOpen("2DObj1_Curve1") ' ERROR -Object 2DObj1_Curve1 unknown or not open-
        D2CCHNX          ="[1]/Time"
        D2CCHNY          ="[1]/Sine"
      Call GRAPHObjClose("2DObj1_Curve1")
    Call GraphObjClose("MyGraph") 
    Call PicUpdate
    Is it possible in DIAdem to create dynamically a 2D-graph when we do not know before which channels will be plot?
    Thanks in advance for your answer.
    Matthieu G.
    Eurilogic, France

    Hello Matthieu
    Variable: ObjType
    The terms 2D-curve and 3D-curve are valid keywords for new 2D-curves and 3D-curves and the enumeration terms of the ReportObjType variable for all other objects.
    I attached some topic of the DIAdem 10 help that descibe some variables that correspond to this topic.
    The following script create a 2d-Axis system an a new curve and defines the data for this curve
    Call GraphObjNew("2D-Axis","MyGraph") 'Creates a new 2D-graph object called -MyGraph- in the report
    Call GraphObjOpen("MyGraph")      
      D2AXISSYSTEM     ="one system"
      Call GraphObjNew("2D-curve","MyCurve") 'Creates a new 2D-Curve object called -MyCurve- in the report
      Call GraphObjOpen("MyCurve")
        D2CCHNXNAME      ="[1]/Time"
        D2CCHNYNAME      ="[1]/Sine"
      Call GraphObjClose("MyCurve")
    Call GraphObjClose("MyGraph") 
    Call Picupdate()
    Hope this helps
    Winfried
    Message Edited by winner on 02-27-2006 11:54 AM
    Attachments:
    report.zip ‏18 KB

Maybe you are looking for