123456789101112131415161718192021222324252627282930313233 |
- package com.warewms.hailiang.contoller;
- import com.warewms.hailiang.init.PlcConnectServiceRunner;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * Created with IntelliJ IDEA.
- *
- * @author: liuzhifei
- * Date: 2023/8/7
- * Time: 16:41
- * To change this template use File | Settings | File Templates.
- * Description:
- **/
- @RestController
- @RequestMapping("/test")
- public class TestContoller {
- @Autowired
- PlcConnectServiceRunner plcConnectServiceRunner;
- @GetMapping("/pclTest")
- public Object testPlc(String plcName,String db,String type){
- db = "V"+db;
- if (type.equals("1")){
- return plcConnectServiceRunner.getPlcServer(plcName).readBoolean(db);
- }
- return null;
- }
- }
|