MTConnect standard does not specify or restrict the Application layer in the architecture keeping it completely open ended for the end user implementation.
The MTConnect Agent receives data from one or more devices and makes it available as XML, then transforms that into HTML.
There are four types of HTTP GET Requests that can be made to an agent (See REST Protocol Model):
probe: returns the structure of the available devices and their data items.
<ip_address:port>/probe or simply <ip_address:port> since probe is also the default request.http://127.0.0.1:5000/probe where the agent is running locally on port 5000.current: returns the latest values for each data item, along with a timestamp.
<ip_address:port>/current.sample: returns a sequence of values and their timestamps.
<ip_address:port>/sample.asset: returns a set of assets associated with the devices.
<ip_address:port>/asset or <ip_address:port>/assets.Available data can be specifically requested using a simple query language called XPath.
These will give an error if the given path cannot be found in the document.
http://172.26.81.154:5604/current?path=//DataItem[@type="AVAILABILITY"]
http://172.26.81.154:5604/current?path=//DataItems/DataItem[@id="avail"]
http://172.26.81.154:5604/current?path=//DataItems/DataItem[@category="CONDITION"]
http://172.26.81.154:5604/current?path=//Controller/*
http://172.26.81.154:5604/current?path=//Axes/Components/Linear/DataItems
http://172.26.81.154:5604/current?path=//Axes/Components/Linear[@id="x1"]
http://172.26.81.154:5709/current?path=//DataItem[@type="VARIABLE"]
http://172.26.81.154:5604/current?path=//Controller/Components/Path/DataItems/DataItem[@type="EXECUTION"]
http://172.26.81.154:5604/current?path=//Controller/Components/Path/DataItems/DataItem[@type="EXECUTION" or @type="CONTROLLER_MODE"]
http://172.26.83.69:5000/current?path=//Axes/Components/Rotary/DataItems/DataItem[@type="ROTARY_VELOCITY" and @subType="ACTUAL"]
http://172.26.81.154:5709/current?path=//DataItems/DataItem[@category="CONDITION"]|//Controller/*|//DataItem[@type="AVAILABILITY"]
from and count: The MTConnect Agent stores a certain number of observations, called sequences. You can specify which ones and how many to view with the from and count fields.count:
http://172.26.83.74:5000/sample?path=//DataItem[@type="PART_COUNT"]&count=4095
from and count:
http://172.26.83.74:5000/sample?path=//DataItem[@type="PART_COUNT"]&from=13&count=4095
http://localhost:5000/asset/EDP1234
http://localhost:5000/assets?path=//Assets/DataItems/DataItem[@type="CuttingTool"]
http://localhost:5000/current?path=//Devices/Device/DataItems/DataItem[@type="ASSET_CHANGED"]
http://172.26.83.83:5000/current?path=//DataItems/DataItem[@type="ASSET_CHANGED" or @type="ASSET_REMOVED"]
WARNING!
instanceIds in device files can change anytime agent reboots. Check and track theinstanceIdin the header.
HTTP data streaming is a method for an agent to provide a continuous stream of observations in response to a single request using a publish and subscribe communication pattern.
When an HTTP Request includes an interval parameter, an agent MUST provide data with a minimum delay in milliseconds between the end of one data transmission and the beginning of the next. A value of zero (0) for the interval parameter indicates that the agent should deliver data at the highest rate possible and is only relevant for sample requests.
To learn more about data streaming see REST Protocol Model.
http://172.26.83.83:5000/Mazak/sample?from=172&interval=2000&path=//DataItems/DataItem[@type="ASSET_CHANGED" or @type="ASSET_REMOVED"]