Connection between PLC - S7- LAN- adapter - Machina Gate; troubleshooting guide
This article describes how you can get a connection, a TSAP list and symbols from a PLC in usage of a Machina Gate and a S7-LAN-Adapter.
Set your S7 LAN- adapter correctly
- Connect your S7-LAN-adapter to your computer
- go to your web browser and go to the IP address of your S7 LAN Adapter (default = 192.168.1.56)
- check that the S7-LAN Adapter are in the correct network and subnetmask as the second interface of the Machina Gate
- please follow How to change the IP address on an S7-Lan adapter
Important S7 Lan adapter settings
Always in Bus: please activate this option, makes the connection much faster
Use bus config from PC: in my test cases it makes no difference, you will have a good connection with or without this setting
Baudrate: very important! Check your Baudrate in your SIEMENS settings / TIA Portal settings! The settings have to be the same there as here.
Highest station address: important! You will get a TSAP list in all station addresses, but it has to be the same there as here. If there are different addresses, it takes a lot of time to get a TSAP list.
PG/PC is the only master: important! deactivate this option. If you are using a PLC you can be sure that the PLC is the master.
S7 LAN settings | SIEMENS TIA Portal settings |
TIA Portal settings
You can also change the settings in TIA Portal, but it makes more sense to adjust the S7- LAN- Adapter settings.
The PG communication, OP communication or S7 basic communication does not have an influence to the connection between the PLC, the S7- LAN- Adapter and the cloud.
The parameter "S7 basic communication" indicates with how many participants the PLC has to communicate.
I tested it with CPUs from SIEMENS: S7 313C and SIEMENS S7 315F.
Scenario 1: Get a TSAP list from the PLC which is connected over the S7- LAN- adapter to the Machina Gate; without network switch
adjust your network settings on your Machina Gate
- log in on the Machina Gate
connect your Machina Gate to your company network switch on the first ethernet interface
check your network settings
ifconfig
- the IP address of the first ethernet interface of the Machina Gate must be in a different network as the second ethernet interface
The IP- address of the 2nd interface could be e.g. 172.16.xxx.xxx
you can change the settings in
sudo nano /etc/network/interfaces
Set your S7 LAN- adapter correctly
Connect your S7-LAN-adapter to your computer and check that the S7-LAN- adapter are in the same network and subnetmask as the second interface of the Machina Gate
please follow the instruction on the top of this documentation
- connect the S7- LAN- adapter to the second interface of Machina Gate
now you can check the connection from Machina Gate to S7- LAN- adapter
ping <IP-ADDRESS OF S7- LAN- ADPATER>
after that you should have a solid connection between your Machina Gate and your S7-LAN-adapter
- connect your S7- LAN- adapter with your PLC over the MPI interface
get a TSAP list
log in on azeti.cloud.net
- go to → Management → PLC Setup → Init PLC
fill the IP adress of the S7-LAN-adapter, also if your PLC has an own IP- address
- get a TSAP list (if there is an error, look at the bottom "Troubeshooting")
- if you have a SIEMENS S7-300 or a S7-400 you can NOT get symbols by click on "GET Symbols" → "Request Symbols for Unselected" !
- if you have a SIEMENS S7-300 or a S7-400 you have to create a .symbol file by Tani "Symbolimport S7"
- load your .symbol file up to the cloud by click on "SET Symbols", after that you can click on "GET Symbols" → "Request Symbols for Unselected"
Scenario 2: Get TSAP from the PLC which is connected to a network switch
connect your computer to your company network
adjust your network settings on your Machina Gate
- log in on the Machina Gate
connect your Machina Gate to your company network switch on the first ethernet interface
check your network settings
ifconfig
you can change the settings in
sudo nano /etc/network/interfaces
Set your S7 LAN- adapter correctly
Connect your S7-LAN-adapter to your computer and check that the S7-LAN- adapter are in the same network and subnetmask as the first interface of the Machina Gate
please follow the instruction on the top of this documentation
- connect the S7- LAN- adapter to your company network
now you can check the connection from Machina Gate to S7- LAN- adapter
ping <IP-ADDRESS OF S7- LAN- ADPATER>
after that you should have a solid connection between your Machina Gate and your S7-LAN-adapter
- connect your S7- LAN- adapter with your PLC over the MPI interface
get a TSAP list
log in on azeti.cloud.net
- go to → Management → PLC Setup → Init PLC
fill the IP adress of the S7-LAN-adapter, also if your PLC has an own IP- address
- get a TSAP list (if there is an error, look at the bottom "Troubeshooting")
- if you have a SIEMENS S7-300 or a S7-400 you can NOT get symbols by click on "GET Symbols" → "Request Symbols for Unselected" !
- if you have a SIEMENS S7-300 or a S7-400 you have to create a .symbol file by Tani "Symbolimport S7"
- load your .symbol file up to the cloud by click on "SET Symbols", after that you can click on "GET Symbols" → "Request Symbols for Unselected"
Troubleshooting if an connection error occurs
check the settings of the S7- LAN- Adapter
- is “mode” DP or MPI? On SIEMENS S7 connections you should have a MPI connection!
- is "Enable DHCP" deactivated?
- are you using the correct IP address? The IP address may only be assigned once in your network
- is the subnetmask (scenario 1) the same as the 2nd ethernet of Machina Gate or (scenario 2) the same as your company?
is “Always in the bus” activated?
are you using the correct Baudrate? Compare with your SIEMENS settings in TIA Portal!
is the highest station address correct? Compare with your SIEMENS settings in TIA Portal!
- "PG/PC is the only master" must be disabled
check the settings of the Machina Gate
log in to your Machina Gate
ifconfig
- check the subnetmask and the IP address of the interfaces
check if you have a connection to the S7- LAN- adapter
ping <IP-ADDRESS OF S7- LAN- ADPATER>
check if you have a connection to the cloud
sudo /opt/azeti/SiteController/run_SiteController.py status
if not, look at your configuration file:
sudo nano /opt/azeti/SiteController/config/SiteController.cfg
restart the SiteController
sudo nano /opt/azeti/SiteController/run_SiteController.py restart
check the follow settings
host=broker.azeti.net port=8883 user_id password organization name tls_enable=True tls_version=PROTOCOL_TLSv1_2
check the DeviceConfig.ini
sudo nano /etc/Tani/DeviceConfig.ini
- there should be 2 default entries:
Check the follow parameter
IsActivated=Yes
- there should be a third entry with your connection which you set on the cloud
- if there are more entries of other connections, you can delete these connections
- there should be 2 default entries:
Check your SIEMENS settings to compare with the S7- LAN- adapter
in my test case it has no influence if the S7- Basic communication =0 or =1, the default value is ‘0', try it and check a '1’
this parameter indicates with how many participants the PLC has to communicate
- check the "Transmission speed" / Baudrate
- check the "Highest address"