Professional Documents
Culture Documents
IOT2040 NodeRed
IOT2040 NodeRed
HARDWARE COMPONENTS
1) IOT 2040
2) S7 1200 (Any CPU , Any Firmware version) OR S7 200 smart (Any)
3) PC/Laptop
4) Ethernet Switch
CONNECTIONS
1) Two LAN ports of IOT as LAN X1 P1 and LAN X2 P2. Connect X1 port with
PC/Laptop for communication of IOT (also with PLC or any other device ,
left port will be used).Port X2 is for connecting internet through LAN
cable.
2) Power supply – 24vdc
REQUIREMENTS
HARDWARE
1. SD CARD (empty Any)
2. Internet Connection :- Through LAN cable
SOFTWARE
1. Putty (For initial set up of IOT) Click here .
Download the first option under heading Download PuTTY and after that
choose out of 32 bit and 64 bit files options as per your laptop/PC
configuration
2. Win32diskImager Click here
FILE
Go to “Configure
Interfaces” and press
“Enter”
*****NOTE – For navigating and selection in the setup , use up/down and right/left and enter
keys from the keyboard. (Mouse will not work)
IOT SETTINGS
There will be 2 options :
1)eth0 for X1 P1 - 192.168.200.1 (default for Engineering). Change as per required
2)eth1 for X2 P2 - dhcp (default). Always remember that this port is used for Internet
connection so do not assign an IP address to it and keep “dhcp” as it is.
After changing ,press “OK”
In same way all other settings , for ports like serial (RS 232 and RS 485 ) ,
Peripherals(I/O) ,etc. can be done in the same setup window.
Communication with Siemens PLC
For this connect the IOT’s left side LAN port, also S71200 and your PC/Laptop, all to a
Ethernet switch. Connect Internet to X2 P2 port of IOT .
Ping and check the connection is established or not ,to both IOT and PLC.
PLC – *First Add one Data block with attribute as “Un-optimized” and add 2 or 3
random tags of Integer type(any data type can be given).
*In hardware configuration check the Get/Put permission box.
*Download the PLC program.
Now run putty again as per previous method and log in as “root”.
It will ask for password, so enter the new password which you have set during first
commissioning.
After successful login , type the command “cd /usr/lib/node_modules “ and press
enter. (This is to enter into the node red directory).
Now type “npm install node-red-contrib-s7 “. This is for installing s7 nodes.
Communication with Siemens PLC
After running that command , it will take some time to start the node. After that you
will see that its written on putty window that server now running at
http://127.0.0.1:1880/.
Once this comes , open Web browser and type the IP address of IOT with Port number
like this : “192.168.200.1:1880” and press Enter.
Once the Node-red page opens ,you will see different nodes listed on left hand side.
Communication with Siemens PLC
Press “Add” button in variables section. Add the variables you want to read out and
give them a name. The address is “DB,DatatypeOffset”.
Communication with Siemens PLC
* Absolute address is important and not name (name can be anything ,irrespective of what
given in PLC).Syntax is – DBX,Real0 i.e. DB number then comma and then data type with
offset number.
If
If PLC
PLC is is 200
200 smart:-
smart:-
1)
1) Slot Slot no.
no. == 22
2)
2) Variable
Variable syntax
syntax
for
for MM memory
memory
will
will be as
be as itit is
is
“MW0”, but
“MW0”, but for for
V
V memory,
memory, it it is
is
DB1,WORD0”
““ DB1,WORD0
If
If its
its Real
Real type
type then
then
instead of
instead of WordWord
,write
,write “Real”
“Real”
and
and same
same wayway
for
for other
other data
data
types too.
types too.
“DB1”
“DB1” will be
will be as
as itit is
is
always
always
* Like this keep on Pressing “+Add” for multiple tags and finally Press top right corner “Add”
to complete the addition of all variables.
Communication with Siemens PLC
Mode – Its nothing but you can select that whether to read selected variable from the
list or all the variables. The one you defined in the variables list.
Name – Any name can be given to the node ,which will be shown as a label.
Communication with Siemens PLC
Now from the Node list on left side, search “Debug” node and drag & drop on the
Screen.
After that you will be seeing two nodes on the Flow, S7 read and Debug. Connect these
two by dragging line from one to another.(In the image below the node is different and
not debug node)
After that Click on “Deploy”. This will download the flow to IOT(SD card).
You will see a message of “Successfully Deployed” on the top of web browser.
If the connection gets established , then you should be able to see the variable’s value
on the S7 read node.
NODE RED DASHBOARD
Node red gives a Dashboard where you can design the control and monitoring of any
PLC or device as per your requirement.
For this there are nodes present in the list on left side like gauge/Level Indicator/Lamps
etc. Drag & Drop these and connect to the S7 read write values for showing those on
dashboard.
For running the dashboard Click on “Dashboard” tab (highlighted in yellow) and then
click on the right side Arrow .
This will redirect you to another web page showing the elements selected on the Flow
by you.