| | |
| | | package com.example.springboot.entity.device; |
| | | |
| | | import com.example.springboot.component.S7control; |
| | | |
| | | public class PlcParameterInfo { |
| | | public PlcParameterInfo(String startAddress) { |
| | | this.startAddress = startAddress; |
| | |
| | | |
| | | // 参数名称 |
| | | private String name; |
| | | |
| | | // 英文名称 |
| | | private String usname; |
| | | |
| | | // 读取 参数值 |
| | | private String value; |
| | |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getusName() { |
| | | return this.usname; |
| | | } |
| | | |
| | | public void setusName(String usname) { |
| | | this.usname = usname; |
| | | } |
| | | |
| | | public String getValue() { |
| | |
| | | } |
| | | 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; |
| | | } |
| | |
| | | |
| | | return addressIndex; |
| | | } |
| | | public String getValueString() { |
| | | return S7control.getinstance().readStrings(getAddress()); |
| | | } |
| | | public String getAddress() { |
| | | return getAddress(this.addressIndex); |
| | | } |