# Siemens-1200-PLC-and-STM32-microcontroller-connected-using-Modbus-TCP **Repository Path**: chfpc1314/Siemens-1200-PLC-and-STM32-microcontroller-connected-using-Modbus-TCP ## Basic Information - **Project Name**: Siemens-1200-PLC-and-STM32-microcontroller-connected-using-Modbus-TCP - **Description**: 西门子1200plc和stm32使用modbus TCP 通过交换机连接实现通讯 - **Primary Language**: C - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-08 - **Last Updated**: 2025-12-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Siemens-1200-PLC-and-STM32-microcontroller-connected-using-Modbus-TCP 西门子1200plc和stm32使用modbus TCP 通过交换机连接实现通讯 作者:宋楠 职位:嵌入式工程师 未经允许禁止转载 本项目仅供个人学习研究和数据备份使用。严禁用于任何商业用途和 非法用途。 西门子1200plc与stm32f103c86实现modbus TCP通讯,目前现在实测通讯无问题。后续还会编写其他的功能代码,敬请期待。 stm32代码使用的是W5100官方的例程改造的,有自己写入的部分,其他的库文件使用的是官方的例程。 32程序编写采用的是标准库,后期如果有需要的话,也许会移植成hal库。plc程序采用TIA Portal V16版本,请使用16以及更高版本打开,谢谢 有更多需要的话,有可能也会写python代码来用于树莓派和plc通讯,或者是编写用于esp8266/32的arduino代码。 感觉代码对你有用的话,可以点个赞。 2025.12.8:更新关于树莓派5B和1200plc使用TCP通讯的代码。都是基础代码,需要更改请自行处理。 Author: Song Nan Position: Embedded Engineer Unauthorized reproduction prohibited. This project is for personal study, research, and data backup only. Commercial and illegal use is strictly prohibited. This project implements Modbus TCP communication between a Siemens 1200 PLC and an STM32F103C86. Currently, communication is working without issues. Further functional code will be written later, so please stay tuned. The STM32 code is a modified version of the official W5100 example, with some custom components. Other library files use the official example. The STM32 program uses the standard library. If needed later, it may be ported to the HAL library. The PLC program uses TIA Portal V16. Please use version 16 or higher to open it. Thank you. If further needs arise, Python code may be written for communication between Raspberry Pi and PLC, or Arduino code may be written for ESP8266/32. If you find the code helpful, please give it a like. December 8, 2025: Updated code regarding TCP communication between Raspberry Pi 5B and 1200 PLC. This is basic code; please modify it yourself if necessary.