|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
@ -461,6 +462,16 @@ public class S7MultiPlcService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
S7MultiPlcService s7MultiPlcService = new S7MultiPlcService();
|
|
|
|
|
|
|
|
s7MultiPlcService.readPlcConfig();
|
|
|
|
|
|
|
|
s7MultiPlcService.initConnectionPools();
|
|
|
|
|
|
|
|
s7MultiPlcService.initExecutorService();
|
|
|
|
|
|
|
|
// log.info("S7多PLC服务初始化完成,共配置 {} 个PLC", plcConfigs.size());
|
|
|
|
|
|
|
|
s7MultiPlcService.scheduledReadAllPlc();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 清理无效连接(定时任务)
|
|
|
|
* 清理无效连接(定时任务)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|