ZengTao
2024-04-01 eccfd8d0504c48f07c7e11ed1fc94451ce5e7cb1
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java
@@ -1,4 +1,7 @@
package com.example.springboot.entity.device;
import com.example.springboot.component.S7control;
public  class PlcParameterInfo {
      public PlcParameterInfo(String startAddress) {
        this.startAddress = startAddress;
@@ -91,6 +94,7 @@
        public void setRatio(int ratio) {
            this.ratio = ratio;
        }
           /**
     * 获取地址
@@ -111,8 +115,8 @@
        }
        if (addressLength == 14 ) {
            int wordindex = index;
            int newIndex = wordindex + 13;
            return stringdatas[0] + "." + wordindex +"-" + newIndex;
            //int newIndex = wordindex + 13;
            return stringdatas[0] + "." + wordindex ;
        }
        return null;
    }
@@ -121,4 +125,10 @@
        return addressIndex;
    }
    public String getValueString() {
        return S7control.getinstance().readStrings(getAddress());
    }
    public String getAddress() {
       return getAddress(this.addressIndex);
    }
}