| | |
| | | //A01 |
| | | List<String> A01input = Arrays.asList(config.getProperty("PlcA01.param").split(",")); |
| | | List<Float> listA01param = S7control.getinstance().readFloat32(A01input); |
| | | |
| | | List<String> A01button = Arrays.asList(config.getProperty("PlcA01.button").split(",")); |
| | | List<Boolean> listA01button = S7control.getinstance().readBits(A01button); |
| | | for (Boolean boolean1 : listA01button) { |
| | |
| | | } |
| | | jsonObject.append("listC02param", listC02param); |
| | | |
| | | //中空台 |
| | | List<String> Hollowinput = Arrays.asList(config.getProperty("PlcHollow.param").split(",")); |
| | | //系统 |
| | | List<String> PlcSysinput = Arrays.asList(config.getProperty("PlcSys.param").split(",")); |
| | | List<Float> listPlcSysparam = S7control.getinstance().readFloat32(PlcSysinput); |
| | | |
| | | List<String> PlcSysbutton = Arrays.asList(config.getProperty("PlcSys.button").split(",")); |
| | | List<Boolean> listPlcSysbutton = S7control.getinstance().readBits(PlcSysbutton); |
| | | for (Boolean boolean1 : listPlcSysbutton) { |
| | | listPlcSysparam.add((float) (boolean1 ? 1 : 0)); |
| | | } |
| | | jsonObject.append("listPlcSysparam", listPlcSysparam); |
| | | |
| | | //计数 |
| | | List<String> PlcCountinput = Arrays.asList(config.getProperty("PlcCount.param").split(",")); |
| | | List<Float> listPlcCountparam = S7control.getinstance().readFloat32(PlcCountinput); |
| | | |
| | | List<String> PlcCountbutton = Arrays.asList(config.getProperty("PlcCount.button").split(",")); |
| | | List<Boolean> listPlcCountbutton = S7control.getinstance().readBits(PlcCountbutton); |
| | | for (Boolean boolean1 : listPlcCountbutton) { |
| | | listPlcCountparam.add((float) (boolean1 ? 1 : 0)); |
| | | } |
| | | jsonObject.append("listPlcCountparam", listPlcCountparam); |
| | | |
| | | //延时 |
| | | List<String> PlcTimerinput = Arrays.asList(config.getProperty("PlcTimer.param").split(",")); |
| | | List<Long> listPlcTimerparam = S7control.getinstance().readtimes(PlcTimerinput); |
| | | jsonObject.append("listPlcTimerparam", listPlcTimerparam); |
| | | |
| | | //笼子 |
| | | List<String> Hollowinput = Arrays.asList(config.getProperty("PlcCage.param").split(",")); |
| | | List<Float> listHollowparam = S7control.getinstance().readFloat32(Hollowinput); |
| | | List<String> Hollowbutton = Arrays.asList(config.getProperty("PlcHollow.button").split(",")); |
| | | List<String> Hollowbutton = Arrays.asList(config.getProperty("PlcCage.button").split(",")); |
| | | List<Boolean> listHollowbutton = S7control.getinstance().readBits(Hollowbutton); |
| | | for (Boolean boolean1 : listHollowbutton) { |
| | | listHollowparam.add((float) (boolean1 ? 1 : 0)); |
| | | } |
| | | jsonObject.append("listHollowparam", listHollowparam); |
| | | |
| | | //当前位置 |
| | | List<String> positioninput = Arrays.asList(config.getProperty("Plc.position").split(",")); |
| | | List<Float> listpositionparam = S7control.getinstance().readFloat32(positioninput); |
| | | jsonObject.append("listpositionparam", listpositionparam); |
| | | |
| | | |
| | | |
| | | // System.out.println(listpositionparam); |
| | | |
| | | // System.out.println(S7control.getinstance().readFloat32("DB10.1758")); |