LabVIEW Embedded

Showing results for 
Search instead for 
Did you mean: 

MTConnect - XML Data Parsing


Hello All,

I am currently working on a process monitoring application for machine tools (milling, lathe etc..), using a cRIO controller to accquire real-time data (vibration, temp) and the MTConnect open standard to communicate with the machine tool, which hosts the adapter and agent on a WINPC. The two datasets are time syncronized to allow correlations and are presented in a webpage as graphs, charts % downtime, % utilisation etc. I have successfully implemented a proof on concept demo of this.

I am now investigating the possibility of using the machine tools MTConnect data to control or change parameters on the cRIO depending on the state of the machine tool. For example you might want to change the sample rate based on a specific conditions, or have trigger conditions to start data acquisiations.

I believe i have several options to pass the XML data from the MTConnect Agent to the cRIO via LAN network.

  1. Use HTTP to read the MTConnect XML data from the Agent webserver on[@name="X"], however i'm not sure the best way to parse the data because you do not have the .NET capability on the cRIO to pull out parent, child data sets. Suggestions welcome?
  2. Create a C++/C# application to do the XML data parsing and the send the specific data as key value pairs to the cRIO using websockets?
  3. Any other suggestions

At the moment i'm consider the best way to start implementing this and therefore do not have specific code for feedback.

I would appreciate any thoughts or if my explanation isn't clear let me know.


0 Kudos
Message 1 of 5

I have always just used the string commands to parse the data.  Once you use the HTTP Get you should recieve a string output that you can manually parse to pull out any data needed. 

LabVIEW also has XML parsing VIs but I have never tried those (I only do limited XML work and was comfortable simply going with raw string manipulation). 

0 Kudos
Message 2 of 5

Thank you for the feedback.

I have used the XML parsing functions previously on the cRIO and it is quite combersom, to drag out the data you want. The XML data is quite dynamic and will change, so wanted to get anyway from having to write specific parsing code using the string .vis to reading the data and pull out specific data items. 

0 Kudos
Message 3 of 5

Has anyone used tinyXML2 on a cRIO? - It is a C++ XML parsing libary.

0 Kudos
Message 4 of 5



I am a little late to come to discussion, but I have a similar application as described by tshelleyamrc. @tshelleyamrc , Did you end up implementing the mtconnect+cRIO based system? I am able to use HTTP GET to get data from my Mtconnect agent. But after the body and header, I am not sure what to do next. The XML parser is not well documented and relies on saved XML files to get data out.  I want to call HTTP GET in a loop, extract sample values with "current" call and feed it to data logging system. 


Any ideas?




0 Kudos
Message 5 of 5