Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-red-contrib-solution-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-red-contrib-solution-engine
Node-RED nodes for interacting with Solution Engine and MTConnect devices.
Installation
cd ~/.node-red
npm install node-red-contrib-solution-engineOr for development:
cd /path/to/node-red-contrib-solution-engine
npm link
cd ~/.node-red
npm link node-red-contrib-solution-engineRestart Node-RED after installation.
Nodes
MTConnect Data Item (Read)
Reads a specific data item value from an MTConnect endpoint. Supports both Solution Engine and generic MTConnect brokers.
Configuration:
- Host: IP address or hostname (e.g.,
192.168.5.90,mtconnect.mazakcorp.com) - Port: MTConnect port (default:
5000) - Path: Optional path for generic brokers (leave empty for most cases)
- Data Item ID: The dataItemId to query (e.g.,
EngineInfo.EngineID)
Input:
msg.payload: Any value (triggers the read)msg.host: (optional) Override configured hostmsg.port: (optional) Override configured portmsg.path: (optional) Override configured pathmsg.dataItemId: (optional) Override configured data item ID
Output:
msg.payload: The data item valuemsg.dataItemId: The data item ID that was queriedmsg.timestamp: MTConnect timestampmsg.sequence: MTConnect sequence numbermsg.name: Friendly name of the data item
Broker Detection:
The node automatically detects whether the target is a Solution Engine or generic MTConnect broker:
- Solution Engine: Uses
/api/v6/mtc/current - Generic broker: Uses
/{path}/currentor/current
The broker type is cached after first detection for performance.
Examples:
Solution Engine:
Host: 192.168.5.90
Port: 7200
Path: (empty)
Data Item ID: EngineInfo.EngineID
→ URL: http://192.168.5.90:7200/api/v6/mtc/current
→ Returns: "DCA6326DA159"Mazak Demo Broker:
Host: mtconnect.mazakcorp.com
Port: 5610
Path: (empty)
Data Item ID: xpm
→ URL: http://mtconnect.mazakcorp.com:5610/current
→ Returns: "UNAVAILABLE"Important: Data item IDs are case-sensitive. Use exact case from the MTConnect XML (e.g., EngineInfo.EngineID not EngineInfo.EngineId).
Engine Set Data Item (Write)
Sets a data item value on a Solution Engine device.
Configuration:
- Host: IP address or hostname (e.g.,
192.168.5.90) - Port: Solution Engine port (default:
7200) - Data Item ID: The dataItemId to set (e.g.,
EngineInfo.Location.PostalCode)
Input:
msg.payload: The value to set (string or number)msg.value: (alternative to payload) The value to setmsg.host: (optional) Override configured hostmsg.port: (optional) Override configured portmsg.dataItemId: (optional) Override configured data item ID
Output:
msg.payload.success:trueif successful,falseif errormsg.payload.dataItemId: The data item ID that was setmsg.payload.value: The value that was sentmsg.payload.statusCode: HTTP status codemsg.response: Server response (if any)
Endpoint:
PUT http://{host}:{port}/api/v6/agent/dataRequest Body (XML):
<DataItems>
<DataItem dataItemId="EngineInfo.Location.PostalCode">
<Value>12345</Value>
</DataItem>
</DataItems>Example:
Set a postal code:
msg.payload = "12345";
// Data Item ID configured as: EngineInfo.Location.PostalCode
// → Sends PUT request with XML body
// → Returns: { success: true, dataItemId: "...", value: "12345", statusCode: 200 }Note: This node only works with Solution Engine devices, not generic MTConnect brokers.
Status Indicators
Both nodes show visual status indicators:
- Blue dot: Request in progress
- Green dot: Success
- Yellow ring: Data item not found (read node only)
- Red ring: Error occurred
Flow Examples
Basic Read Flow
[Inject] → [MTConnect Data Item] → [Debug]
Inject: Every 5 seconds
MTConnect Data Item:
Host: 192.168.5.90
Port: 7200
Data Item ID: EngineInfo.CPUTemp
Debug: msg.payloadRead and Write Flow
[Inject] → [Change] → [Engine Set Data Item] → [Delay] → [MTConnect Data Item] → [Debug]
Inject: Manual trigger
Change: Set msg.payload = "New Value"
Engine Set Data Item:
Host: 192.168.5.90
Port: 7200
Data Item ID: MyComponent.MyValue
Delay: 1 second
MTConnect Data Item:
Host: 192.168.5.90
Port: 7200
Data Item ID: MyComponent.MyValue
Debug: msg.payloadMultiple Hosts
[Inject] → [MTConnect Data Item (Engine 1)] → [Debug]
[MTConnect Data Item (Engine 2)] → [Debug]
[MTConnect Data Item (Mazak)] → [Debug]Each node can target a different host. Broker type is cached per host:port combination.
Troubleshooting
"Data item not found"
- Check case sensitivity: Data item IDs are case-sensitive. Verify the exact case in the MTConnect XML response.
- Verify the data item exists: Open
http://{host}:{port}/api/v6/mtc/currentin a browser and search for thedataItemIdattribute. - Check broker detection: Look at Node-RED logs to see which URL is being used.
Wrong URL being used
The broker type is cached in memory. Restart Node-RED to clear the cache if you changed the configuration.
Connection errors
- Verify the host and port are correct
- Check network connectivity:
curl http://{host}:{port}/current - Check firewall settings
Logging
Both nodes log useful debug information. View logs in the Node-RED console:
Detecting broker type for 192.168.5.90:7200...
Broker detection complete: isSolutionEngine=true
Fetching from: http://192.168.5.90:7200/api/v6/mtc/current
PUT to http://192.168.5.90:7200/api/v6/agent/data with body: <DataItems>...License
MIT
Author
Chris Tacke - Solution Family
Keywords
- node-red
- solutionengine
- mtconnect
- manufacturing
- lecenergy
- lecs