Commit 1f35a902e4fa639c032b870aa43ad3b1117c9ec7

Authored by ww
1 parent c0db9d33

fix: 修复modbus命令下发输入0时报错

@@ -16248,8 +16248,8 @@ class HandleDataInteraction { @@ -16248,8 +16248,8 @@ class HandleDataInteraction {
16248 ]) 16248 ])
16249 16249
16250 if (method == '16') { 16250 if (method == '16') {
16251 - const hexValue = UseLayUi.numberToHex(value).split(' ')  
16252 - value = [parseInt(hexValue.slice(0, 2).join(''), 16), parseInt(hexValue.slice(2, 4).join(''), 16)] 16251 + const hexValue = UseLayUi.numberToHex(value).split(' ').join('')
  16252 + value = [parseInt(hexValue.slice(0, 4), 16), parseInt(hexValue.slice(4, 8), 16)]
16253 } 16253 }
16254 16254
16255 if (validate.begin()) flag = true 16255 if (validate.begin()) flag = true
@@ -16319,6 +16319,8 @@ class HandleDataInteraction { @@ -16319,6 +16319,8 @@ class HandleDataInteraction {
16319 registerValues: Array.isArray(registerValue) ? registerValue.map(item => Number(item)) : [Number(registerValue)] 16319 registerValues: Array.isArray(registerValue) ? registerValue.map(item => Number(item)) : [Number(registerValue)]
16320 } 16320 }
16321 16321
  16322 + console.log(params)
  16323 +
16322 const command = await ConfigurationNodeApi.getModbusCommand(params) 16324 const command = await ConfigurationNodeApi.getModbusCommand(params)
16323 16325
16324 return command 16326 return command