DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

one axis system

 

Option Explicit  'Forces the explicit declaration of all the variables in a script.
Dim MyFolders()
Call InitMyFolders
'-------------------------------------------------------------------------------
Sub InitMyFolders
  ReDim MyFolders(1)
  MyFolders(0)="C:\TEST DATA\dat files\"
End Sub
'-------------------------------------------------------------------------------
Call Data.Root.Clear()
Call DataFileLoad(MyFolders(0)&"C100227-6.DAT","DAT","Load") '... DataFilename,FileImportFilter,ImportAction 
Call DataFileLoad(MyFolders(0)&"C100227-7.DAT","DAT","Load") '... DataFilename,FileImportFilter,ImportAction 
 
Call PicLoad("Template") 
 
 Call GraphObjNew("2D-Axis", "2DAxis1")
  Call GraphObjOpen("2DAxis1")
  
  
  Call GraphObjNew("2D-Curve", "2DAxis1_Curve1")
  Call GraphObjOpen("2DAxis1_Curve1")
    D2CChnXName      = "C100227-6/000000000000TI00"
    D2CChnYName      = "C100227-6/000000000000AC0D"
    'D2CChnYName      = "C100227-7/000000000000AC0D"
  Call GraphObjClose("2DAxis1_Curve1")
  
  
  '------------------- Curve list -------------------------------
  Call GraphObjNew("2D-Curve", "2DAxis1_Curve2")
  Call GraphObjOpen("2DAxis1_Curve2")
    D2CChnXName      ="C100227-7/000000000000TI00"
    D2CChnYName      = "C100227-7/000000000000AC0D"
Call GraphObjClose("2DAxis1_Curve2")
Call GraphObjClose("2DAxis1")
Call PicUpdate(0)   

 

 

When i run this code, It displays n- axis in report . i want it to be plotted on one axis. How do i do that??

 

If i double click on report, go to axis position and select one system and OK, It displays as i require. How do i automate it.??

0 Kudos
Message 1 of 4
(4,288 Views)

Hello Rash.patel,

 

If I run this code:

 

call PicDelete
PicDefByIdent    = 1
Call GraphObjNew("2D-Axis", "2DAxis1")
Call GraphObjOpen("2DAxis1")
  D2AxisSystem  = "one system"

  Call GraphObjNew("2D-Curve", "2DAxis1_Curve1")
  Call GraphObjOpen("2DAxis1_Curve1")
    D2CChnXName      = ""
    D2CChnYName      = "Temperatur_1"
  Call GraphObjClose("2DAxis1_Curve1")

  Call GraphObjNew("2D-Curve", "2DAxis1_Curve2")
  Call GraphObjOpen("2DAxis1_Curve2")
    D2CChnXName      = ""
    D2CChnYName      = "Temperatur_2"
  Call GraphObjClose("2DAxis1_Curve2")
Call GraphObjClose("2DAxis1")
Call PicUpdate(0)   

 it works fine on my DIAdem. The variable you are looking for is D2AxsSystem. You find those information by opening the dialog where to modify the parameter and opening the online help.

 

Greetings

Walter

 

 

 

 

0 Kudos
Message 2 of 4
(4,285 Views)

Hi Walter, Thanks for your help. Now i can see the graph in one axis system. 

 

 

Option Explicit  
Dim MyFolders()
Call InitMyFolders
'-------------------------------------------------------------------------------
Sub InitMyFolders
  ReDim MyFolders(1)
  MyFolders(0)="C:\TEST DATA\dat files\"
End Sub
'-------------------------------------------------------------------------------
Call Data.Root.Clear()
Dim iCount
Call MsgBoxDisp("Please control Select MULTIPLE Data Files")
call FileDlgShow(DataReadPath, "DAT files (*.dat),*.dat", "Select File to Process...", true)
For iCount = 0 To Ubound(FileDlgNameList)
      Call DataFileLoad(FileDlgNameList(iCount))
Next
Call PicLoad("Template") 
 '------------------- Curve list -------------------------------
'call PicDelete
 PicDefByIdent    = 1
 Call GraphObjNew("2D-Axis", "2DAxis1")
 Call GraphObjOpen("2DAxis1")
  D2AxisSystem  = "one system"
 '------------------- Curve list -------------------------------
  Call GraphObjNew("2D-Curve", "2DAxis1_Curve1")
  Call GraphObjOpen("2DAxis1_Curve1")
    D2CChnXName      = "C100227-6/000000000000TI00"
    D2CChnYName      = "C100227-6/000000000000AC0D"
  Call GraphObjClose("2DAxis1_Curve1")
  '------------------- Curve list -------------------------------
  Call GraphObjNew("2D-Curve", "2DAxis1_Curve2")
    Call GraphObjOpen("2DAxis1_Curve2")
      D2CChnXName      ="C100227-7/000000000000TI00"
      D2CChnYName      = "C100227-7/000000000000AC0D"
     Call GraphObjClose("2DAxis1_Curve2")
   Call GraphObjClose("2DAxis1")
'------------------- Curve list -------------------------------
Call PicUpdate(0)   
This code works fine with dat files having 2 channels TI00 and AC0D mentioned in the script. 
How can i modify the same script for any dat file having varying number of channels. For eg all dat files with 60 channels.Is it possible?? 
Am bad at programming, i dont know this logic works, whether i should mention all the channels in the dat file in my script or is there any alternative way??

 

0 Kudos
Message 3 of 4
(4,268 Views)

Hi Rash.patel,

 

You have two choices. You first option is to simply configure 60 curves in your TDR file, say referencing channels [1]/[1], [1]/[2]...[1]/[60].  Any missing channels will simply not be plotted.  Your second option is to use the same scripting approach you've alread posted, but loop over all the channels in the desired group and create a curve from scratch for each data channel.

 

Brad Turpin

DIAdem Product Support Engineer
National Intruments

0 Kudos
Message 4 of 4
(4,256 Views)