Event-based monitoring of the XML output

Posted By wiesson 6/23/2013 5:59:30 AM
Add to Favorites0
Author Message
wiesson
 Posted 6/23/2013 5:59:30 AM
Prestige User

Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)

Group: Forum Members
Last Active: 5/19/2014 8:22:38 AM
Posts: 5, Visits: 67
Hey,

I hope this is the right part of the forum. My question is related to the event-based monitoring of the XML output such as /current or /sample. I have a machine tool running with mtconnect agent on a headless (ubuntu) laptop and an adapter on the HMI of the CNC.

By reading the socket of the adapter, it is easy for me to catch the events and create event-based websockets for e.g. browser notification if a machine is running or not. By examining the /machine-id/ current or sample as XML, I'm confused. Do I have to read all sequences and check if my desired value is stated or not? What is the regular procedure?

Due to MTConnect is read-only, I have to parse all sequences (if I missed some, I can grab them with sample?from=XY&to=ZZ)?

EDIT: Okay, I figured out that I can easily do something like that: curl 'ip-to-agent:5000/sample?interval=0' to receive a steady stream of data.
6/23/2013 6:18:15 AM by wiesson
FAC&T
 Posted 7/1/2013 1:03:38 AM
Prestige User

Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)Prestige User - (3,090 reputation)

Group: Forum Members
Last Active: 7/1/2013 1:34:12 AM
Posts: 4, Visits: 11
Wiesson,

If you are only interested in either specific data items related to your machine, you can also use XML filtering in your Sample request to limit the response to a specific data item or set of data items. You will just need to keep track of the last sequence polled so that you are always getting new data.

You may want to refer to the MTConnect Standard, Part 1, Section 5.10 for more information on how to structure a Sample or Current Request using Filtering.
wiesson
 Posted 8/9/2013 5:24:30 AM
Prestige User

Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)Prestige User - (3,070 reputation)

Group: Forum Members
Last Active: 5/19/2014 8:22:38 AM
Posts: 5, Visits: 67
Thanks for replying, I figured out how it works and build a small monitoring device with Python and websockets. Thanks for the info!

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top

Advertisements