RtFunctions

 

Remarks Properties Methods Samples

ED
avaliable
RT
avaliable

Remarks:Top

This collection contains the defined functions. The single functions can be executed at Runtime via VBA.

Properties:Top

Count Parent  

Methods:Top

Create Delete Export
Import Item  

Samples:Top

'Create Function for TREND - PICTURE
Sub CreateTrendFunction()
Dim zPIC As DynPicture
Dim zFCT As RtFunction
Dim i As Integer

	Set zPIC = MyWorkspace.ActiveDocument.DynPictures.Item("TREND")
	'Create new function
	Set zFCT = MyWorkspace.ActiveDocument.RtFunctions.Create("picTREND", tpPicture)
	'function settings...
	With zFCT
		.DynProperties("Picture") = zPIC.Name
		i = .DynProperties("PictFilter[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter"
		.DynProperties("PictFilter[0].RefreshRate") = 1
		.DynProperties("PictFilter[0].Name") = "WIZARD TREND"
		.DynProperties("PictFilter[0].IsArchive") = False
		.DynProperties("PictFilter[0].IsXAxis") = False
		'Add 3 CURVES
		For i = 0 To 2
			n = .DynProperties("PictFilter[0].Curve[-1]")
			If n <= i Then
				'create CURVE SubItem if needed
				.CreateDynProperty ("PictFilter[0].Curve")
				.CreateDynProperty ("PictFilter[0].Curve[" & i & "].VarInfo")
				.CreateDynProperty ("PictFilter[0].Curve[" & i & "].YAxe")
				.CreateDynProperty ("PictFilter[0].Curve[" & i & "].YAxe[0].Scale")
			End If
			'change curve settings
			.DynProperties("PictFilter[0].Curve[" & i & "].GraphName") = "MyVariable_" & i
			.DynProperties("PictFilter[0].Curve[" & i & "].HasYAxis") = True
			.DynProperties("PictFilter[0].Curve[" & i & "].IsShow") = True
			.DynProperties("PictFilter[0].Curve[" & i & "].IsInterpolation") = True
			.DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarName") = "MyVariable_" & i
			.DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.Channel") = "MyVariable_" & i
			.DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.Variable") = "MyVariable_" & i
			.DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarMaxValue") = 1000
			.DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarMinValue") = 0
			.DynProperties("PictFilter[0].Curve[" & i & "].YAxe.IsAutoScale") = False
			.DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Color") = vbBlack
			.DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Scale.ScaleTop") = 1000
			.DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Scale.ScaleBotton") = 0
		Next i
		'filter settings (relative time 5 minutes)
		.CreateDynProperty ("PictFilter[0].TimeAxe")
		.DynProperties("PictFilter[0].TimeAxe.OldDiff") = 3600
		.DynProperties("PictFilter[0].TimeAxe.TimeFilter.Options") = 65535
		.DynProperties("PictFilter[0].TimeAxe.TimeFilter.ARVTime1") = CDate(25569.0451388889) '("01.01.1970 01:05:00")
		.DynProperties("PictFilter[0].TimeAxe.TimeFilter.ARVTime2") = CDate(25569.0416666667) '("01.01.1970 01:00:00")
	End With
End Sub

'Create Function for ALARM - PICTURE
Sub CreateAlarmFunction()
Dim zPIC As DynPicture
Dim zFCT As RtFunction
Dim i As Integer

	Set zPIC = MyWorkspace.ActiveDocument.DynPictures.Item("ALARM")
	'Create new function
	Set zFCT = MyWorkspace.ActiveDocument.RtFunctions.Create("picALARM", tpPicture)
	'function and filter settings...
	With zFCT
		.DynProperties("Picture") = zPIC.Name
		i = .DynProperties("PictFilter[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter"
		.DynProperties("PictFilter[0].VarFilter") = "*"
		.DynProperties("PictFilter[0].FilterTitel") = "*"
		i = .DynProperties("PictFilter[0].TimeFilter[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter[0].TimeFilter"
		.DynProperties("PictFilter[0].TimeFilter[0].TimeFormat") = 10
		.DynProperties("PictFilter[0].TimeFilter[0].Options") = 65535
		.DynProperties("PictFilter[0].TimeFilter[0].ARVTime1") = CDate(25570.0416666667) '("02.01.1970 01:00:00")
		.DynProperties("PictFilter[0].TimeFilter[0].ARVTime2") = CDate(25569.0416666667) '("01.01.1970 01:00:00")
		i = .DynProperties("PictFilter[0].TimeFilter[0].ChargeFilter[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter[0].TimeFilter[0].ChargeFilter"
		i = .DynProperties("PictFilter[0].TextFilter[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter[0].TextFilter"
		i = .DynProperties("PictFilter[0].ListInfo[-1]")
		If i = 0 Then .CreateDynProperty "PictFilter[0].ListInfo"
	End With
End Sub