ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a 2d Table programatically

Ok I figured this out.

DIAdem apparently wants things to be written in some very precise order, and the following order changed my world :

 

  D2TabHeaderTxt(1, 1) = "Title"                    'Title of the first column.
  D2TabTxtType(1)  = "column defined headline"
  D2TabDataType(1)="Expression" 
  D2TabVariable(1)="@@Tblcol1(d2tabrow)@@"       'First column of Table is now Tblcol1
  
  D2TabHeaderTxt(2, 1)= "Other Title"              'Title of the second column.
  D2TabTxtType(2)  = "column defined headline"
  D2TabDataType(2)="Expression" 
  D2TabVariable(2)="@@Tblcol2(d2tabrow)@@"       'Second column of Table is now Tblcol2

 Before this, I used to mix commands affecting the first column and commands affecting the second one, which ended up badly. Thanks to both of you for your help, I finally made it 🙂

0 Kudos
Message 11 of 18
(2,305 Views)

Hi Near3

 

First to the CTRL-A trick, You have to open the dialog box then press CTRL-A. DIAdem records the code that correspond to the dialog box, so in in curve dialog box you will differnt code than in the axis definition dialog box.

 

Could you make a short outline (as grafic) how you table should look like and describe how your data looks like or paste them here (*.tdm and  *.tdx) so I could understand in more detail what you want.

 

Winfried

0 Kudos
Message 12 of 18
(2,298 Views)

Hi Near3,

 

If you don't have the Script Recorder already turned on, then you also need to switch to DIAdem-SCRIPT, click in a new VBScript area, and hit <Ctrl-V> to paste the variable assignments saved to the Windows Clipboard to the new VBScript.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 13 of 18
(2,288 Views)

That's ok my problem is solved since my last post !

0 Kudos
Message 14 of 18
(2,287 Views)

Hi,

 

I am using DIAdem 2012 and want to create 2d Table programatically. How can I achive that. I mena is there any simple solution apart from this?

 

 

Regards

Sarry

0 Kudos
Message 15 of 18
(2,109 Views)

Hi Sarry,

 

You can use the Report object in a DIAdem VBScript to create and configure a new table object on a REPORT sheet.  Personally, I don't think that's the easiest way to go, but there's nothing stopping you.

 

Set Sheet = Report.ActiveSheet
Set Table = Sheet.Objects.Add(eReportObject2DTable, "NewTableName")
Set Column = Table.Columns.Add(e2DTableColumnChannel)
Column.Channel.Reference = "Example/Time"
Report.Refresh

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 16 of 18
(2,085 Views)

Thank you!!!

0 Kudos
Message 17 of 18
(2,069 Views)

Hi Brad,

How can I access to each cell in that 2D table by script?

Thanks,

GQ

 

0 Kudos
Message 18 of 18
(1,478 Views)