Commit 2c991249d70100686dc3b0fd1ad24b9d05eb46e9
Merge branch 'fix/modbus-command-send' into 'main_dev'
fix: 修复modbus命令下发输入0时报错 See merge request yunteng/thingskit-scada!103
Showing
1 changed file
with
4 additions
and
2 deletions
| ... | ... | @@ -16248,8 +16248,8 @@ class HandleDataInteraction { |
| 16248 | 16248 | ]) |
| 16249 | 16249 | |
| 16250 | 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 | 16255 | if (validate.begin()) flag = true |
| ... | ... | @@ -16319,6 +16319,8 @@ class HandleDataInteraction { |
| 16319 | 16319 | registerValues: Array.isArray(registerValue) ? registerValue.map(item => Number(item)) : [Number(registerValue)] |
| 16320 | 16320 | } |
| 16321 | 16321 | |
| 16322 | + console.log(params) | |
| 16323 | + | |
| 16322 | 16324 | const command = await ConfigurationNodeApi.getModbusCommand(params) |
| 16323 | 16325 | |
| 16324 | 16326 | return command | ... | ... |