Browsed by
Tag: mtconnect

An MTConnect Command-Line Client

An MTConnect Command-Line Client

As a weekend project, I put together a command-line MTConnect client. It’s coded in C# for .NET 5.0, and I’ve published the source code on GitHub. It’s still a little rough around the edges, but here’s a quick look.

Testing whether an MTConnect Agent is running at a given URL. At agent.mtconnect.org, yes. At google.com, no.

One use for a command-line client might be for easily checking whether an MTConnect agent is running at a given address. The test just runs a probe and checks whether an MTConnectDevicesDocument is returned.

Obviously the error message is not great, but OK means ok, and Error means not ok.

(Part of the check didn’t make it into the initial release, but the client should still identify a webserver serving non-XML data as not being an MTConnect agent. This’ll be fixed in the next release.)

Displaying current condition dataItems from the agent.

Another use might be to easily feed data to stdout for scripting purposes. The client will output the entirety of a “Current” or “Sample” MTConnectStreamsDocument by default. Output can be configured for XML or JSON.

It can also be configured to filter dataItems by id, name, category, type, and/or subtype. In this case, the client will output a list of dataItems that match the filter. Output can be configured for XML, JSON, or CSV.

(Ok, the CSV output is pretty broken. It doesn’t include column headers. It doesn’t include condition. It doesn’t deal with escaping commas etc.)

Doing some things in interactive mode.

If no commands are passed on the command-line, the client will start interactive mode. Enter a command at the > prompt, and it will be run immediately. The screenshot above shows outputting a particular dataItem as XML or JSON, displaying help, and outputting a probe request.

I’ll update this client as time permits and whenever I notice bugs. If you’re interested in seeing features (or notice bugs that I’ve missed) please contact me here or on GitHub.

Access MTConnect data from a web application

Access MTConnect data from a web application

About five years ago I wrote 5 ways to access MTConnect data from a web application. This article outlined methods for accessing the MTConnect agent’s data from a client-side web application.

Ignore it. Much has changed in web development since then, and some of the methods mentioned in the old article range from bad to obsolete. If you want to write an MTConnect web application, here are your best options:

Read More Read More

Using MTConnect for Automation

Using MTConnect for Automation

Eight years ago when I first encountered MTConnect, I felt the technology would transform the machine shop. Today, support for MTConnect is commonplace in new machine tools, and often available for older tools through various upgrade options. Software packages exist to collect and analyze data on a server or on the cloud. However, I thought the technology could become a lightweight option not only for data analytics, but also for basic machine shop automation.

Read More Read More

Will TrakHound run on Linux?

Will TrakHound run on Linux?

No. At least, I’ve had no luck running any of the TrakHound components on Linux.

In a previous post I mentioned that I could not try the TrakHound community software, since I do not have a Windows machine. Afterwards I wondered how true that was. After all, Wine does a decent job running most Windows software, and .NET support on Linux has gotten much better in recent years. So I thought it was worth a shot.

Read More Read More

Installing the NodeJS MTConnect Agent

Installing the NodeJS MTConnect Agent

A long time ago on a blog far, far away, I wrote an article called “Set up an MTConnect Agent in three or so steps”. This became one of the most visited articles I have ever written, and is still being viewed four years later. However, much has changed in the MTConnect world in the past four years, so I wanted to take another look at installing an MTConnect agent.

Read More Read More