History read

<< Click to Display Table of Contents >>

Navigation:  MQTT API >

History read

Previous pageReturn to chapter overviewNext page

To read history data from TeslaCloud (for TeslaSCADA2 Runtime publishers) you have to use virtual topics (Node Control/ Get Tag History for sending request and Node Data/Tag History Data for getting response) and path of the Tag in the topic. Value contains in JSON format:

{

 name: {tagpath},

 begindate: {begin},

 enddate: {end}

}

Where:

{tagpath} - Path of the tag you want to read history information.

{begin} - Begin time period in milliseconds since 1970 year.

{end} - End time period in milliseconds since 1970 year.

 

History values will be returned in JSON format:

{

 name: {tagname}

  data: {

         x: {time},

         y: {tagvalue}

         }

}

Where:

{tagname} - name of the Tag.

{time} - Time in milliseconds since 1970 year.

{tagvalue} - Value of the tag.

 

Example:

Topic: spBv1.0/sparkplugb/edgenode/Node Control/Get Tag History

Value: {"name":"spBv1.0/sparkplugb/edgenode/devicenode/Parameter", "begindate":0, "enddate":1688373780250}

 

RESPONSE:

Value: {name:"Parameter", data:{"x":1688311087038, "y":26.0, "x": 1688360294299, "y":25.1.....}}