An example, the command are hidden in a help file somewhere
Have stripped a bit out of the examples but you should get the gist of the actions.
LoadRTD is called from a button
Opens the PAV file "Pxxx_RTD.PAV"
Page with PAV Graph already open on a page with an AN of 6.
FUNCTION
LoadRTD(INT iP) //Load Px_RTD.PAV
PaLoadView("AN6","P" + IntToStr(iP) + "_RTD")
PaSetSpanTimes("AN6",iP);
END
FUNCTION
PaLoadView(STRING sPaObjectName = "PA", STRING sPavFile = PagePeekLast(0))
OBJECT hPA = ObjectByName(sPaObjectName);
_ObjectCallMethod(hPA, "LoadFromFile", sPavFile, 0);
END
//Sets span time
FUNCTION
PaSetSpanTimes(STRING sPaObjectName = "PA",INT PNum = 1)
OBJECT hPA;
OBJECT hPanes;
OBJECT hPane;
OBJECT hPens;
OBJECT hPen;
INT nPaneCount;
INT ISpan;
iSpan = 8 * 60; //Set to 8 Hours
GetDaysHoursMinsFromMins(iSpan);
hPA = ObjectByName(sPaObjectName);
hPanes = _ObjectGetProperty(hPA, "Panes");
hPane = _ObjectCallMethod(hPanes, "get_Item", 1);
hPens = _ObjectGetProperty(hPane, "Pens");
hPen = _ObjectCallMethod(hPens, "get_Item", 1);
_ObjectCallMethod(hPen, "SetDefaultSpan", 0, iPavDay, iPavHr, iPavMin, 0, 0);
_ObjectCallMethod(hPen, "ResetToDefaultSpan");
_ObjectCallMethod(hPen, "GoToNow");
END
FUNCTION
GetDaysHoursMinsFromMins(INT iMins)
iPavHr = 0;
iPavMin = 0;
iPavDay = 0;
IF iMins > 0 THEN
iPavHr = Abs(iMins / 60);
iPavMin = iMins - (iPavHr * 60);
iPavDay = Abs(iPavHr / 24);
iPavHr = iPavHr - (iPavDay * 24);
END