Appearance
Machines and controllers
Node-RED reads the machine, and the Kealink node sends the values. Kaynan Nexus only reads: nothing here writes to a machine.
| Controller | Way | Port | Example flow | Tested |
|---|---|---|---|---|
| Fanuc 0i, 16i/18i/21i, 30i/31i/32i/35i | FOCAS2 | 8193 | kealink-fanuc | Simulator |
| Mazak Smooth, Matrix, Fusion 640 | MTConnect | 5000 | kealink-mtconnect | Public demo machines |
| Haas NGC | MTConnect | 8082 | kealink-mtconnect | Same flow as Mazak |
| Okuma OSP-P | MTConnect | Set on the machine | kealink-mtconnect | Public demo machine |
| Siemens Sinumerik 840D sl, ONE, 828D | OPC UA | 4840 | kealink-opcua | Simulator and a public test server |
| Other OPC UA: Beckhoff, S7-1500, Euromap 77 | OPC UA | 4840 | kealink-opcua | Simulator |
| Siemens S7 1200, 1500, 300 | S7 | 102 | Your own flow | Real PLCs |
| Allen-Bradley CompactLogix, ControlLogix | EtherNet/IP | 44818 | kealink-allen-bradley | Simulator |
| Mitsubishi FX5, iQ-R, Q, L | SLMP (MC protocol) | Set in GX Works | kealink-mitsubishi | Simulator |
| Omron CJ, CP, NJ/NX | FINS | 9600 | kealink-omron | Simulator |
| Modbus TCP: drives, meters, other PLCs | Modbus TCP | 502 | kealink-modbus | Simulator |
Tested means the example flow ran in Node-RED against it, including the machine going away and coming back.
Every machine
- In Kaynan Nexus: on Machines, press Add machine. For a CNC, under Template, choose the CNC machine in Kaynan Nexus examples: its readings and dashboards come with it. Copy the machine id and password straight away; the password is shown once. See Setting up machines.
- On a Kaynan Nexus Edge box: press Update on the box's page once. It installs the Node-RED nodes for every controller here, and restarts Node-RED. On your own Node-RED, install the node named in the flow's description from Manage palette.
- In Node-RED: menu, Import, Examples, node-red-contrib-kealink (0.4.2 or later), then the flow for your controller.
- Set the machine's address in the read or connection node, and the machine id and password in the kealink node.
- Deploy. The status under the function shows what it read, the debug panel shows What was sent, and the values appear on the machine's page in Kaynan Nexus.
The box must be on the machine's network and reach its port. A laptop on the same network is the quickest check: if the laptop cannot reach the machine, neither can the box.
Fanuc
Needs FOCAS2 on the embedded Ethernet port. Most 0i-D, 0i-F and 30i-series controls have it; on older ones it may be an option.
On the CNC
- SYSTEM, then the right arrow to the EMBED PORT or ETHPRM screen (the name depends on the model).
- COMMON: IP address, subnet mask and router, to suit the box's network.
- FOCAS2: TCP port
8193. - The embedded port selected, not PCMCIA.
- Power the CNC off and on after a change.
In Node-RED: kealink-fanuc. In the My Fanuc config node: the CNC's IP, port 8193, series 16/18/21/0i/30i. One read every 30 seconds gets status, program, part count, alarms and spindle speed together.
| Reading | From |
|---|---|
running | 1 while the cycle runs (STaRt) |
mode | MEM and RMT as AUTOMATIC, then MANUAL_DATA_INPUT, EDIT, the rest MANUAL |
alarm | 1 for an alarm, a PMC alarm or emergency stop |
program | The running program number, such as O1234 |
part_count | The parts counter on the CNC screen (parameter 6711) |
spindle_speed | Actual spindle speed |
| You see | Check |
|---|---|
| Connection timeout | IP, cable, same network |
| ECONNREFUSED | FOCAS2 off, or the port is not 8193 |
| FOCAS recv timeout, Open handshake failed | The CNC accepts the connection but does not answer: another monitoring program may hold its FOCAS connections, or the CNC was not restarted after a change |
| no readable values | Send us a photo of the controller's model and series screen |
Kaynan Nexus Edge boxes install our fixed copy of the Fanuc node: it closes the connection when a read fails, and reads status on 21i, 32i and 35i. On your own Node-RED, install that copy from Manage palette, Install, upload. Series 15 controls send no status.
Mazak
| Control | How |
|---|---|
| Mazatrol SmoothG, SmoothX, SmoothAi, SmoothEz | MTConnect is in the control; it needs to be on |
| Matrix, Matrix 2, Fusion 640 | Mazak's MTConnect adapter on the control's Windows side, installed by Mazak |
| M32, M640 and older | No network data: wire the running and alarm signals instead |
Check: from a laptop on the same network, open http://IP:5000/current. A long XML page means it is ready. If not, ask Mazak service whether MTConnect is on, and on which port.
In Node-RED: kealink-mtconnect, with no extra node. In MTConnect /current, the URL that opened on the laptop.
Haas
| Control | How |
|---|---|
| NGC (about 2016 on) | MTConnect is in the control and free; switch it on |
| Classic | No MTConnect. Contact us |
On the machine: SETTING, Network: the machine has an IP address, and MTConnect is enabled. Then open http://IP:8082/current from a laptop on the same network.
In Node-RED: kealink-mtconnect, as for Mazak, with the URL http://IP:8082/current.
Okuma
OSP-P controls with Okuma's MTConnect application installed and running. Ask Okuma or the machine's dealer for the port, then open http://IP:PORT/current from a laptop. In Node-RED, kealink-mtconnect with that URL.
MTConnect readings
One function reads Mazak, Haas, Okuma and any other MTConnect machine:
| Reading | From |
|---|---|
running | 1 when Execution is ACTIVE |
mode | ControllerMode |
alarm | 1 when any Condition is Fault |
program, tool, part_count | Program, ToolNumber, PartCount |
spindle_speed, spindle_load, spindle_temp | The main spindle's actual speed, load and temperature |
spindle_override, feed_override | Spindle and feed override |
| You see | Check |
|---|---|
| machine unavailable | The address answers but the machine sends nothing: it is off, or Mazak's adapter is not running |
| ECONNREFUSED, timeout | IP, port and cable; does the address open on a laptop |
| Opens on a laptop, not in Node-RED | Is the box on the same network; does the URL end in /current |
Siemens Sinumerik
Needs the OPC UA licence on the control, from Siemens or the machine's dealer.
On the control: OPC UA switched on in commissioning, on port 4840, with a user allowed to read. Then connect from a laptop with the free UaExpert to opc.tcp://IP:4840 and find the values.
In Node-RED: kealink-opcua.
- In the Machine endpoint:
opc.tcp://IP:4840, with the security and user set on the control. - In the function's
MAP, remove the//in front of the Sinumerik lines and delete the example PLC lines above them. - Put the same node ids in Node ids to read.
| Reading | Node id |
|---|---|
running | ns=2;s=/Channel/State/progStatus (3 is running) |
mode | ns=2;s=/Bag/State/opMode |
program | ns=2;s=/Channel/ProgramInfo/progName |
tool | ns=2;s=/Channel/State/actTNumber |
spindle_speed, spindle_load | ns=2;s=/Channel/Spindle/actSpeed, ns=2;s=/Channel/Spindle/driveLoad |
part_count | ns=2;s=/Channel/State/actParts |
alarm | ns=2;s=/Nck/State/numAlarms above 0 |
These come from Siemens' variable names and have not yet been read from a real control: confirm each one in UaExpert first.
| You see | Check |
|---|---|
| No connection | Licence, IP, port 4840; does UaExpert connect |
| Connected, no values | The user's read rights; the node ids as UaExpert shows them |
| Not in MAP, left out | A node id was read but is missing from MAP: the two lists must match |
Other OPC UA
Beckhoff TwinCAT, S7-1500 with OPC UA on, Euromap 77 injection moulding machines and anything else with an OPC UA server. Same steps as Sinumerik: find the node ids in UaExpert, list them in Node ids to read, and give each a reading name in MAP. The function has examples for Beckhoff, S7-1500 and Euromap 77.
ns= numbers can change with a firmware update. If values stop after an update, check the node ids in UaExpert again.
Siemens S7
On the PLC, in TIA Portal: allow PUT/GET communication, and turn optimised block access off on the data blocks to read. Then use node-red-contrib-s7 with the PLC's IP, rack 0 and slot 1 (S7-1200 and 1500), feeding the kealink node.
Allen-Bradley
Needs the tag names and the processor's slot (0 on a CompactLogix).
In Node-RED: kealink-allen-bradley. In the PLC endpoint, the IP, the slot and every tag to read with its type. In the function's TAGS, a reading name for each. Program tags are written Program:MainProgram.Speed.
The read node only reports changes, so the timer in the flow resends the latest values. Nothing is sent while the PLC is unreachable.
Mitsubishi
On the PLC, in GX Works: open a port for SLMP (MC protocol), binary, TCP.
In Node-RED: kealink-mitsubishi. In the connection node, the PLC's IP, that port and the PLC model. In the function's POINTS, the D, M, X and Y addresses with a reading name, type and scale. If the read node does not list a point, a warning gives the address line to paste into it.
Omron
On the PLC: FINS on, and the PLC's FINS node number.
In Node-RED: kealink-omron. In the connection node, the PLC's IP, DA1 (the PLC's node number) and SA1 (one for the box). In the function's POINTS, the DM, CIO, W and H addresses; the read nodes must cover every word used.
Modbus TCP
Needs the register list from the device's manual, and its unit id.
In Node-RED: kealink-modbus. In the client node, the IP and unit id; in the getter, the first register and how many (at most 125 per getter); in the function, each register's reading name, type and scale. A register numbered 40001 or 30001 in a manual is 0 here. An energy meter example is in the function.
The flow reads every 5 seconds and the kealink node sends every 30, so a device back from an outage shows up within seconds.
Machines with no network port
Read them through a serial-to-Ethernet Modbus converter, or wire the running and alarm signals (a stack light, a cycle relay, a parts-count pulse) to the box or a small PLC.
First reading on a new machine
Send us photos of the debug panel and the machine's own screen, with the machine running, stopped and in alarm. We compare them and correct the mapping if needed.