Skip to content

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.

ControllerWayPortExample flowTested
Fanuc 0i, 16i/18i/21i, 30i/31i/32i/35iFOCAS28193kealink-fanucSimulator
Mazak Smooth, Matrix, Fusion 640MTConnect5000kealink-mtconnectPublic demo machines
Haas NGCMTConnect8082kealink-mtconnectSame flow as Mazak
Okuma OSP-PMTConnectSet on the machinekealink-mtconnectPublic demo machine
Siemens Sinumerik 840D sl, ONE, 828DOPC UA4840kealink-opcuaSimulator and a public test server
Other OPC UA: Beckhoff, S7-1500, Euromap 77OPC UA4840kealink-opcuaSimulator
Siemens S7 1200, 1500, 300S7102Your own flowReal PLCs
Allen-Bradley CompactLogix, ControlLogixEtherNet/IP44818kealink-allen-bradleySimulator
Mitsubishi FX5, iQ-R, Q, LSLMP (MC protocol)Set in GX Workskealink-mitsubishiSimulator
Omron CJ, CP, NJ/NXFINS9600kealink-omronSimulator
Modbus TCP: drives, meters, other PLCsModbus TCP502kealink-modbusSimulator

Tested means the example flow ran in Node-RED against it, including the machine going away and coming back.

Every machine ​

  1. 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.
  2. 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.
  3. In Node-RED: menu, Import, Examples, node-red-contrib-kealink (0.4.2 or later), then the flow for your controller.
  4. Set the machine's address in the read or connection node, and the machine id and password in the kealink node.
  5. 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

  1. SYSTEM, then the right arrow to the EMBED PORT or ETHPRM screen (the name depends on the model).
  2. COMMON: IP address, subnet mask and router, to suit the box's network.
  3. FOCAS2: TCP port 8193.
  4. The embedded port selected, not PCMCIA.
  5. 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.

ReadingFrom
running1 while the cycle runs (STaRt)
modeMEM and RMT as AUTOMATIC, then MANUAL_DATA_INPUT, EDIT, the rest MANUAL
alarm1 for an alarm, a PMC alarm or emergency stop
programThe running program number, such as O1234
part_countThe parts counter on the CNC screen (parameter 6711)
spindle_speedActual spindle speed
You seeCheck
Connection timeoutIP, cable, same network
ECONNREFUSEDFOCAS2 off, or the port is not 8193
FOCAS recv timeout, Open handshake failedThe 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 valuesSend 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 ​

ControlHow
Mazatrol SmoothG, SmoothX, SmoothAi, SmoothEzMTConnect is in the control; it needs to be on
Matrix, Matrix 2, Fusion 640Mazak's MTConnect adapter on the control's Windows side, installed by Mazak
M32, M640 and olderNo 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 ​

ControlHow
NGC (about 2016 on)MTConnect is in the control and free; switch it on
ClassicNo 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:

ReadingFrom
running1 when Execution is ACTIVE
modeControllerMode
alarm1 when any Condition is Fault
program, tool, part_countProgram, ToolNumber, PartCount
spindle_speed, spindle_load, spindle_tempThe main spindle's actual speed, load and temperature
spindle_override, feed_overrideSpindle and feed override
You seeCheck
machine unavailableThe address answers but the machine sends nothing: it is off, or Mazak's adapter is not running
ECONNREFUSED, timeoutIP, port and cable; does the address open on a laptop
Opens on a laptop, not in Node-REDIs 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.

  1. In the Machine endpoint: opc.tcp://IP:4840, with the security and user set on the control.
  2. In the function's MAP, remove the // in front of the Sinumerik lines and delete the example PLC lines above them.
  3. Put the same node ids in Node ids to read.
ReadingNode id
runningns=2;s=/Channel/State/progStatus (3 is running)
modens=2;s=/Bag/State/opMode
programns=2;s=/Channel/ProgramInfo/progName
toolns=2;s=/Channel/State/actTNumber
spindle_speed, spindle_loadns=2;s=/Channel/Spindle/actSpeed, ns=2;s=/Channel/Spindle/driveLoad
part_countns=2;s=/Channel/State/actParts
alarmns=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 seeCheck
No connectionLicence, IP, port 4840; does UaExpert connect
Connected, no valuesThe user's read rights; the node ids as UaExpert shows them
Not in MAP, left outA 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.