package com.mes.config; import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; import com.github.xingshuangs.iot.protocol.s7.service.S7PLC; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @Author : zhoush * @Date: 2025/4/30 13:50 * @Description: */ @Configuration public class S7Config { @Bean(name = "s7SerializerWLOne") public S7Serializer s7SerializerWLOne() { S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.100"); // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); return S7Serializer.newInstance(s7PLC); } @Bean(name = "s7SerializerWLTwo") public S7Serializer s7SerializerWLTwo() { S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.130"); // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); return S7Serializer.newInstance(s7PLC); } @Bean(name = "s7SerializerMBOne") public S7Serializer s7SerializerMBOne() { S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.58"); // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); return S7Serializer.newInstance(s7PLC); } @Bean(name = "s7SerializerMBTwo") public S7Serializer s7SerializerMBTwo() { S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.18"); // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); return S7Serializer.newInstance(s7PLC); } @Bean(name = "s7SerializerMBExtra") public S7Serializer s7SerializerMBExtra() { S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.100"); return S7Serializer.newInstance(s7PLC); } }