03-12-2008 04:31 AM
03-12-2008 10:13 AM
Hi Zhiyao,
When you create a new layout from scratch programmatically with the GraphDeleteAll() command, the resulting layout is by default number-oriented, meaning that it expects you to specify the channel references by channel number, which uses the following alternative variables:
D2CChnX ="[1]/Time"
D2CChnY ="[1]/Speed"
I would recommend that you programmatically switch the layout to use channel name referencing with the PicDefByIdent variable:
Call GraphDeleteAll()
Call GraphSheetNGet(1)
Call GraphSheetRename(GraphSheetName,"Report Sheet 1")
PicDefByIdent =1
Call GraphObjNew("2D-Axis","2DAxis1")
Call GraphObjOpen("2DAxis1")
Call GraphObjNew("2D-Curve", "2DObj1_Curve1")
Call GraphObjOpen("2DObj1_Curve1")
D2CChnXName = "[1]/Time"
D2CChnYName = "[1]/Speed"
Call GraphObjClose("2DObj1_Curve1")
Call GraphObjClose("2DAxis1")
Call PicUpdate()
Ask if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Instuments
03-12-2008 10:36 AM