Skip to content

Writing data to a machine (Kaynan Fusion flows) ​

Kaynan Nexus only reads machines, and nothing in the portal can write to one. This page is for Kaynan Fusion's own Node-RED flows on the box, for example a robot cell passing a job or program number to the machine it tends.

Data only. Job numbers, program numbers, counts, recipe numbers. Never safety signals: cycle start, door, chuck, emergency stop and interlocks stay on hardwired I/O.

The safe write function ​

The example flow kealink-safe-write (in Import, Examples, node-red-contrib-kealink, 0.4.3 or later) has a function that sits in front of the machine's write node. It sends a value only when:

  • the key is on its ALLOW list,
  • the value is a number within that key's min and max (a whole number where the entry says integer: true), or true or false where it says type: "bool",
  • the value fits the place it is written to, such as a 16-bit register,
  • the same key was not written in the last second (MIN_INTERVAL_MS).

If any value in a message fails, nothing is sent. The reasons go to the function's second output and to the debug panel as a warning, and the status under the function shows the first one. When the values go through, the status shows sent N at HH:MM.

Send it either several values at once or one per message:

js
msg.payload = { job_number: 1234, program: 130 };
js
msg.topic = "job_number";
msg.payload = 1234;

Set up ​

  1. Import kealink-safe-write.
  2. In the function, set PROTOCOL and list each key in ALLOW with its min, max and target. The function has an example for each protocol.
  3. Replace the Write node goes here debug node with the machine's write node:
PROTOCOLWrite nodeIts settings
modbusModbus Flex Write (node-red-contrib-modbus)The client node set to the device. target: fc 6 or 16 for a holding register, 5 for a coil, and the address (40001 in a manual is 0)
opcuaOpcUa-Client (node-red-contrib-opcua)Action WRITE, endpoint set to the machine. target: nodeId and datatype
allen-bradleyeth-ip out (node-red-contrib-cip-ethernet-ip)It writes one tag, chosen in the node: put a switch on msg.topic first, with one eth-ip out per tag. target: tag
omronFINS Write (node-red-contrib-omron-fins)Address msg.topic, Data msg.payload. target: address, such as D100, or W0.01 for a bit
mitsubishislmp-write (@fa_yoshinobu/node-red-contrib-plc-comm-slmp)Updates left empty. target: address with its type, such as D100:U or M100:BIT
  1. Deploy, and send a test value the machine can safely take.

Fanuc: use the fanuc-focas-write node instead. It has its own allow list and reads every value back.

Check the value arrived ​

The function only knows what it sent. Where the machine allows it, read the value back with that machine's read node and compare.