Open Automation Software
Moving Data From Anywhere to Anywhere
1-303-679-0898

Data Object

Each time the Trend Binding Callback function is called, a data object will be passed in, containing the following structure:

  • chartinstanceguid: string
    A unique identifier assigned to the Trend Binding by the OPC Server. This is used to identify the requesting client and individual binding so the server efficiently provides the client only data that is required and not previously sent. This value is used internally by the OAS Web HMI library.
  • firsttime: datetime
    A datetime representing the timestamp of the FIRST value in the series of values supplied in the data object. Combined with lasttime, you can determine the time scale for the data set.
  • lasttime: datetime
    A datetime representing the timestamp of the LAST value in the series of values supplied in the data object. Combined with firsttime, you can determine the time scale for the data set.
  • message: string
    A message sent from the server in the event of an error. For normal successful callbacks, this will be blank.
  • numberofvalues: integer
    The number of values in each array of values within the context of this data set.
  • penvalues: array
    Penvalues are an array of integer arrays, each containing a set of values corresponding directly to Tag Definitions in the Trend Binding. These arrays are provided in the same order that the Tag Definitions. Example:

The example above corresponds to a Trend Binding with 2 Tag Definitions. The full data structure may look something like the following. Note, that numberofvalues is the number of values in each set of penvalues, not the number of penvalues itself:

  • timesforreturnalldata: array
    If the returnalldatawithtimes option is set to true, the timesforreturnalldata will be present in the data set. This array will contain the same number if entries in each array for each pen, and each entry will be a timestamp representing the actual date/time for the corresponding pen value.
  • status: string
    The status of the callback. For successful operations, this will be “OK” and “ERROR” for all others. So you may choose to only process results with the status is “OK” and ignore others, or display a custom message to the user.