• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configuring S7-1200 PLC to communicate with node-red ...
#1
Hello, I am a student currently working on a project where I am trying to read and write data from node-red to PLC and vice versa. I have got a few questions regarding the hardware connection of the netPi to S7-1200 PLC.

The way I did my setting:
1. The IP address of the netPi is configured under the path of Edge Gateway default browser>Control Panel>Network>LAN.
2. Then I configured the Wi-fi connection so that netPi can communicate with its default browser through Wi-fi instead of LAN.
3. The netPi was initially connected to PC using a switch, where the LAN and 'fieldbus in' port is connected to the switch.
4. To configure the PLC program, I dowloaded the netPi GSD file and added it into the TIA portal. 

Issues:
1. When I plugged in both the 'fieldbus in' and 'fieldbus out' port to the same switch, the TIA portal cannot detect the netPi device at all, however when I removed one of the fieldbus conenction leaving either 'fieldbus in' or 'fieldbus out' connected to the switch, TIA portal is able to detect the netPi. Then I tried to download the program into the connected PLC, an error of I/O device cannot be reached occur in the TIA portal.

Questions:
1. How should I connect the netPi to PLC so that TIA portal can detect the netPi, is it through either of the fieldbus connection only (in or out)?
2. I have set the IP address of the netPi GSD file to be the same in the netPi default browser under the path of Edge Gateway default browser>Control Panel>Network>LAN, but the the same error of 'I/O device' cannot be found occur when I checked the online diagnostic of the netPI in TIA portal, could anyone please guide me through how the setup should be done properly?

Thank you.

Kind regards,
Cman587


Attached Files
.pdf   Connection.pdf (Size: 809.69 KB / Downloads: 12)
  Reply
#2
Hi there,

the good news first ... your project can be realized as your pdf drawing is showing it.

Since I had a similar case in the forum yesterday I recommend to you to read this post here from yesterday https://forum.hilscher.com/thread-694-post-2991.html. This member hat a similar problem with his master PLC ET200 as you have with your master PLC S7-1200.

First of all the 2 x RJ45 Ethernet ports needs to be configured to run PROFINET. netPI can run also EtherNet/IP or EtherCAT or POWERLINK or or or on these ports. So you need to tell it which of these protocols it shall run. Did you do this? I suppose not from what I read.

For an easy setup I recommend to use Node-RED tool to setup the netPI running PROFINET. But Node-RED is not preinstalled on netPI. To install it your have to run a Docker container additionally. Watch this video how to deploy a container in general: https://www.youtube.com/watch?v=A-asfhl7b0c.

The video shows how to deploy Raspbian ... you need to do it of course with Node-RED whose repository you find here https://hub.docker.com/r/hilschernetpi/netpi-nodered. After you deployed it watch this video here to see how you get the 2 x RJ45 ports (fielbus ports) https://www.youtube.com/watch?v=TmNgbGS_ydE configured.

After all this the fieldbus ports are PROFINET capable and can be scanned by TIA as your S7-1200 PLC. There is no need to plug in both cables. One single cable as you did it is totally enough for scanning and communicating PROFINET. Both ports are equal.

One important thing. Do not configure the eth0 interface of netPI to the same IP address the S7-1200 request for the netPI PROFINET address. This is wrong. The eth0 port is not PROFINET capable an a standard Ethernet port and needs to have an unused IP address in your whole setup. I recommend to set the eth0 IP address to something like 192.168.0.254 outside the standard IP addresses that are usually used in PROFINET

TIA configures an IP address of 192.168.0.1 for the S7 and the first PROFINET device something like 192.168.0.2. When the S7-1200 is started later after being configured and finds the netPI on the fieldbus ports it will auto-configure the netPI to address 192.168.0.2 from remote on these ports. This is not something you can influence. So there is no setup needed in the netPI Web UI concerning PROFINET as you did before. All is done automatically.

Good Luck.

Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
Hello Armin, thank you for the quick reply. Technically, I have followed the steps as mentioned in your previous reply.

Here's what I have done:
1. Created a container in docker to access Node-Red.
2. In the Node-Red, I configured the fieldbus in and out node by setting the fieldbus interface to the only option available (in which there is only 1 fieldbus interface in my case).
3. I have configured the PROFINET Device Configuration by using 1 send byte and 1 receive byte to read digital input and output from S7-1200 PLC.
4. I have also map the input and output of netPi to the S7-1200 PLC in the TIA program.

Issues:
1. When the LAN port of netPi and either one of the fieldbus port is connected tot he same switch, TIA portal can detect the the netPi, but the netPi default browser cannot be
established (meaning I cannot access the netPi's Node-Red at all).
2. When the netPi's fieldbus port connection is removed (both in and out are not connected to the switch), the netPi's default browser can be established properly (meaning I have
access to netPi's Node-red and the status of the PROFINET IO node in/out is 'running' instead of 'communicating'), but this would mean that TIA Portal cannot detect the
netPi device at all.

Questions:
1. Does connecting the fieldbus port stops the netPi's default browser from establishing normally?
2. Do I need to configure the S7-1200 PLC in advance and then load the program from TIA to S7-1200 PLC first and then configure the PROFINET Device
Configuration and Node-Red flow in the browser?

Thank you.

Kind regards,
Cman587
  Reply
#4
Hi there,

the Web-UI of netPI is executed and featured by netPI's Raspberry Pi CPU. The PROFINET is featured by the second netPI controller named netX coming from Hilscher.

Since both controller are running totally independent there is no influence between both. So when the Node-Page is available before connecting the S7 then this page must be also available after you connect the S7.

Now to your problem and this is just a guess from my side. When the S7 establishes a connection to netPI over PROFINET then it assigns an IP address to the fieldbus ports. This is the IP address you configure in TIA. If now in the whole switched network a double IP address get present then usually the interfaces are going offline and are not reachable any more. So supposing your netPI primary ethernet port is configured in netPI's web UI to 192.168.0.2 and later the S7 configures the same address 192.168.0.2 on the fieldbus ports too ... which is not allowed by the way .. then netPIs ethernet port will go offine. I think this is the problem right now.

So what is your IP address of your netPI and eth0 port?

To your questions in detail

1. no it never stop it
2. no you do not need to configure something in advance. You can do all configurations in parallel

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Configuring EtherCAT communication Hoeber 1 2,170 September-22nd-2021, 01:29 PM
Last Post: Armin@netPI
  IoT Edge Gateway: Node-RED - ARRAY -> OPC UA AxelHa2111 5 4,799 May-21st-2021, 05:13 PM
Last Post: Armin@netPI
  InfluxDB, Node-RED and Grafana Armin@netPI 0 3,686 January-6th-2021, 02:36 PM
Last Post: Armin@netPI
  PROFINET to OPC UA data conversion with Node-RED Armin@netPI 0 3,571 July-7th-2020, 12:20 PM
Last Post: Armin@netPI
  Accessing Siemens S7 PLCs over Node-RED Armin@netPI 3 9,249 February-24th-2020, 06:44 PM
Last Post: jacp
Information NPIX-RCAN with node-red-contrib-canbus node patrick 0 2,128 August-22nd-2019, 02:36 PM
Last Post: patrick

Forum Jump:


Users browsing this thread: 1 Guest(s)