<< Click to Display Table of Contents >>
DataSourceType |
Determines the source of a Pen's data. The available options for this property are described on the next table.
Available options for the DataSourceType property
Option |
Description |
---|---|
0 - Realtime |
Indicates a connection of this Pen to a Tag updated in real time |
1 - Historic |
Indicates a connection of this Pen to data received from a Query |
2 - Historic and Realtime |
Indicates a connection of this Pen to real-time Tags and historical data simultaneously |
3 - Automatic |
Indicates an automatic connection of this Pen to a server, according to a period of time selected on the Horizontal Axis |
When this property is equal to 0 (zero, Realtime), the XLink and YLink properties inform all links used, or else the UseTimeStamp property informs that the XLink property is not used, replaced by the YLink property's timestamp. When this property is equal to 1 (one, Historic), the XField and YField properties inform the table fields to use. The QueryName property indicates the name of the table used. When this property is equal to 2 (two, Historic and Realtime), the options 0 (zero) and 1 (one) work simultaneously for this Pen. When this property is equal to 3 (three, Automatic), this Pen is plotted using an automatic Axis, which receives minimum and maximum limits from the configuration of a Tag's engineering unit on the server.
NOTE |
At run time, when this property changes and a Pen stops displaying real-time data, users must use the Connect method to display that data again. |
The next script contains an example of using this property.
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
MsgBox "Click OK to create a Pen."
Set Pen = E3Chart1.Pens.AddPen("Pen1")
Pen.DataSourceType = 0 ' Realtime
Pen.YLink = "Data.DemoTag1"
Pen.UseTimeStamp = True ' In X uses timestamp
Pen.Color = RGB(255, 0, 0)
Pen.Docstring = "Test"
MsgBox "Click OK to connect."
Pen.Connect() ' Starts receiving data
MsgBox "Click OK to fit."
E3Chart1.FitPen(0)
MsgBox "Click OK to remove this Pen."
E3Chart1.Pens.Remove(Pen.Name)
End Sub