DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading new curves into report via Script

Hello everyone!
I tried the following to add a curve into a report via VBS-Script
 
 
Call GraphObjNew("2D-Axis","MyGraph")
Call GraphObjOpen("MyGraph")      
  D2AXISSYSTEM     ="one system"
  Call GraphObjNew("2D-Curve","MyCurve")
  Call GraphObjOpen("MyCurve")
    D2CCHNXNAME      ="Eigenschaften/Zeit"
    D2CCHNYNAME      ="Eigenschaften/Geschwindigkeit"
  Call GraphObjClose("MyCurve")
Call GraphObjClose("MyGraph") 
Call Picupdate()
The Script runs without errors, but the Curve won't be added into the 2D-Axis Object. Does anyone know how to solve this problem?
0 Kudos
Message 1 of 2
(3,353 Views)

Hi Robert,

Wenn I modify your code ever so slightly to operate on the channels I have in the Data Portal, and then execute the code in DIAdem 10.2, it works perfectly for me:

Call GraphObjNew("2D-Axis","MyGraph")
Call GraphObjOpen("MyGraph")      
  D2AXISSYSTEM     ="one system"
  Call GraphObjNew("2D-Curve","MyCurve")
  Call GraphObjOpen("MyCurve")
    D2CCHNXNAME      ="[1]/[1]"
    D2CCHNYNAME      ="[1]/[2]"
  Call GraphObjClose("MyCurve")
Call GraphObjClose("MyGraph") 
Call Picupdate()

Of course, it creates a tiny little graph in the upper left hand corner of REPORT, which is probably not exactly what you want, but it is what you're asking DIAdem to do for you with the code.  I assume this is not happening for you.  What version of DIAdem are you using?

On another note, I'd actually encourage you not to create the 2D-Axis programmatically, but rather to configure its location and appearance by hand and save a *.TDR file, which you can then load with PicLoad() or PicFileAppend().  If you leave off the first line of your code, the rest of it will then programmatically add curves and configure them as you wish.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 2
(3,336 Views)