|
@@ -83,6 +83,9 @@ public class ModbusTcpWeigherClient {
|
|
|
* @return
|
|
|
*/
|
|
|
public int readWeighing() {
|
|
|
+ if (modbusTcpMasterTemplateFirst == null || modbusTcpMasterTemplateFirst.getModbusMasterUtil() == null) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFirst.getModbusMasterUtil();
|
|
|
return modbusMasterUtil.readHoldingRegister(1, 3, DATA_TYPE_WRAPPER.TWO_BYTE_INT_UNSIGNED).intValue();
|
|
|
}
|