Having worked in the industrial control industry for over a decade, today I will guide you step-by-step on how to use the IoT gateway to achieve PLC remote monitoring, eliminating the need to hire someone to debug the equipment on-site!
1. Hardware Connection
Core Devices: PLC (taking Siemens S7-1200 as an example), 4G IoT gateway (recommended model: USR-G781), 12V power adapter
Wiring Points:
- 1. Connect the gateway’s RS485 terminal A+ to pin 3 of the PLC, and B- to pin 8 (note that reversing the wiring will cause communication failure)
- 2. Connect the gateway’s ANT interface to the 4G antenna, and insert the IoT SIM card into the SIM card slot (regular mobile phone cards may be restricted by the carrier)
- 3. DI Indicator: PWR is always on, NET blinks to indicate successful network connection
Pitfall Record: Last year, when upgrading a flour mill, I installed the gateway inside a metal distribution cabinet, which caused signal attenuation. Later, switching to an external antenna resolved the issue.
2. Three Steps to Configure the Gateway
- 1. Connect your computer to the gateway’s WiFi (default password: 12345678)
- 2. Enter 192.168.1.1 in your browser to access the configuration page
- 3. Key parameter settings:
- • Communication Protocol: Modbus TCP (common for most PLCs)
- • Data Reporting Interval: Default is 5 seconds, can be adjusted to 30 seconds for data-sensitive projects
- • Heartbeat Packet Settings: 60 seconds to prevent disconnection by the carrier
Smart Operation: Add the formula <span>@DATA*0.1</span>
in the “Edge Computing” section to directly convert PLC integer data into floating-point numbers.
3. Practical Access to Cloud Platform
Taking Alibaba Cloud IoT platform as an example:
- 1. Create a product → Add a product model (corresponding to PLC’s DI/DO/AI points)
- 2. Copy the device triple (ProductKey, DeviceName, DeviceSecret)
- 3. Fill in the MQTT connection parameters in the gateway (new users are advised to use the connection script provided by Alibaba Cloud directly)
Pitfall Guide: Once, while setting up monitoring for a pig farm, I forgot to enable the “Device Shadow” feature on the cloud platform, resulting in data loss during network outages, which led to complaints from the client.
4. Mobile Monitoring Made Easy
- 1. Download the Alibaba Cloud IoT App
- 2. Scan the code to bind the device
- 3. Customize the monitoring panel:
- • Use indicator components for switch quantities
- • Use curve chart components for temperature
- • Alarm settings for push notifications
Cool Trick: Use IFTTT to forward alarm information to WeChat, so you can receive timely alerts even at night in case of equipment failures.
Common Fault Troubleshooting Table
Phenomenon | Check Points | Recommended Tools |
Data not uploading | SIM card data/Signal strength | AT command to check CSQ value |
Communication timeout | Check if PLC station number matches the gateway | Modbus Poll debugging software |
Data fluctuation | Poor grounding causing interference | Multimeter to measure voltage to ground |
Safety Precautions (Lessons Learned!)
- 1. Be sure to change the default password of the gateway
- 2. Set PLC program to write protection
- 3. Enable IP whitelist on the cloud platform
- 4. Regularly check for firmware version updates
Practical Suggestions:
- 1. Test using a local network first (turn off the gateway’s 4G and connect via Ethernet to the router)
- 2. Start debugging from a single data point
- 3. Record the content of each parameter modification
- 4. Prepare a backup communication plan (e.g., SMS alerts)
If you want to learn how to control smart sockets through the gateway with PLC next time, let me know in the comments!