Macro variables are used in just about every shop process because of their flexibility and utility. Being able to read them is a critical part of any data collection system. As MTConnect focuses on standardization, the variables are excluded. It is however simple to add them to any MTConnect connection to a FANUC CNC control. Once the Adapter is setup to read macro variables ( see tutorial here) It’s time to setup the Agent.
The MTConnect agent setup is surprisingly simple. Almost too simple. Initially I struggled for hours trying to learn and understand how to extend the agent schema files to accept the macro variables. I used this tutorial here as a base. It turns out the only necessary step is to add the following line to the device xml file…
<DataItem type="VARIABLE" category="EVENT" id="mc1" name="whale">
That’s it… That’s That and That’s all. The type and id can be anything you like. In this example I’ve used “VARIABLE” and “mc1“. The agent simply matches the value of the name property, with the matching name that is output from the adapter.
[adapter] port = 7878 service = MTC Focus 1 [focus] host = 10.211.55.5 [macros] whale = 500 [pmc] SspeedOvr = 30 Fovr = 12
Macro variable 500 is tied to the name “whale” at the adapter. The agent matches the name “whale” and continues to pass it on to the client.