Getting Started

Base software installation and configuration

Steps

  1. Install Nodejs and NPM
  2. Install Node-RED
  3. Install Node-RED Ethernet/IP
  4. Install Node-RED Dashboard (Optional)

Installing Nodejs, NPM and Node-RED

Detailed installation instructions for multiple operating systems are available on the Node-RED site

Install Node-RED Ethernet/IP module

Go to Node-RED directory usually:

cd $HOME/.node-red

Install Ethernet/IP node to Node-RED palette:

npm install @serafintech/node-red-contrib-eip-io

Launch Node-RED

Run this command to start Node-RED

node-red

After start up , open up your browser and go to http://localhost:1880/.

You should see something like this. Node-RED

Adding a Ethernet/IP Device

Drag and drop an eip-io in node on to the flow.

Node-RED IO

Double click on the new eip-io in node to open up its parameters. Click the edit button at the Connection property to add a new connection node.

eip-io in

Now click on the edit button at the Scanner property to add a new scanner node.

Connection

Here you will use the default properties for the scanner node and click Add.

Scanner

This will bring you back to the connection node setup where you can see the Scanner property selected is the newly created scanner node. Next you need to fill in the rest of the connection properties.

Name
Names the connection. The device in the example is an Allen Bradley E1 Plus overload relay.
Address
The IP address of the device.
Config Assembly
From manufacturer's documentation.
Config Size
In 8-bit bytes. From manufacturer's documentation.
Input Assembly
From manufacturer's documentation.
Input Size
In 8-bit bytes. From manufacturer's documentation.
Output Assembly
From manufacturer's documentation.
Output Size
In 8-bit bytes. From manufacturer's documentation.
RPI
Delay between messages to/from device in milliseconds. 8ms minimum.

And then click Add.

Connection

Now back to the input node, the rest of the parameters can be entered. The example uses the table from the manufacturer (below) to setup the input node as Input 1.

E1 Plus Input Table

Name
Names the node.
Byte Offset
Number of 8-bit bytes to skip on the input assembly.
Bit Offset
Number of bits to skip on the input assembly.
Bit Size
Number of bits to read from the input assembly.
Update Rate
The input node will check for changes in value at this rate in milliseconds. If the value has changed, a new message will be sent from the node containing the new value. If this is set to zero, a message containing the current value will only be sent if the node receives an input message from another node.

Click Done To complete setup of eip-io in node.

EIP IO IN

Node Completed.

Deploy

A Debug node was added and the output from the Motor IN 1 is connected to the input of the Debug node so that the Motor IN 1 can be monitored.

Deploy

Now click deploy and the Motor IN 1 node will show connection status. The Debug output will show the initial value.

Deploy

A pushbutton switch is hardwired to the device and turned on and off to demo the function of the node.

Deploy

Next an eip-io out is added. The Motor IN 1 is connected to the eip-io out so when the button is pushed it will turn on the output.

Output

A table from the manufacturer's documentation describes the output mapping.

Output

When setting the properties of the eip-io out, we re-use the same connection node by selecting it from the drop down.

Output

Click Done and then Deploy and now the output relay of the E1 Plus turns on and off with the push button.

Output


See Node-RED user guide for more information on programming in Node-RED

© 2023 SerafinTech