How can we help?
MTConnect Constants and Variables
Overview
MTConnect variables are used to hold data retrieved from MTConnect enabled devices. Variables must exist in DataXchange and then be mapped to MTConnect items within the device.
MTConnect Source Variables
DataXchange is shipped with the following variables predefined:
| Variable Name | Notes | |
|---|---|---|
| Alarm Code [MTC.alarm_code] | Returns the alarm code without the description More Information | |
| Alarm Detail [MTC.alarm_detail] | Returns the alarm description | |
| Alarm Status [MTC.alarm_status] | Returns whether or not the equipment is in an alarm | |
| Capture MTC Alarms [MTC.alarms] | Used to capture all MTC alarms including those that go off simultaneously | |
| Connect Time [MTC.connect_time] | Returns the time of the most recent connection to the MTConnect Source | |
| Connected Time [MTC.connected_time] | Returns the amount of time in seconds since a successful connection to the Source. | |
| Cycle Status [MTC.cycle_status] | Return the cycle status. ACTIVE = Cycling | |
| Feed Rate Override [MTC.feedrate_override] | Returns the override of the selected axis | |
| Part Count [MTC.part_count] | Returns the value of the part counter on the control | |
| Part Number [MTC.part_number]{??} | Returns a string from a comment within the NC program More Information | |
| Program Number [MTC.program_number] | Returns the active program number from the control | |
| Spindle Load [MTC.spindle_load] | Returns the load of the selected spindle | |
| Spindle Override [MTC.spindle_override] | Returns the override of the selected spindle | |
| Spindle Speed [MTC.spindle_speed] | Returns the speed of the selected spindle |
The following variables hold the value for the previous poll from the Control.
| Variable Name | Syntax | |
|---|---|---|
| Alarm Status (Previous) | [MTC.prev_alarm_code] | |
| Connect Time (Previous) | [MTC.prev_connect_time] | |
| Connected Time (Previous) | [MTC.prev_connected_time] | |
| Cycle Status (Previous) | [MTC.prev_cycle_status] | |
| Feed Rate Override (Previous) | [MTC.prev_feedrate_override] | |
| Part Count (Previous) | [MTC.prev_part_count] | |
| Program Number (Previous) | [MTC.prev_program_number] | |
| Spindle Load (Previous) | [MTC.prev_spindle_load] | |
| Spindle Override (Previous) | [MTC.prev_spindle_override] | |
| Spindle Speed (Previous) | [MTC.prev_spindle_speed] | |
| Custom Variable (Previous) | [MTC.prev_CustomVariableName] |
MTConnect Constants
| Constant Name | Syntax | |
|---|---|---|
| CYCLING | [MTC.CYCLING] |
MTConnect Custom Variables
DataXchange has the ability to create custom variables for the MTConnect source. Use this feature to create a custom mapping to a data variable that the MTConnect machine may not map to by default. The first step is to create the custom variable.
Creating MTConnect Custom Variables
From the DataXchange tab, select Variable, then select the MTConnect menu item.
Click Add to create a new variable. Enter a name, which will be used in expressions to refer to the variable. This field is alphanumeric and cannot contain spaces. The Display Name will be used to refer to this variable in most other places and can contain spaces and special characters.
Using MTConnect Custom Variables
Once the variables have been defined they need to be mapped to MTConnect data items. The mapping is done at an individual equipment level since this may vary from equipment to equipment. To map a variable, select a machine from the Equipment List. Select Communication and modify the MTConnect Source. Custom variables are then mapped like any other default variable. The custom variables are at the bottom of the list of variable mappings.
Once the variable is mapped it will return data in expressions. An expression variable will be added for each custom variable
| Variable Name | Notes | |
|---|---|---|
| Custom Variable[MTC.CustomVariableName] | Returns the data from the custom mapping variable |
Note: Replace “CustomVariableName” with the actual Name of the Custom Variable.
The following variables hold the value for the previous poll from the Control.
| Variable Name | Syntax | |
|---|---|---|
| Custom Variable (Previous) | [MTC.prev_CustomVariableName] |
Note: Replace “CustomVariableName” with the actual Name of the Custom Variable.