12-01-2020 12:03 PM
Hello everyone,
I am computer science student and I recently started learning DIADEM. After getting to know this software i have to do some programming and automation related work using scripts.
Can someone please provide me useful link to get started with programming in DIADEM? I have previous programming experience in JAVA so i just need a get start programming tutorial that would help me understand how programming works in DIADEM.
Thanks in advance,.
12-02-2020 04:19 PM
Hi umairmajeed94,
The regular VBScript commands that are part of the standard VBScript host from Microsoft are outlined completely in 2 pages of the DIAdem Help system:
"Help >> Contents >> Programming Reference >> General Information on Scripts >> VBScript Language Directory"
The VBScript host embedded with DIAdem has been expanded by thousands of variables and hundreds of commands and objects that are specific to DIAdem. There are a lot of different things you can automate in DIAdem, and it would really help to have some idea of what you're up to.
Have you tried using the Script Recorder feature in the SCRIPT panel, which works a bit like the Macro Recorder in Excel? That way you can record the VBScript commands behind many of your mouse actions in DIAdem. It's easier to edit an existing script than to start from scratch.
Brad Turpin
Principal Technical Support Engineer
National Instruments
12-08-2020 05:54 AM
Hello,
Thank you for guidance.
I have recorded an interation in DIADEM. It basically import 2 TDM file and selection 2 channels from each file and display it in 2D axis system. Then it exports the view in Report and save the report file in my dekstop.
But upon running the script i am getting following error. I attached the screenshot of error. I would really appreciate some help on this.
Here is the script code:
'-------------------------------------------------------------------------------
'-- VBS script file
'-- Created on 12/08/2020 12:35:09
'-- Author: abc
'-- Comment: abc
'-------------------------------------------------------------------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim MyFolders()
Call InitMyFolders
'-------------------------------------------------------------------------------
Sub InitMyFolders
ReDim MyFolders(2)
MyFolders(0)="\\brose.net\global\GT\TG2\050_TG2_VA\05_General\80_Schulungen\Diadem\Schulung_1_Basics\02_Meßdaten\UIT\"
MyFolders(1)="C:\Brose\majeeum\UserDir\Desktop\"
End Sub
'-------------------------------------------------------------------------------
Call DataFileLoad(MyFolders(0)&"Z00001_RT_5V9_6V9_00%.TDM","TDM","Load")
Call DataFileLoad(MyFolders(0)&"Z08001_RT_6V5_6V6_00%.TDM","TDM","Load")
View.Sheets("Sheet 1").Areas("Area : 1").DisplayObjType = "CurveChart2D"
' Call WndShow("VIEW")
Call ScriptStart("C:\PROGRAM FILES (X86)\NATIONAL INSTRUMENTS\DIADEM 2015\Resource\VwLayTrans","VWTransViewRep",0)
Call Report.SaveLayout(MyFolders(1)&"EXAMPLE.TDR")