iot,tcp server,支持tcp透传modbus tcp/modbus rtu,支持mqtt透传modbus tcp/modbus rtu,支持定时轮询,支持多种协议共存,支持查看modbus rtu命令
parent
d94b5f3851
commit
7c739fd746
|
|
@ -213,7 +213,13 @@ export const ThingModelApi = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算 Modbus 命令(用于前端自动生成)
|
// 计算 Modbus 命令(用于前端自动生成)
|
||||||
calculateModbusCommand: async (data: { productId: number; registerAddress: number; functionCode?: number }) => {
|
calculateModbusCommand: async (data: {
|
||||||
|
productId: number;
|
||||||
|
registerAddress: number;
|
||||||
|
functionCode?: number;
|
||||||
|
registerCount?: number;
|
||||||
|
byteOrder?: number;
|
||||||
|
}) => {
|
||||||
return await request.post({ url: `/iot/thing-model/calculate-modbus-command`, data })
|
return await request.post({ url: `/iot/thing-model/calculate-modbus-command`, data })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,9 @@ const handleRegisterAddressChange = async (registerAddress: number | undefined)
|
||||||
const { data } = await ThingModelApi.calculateModbusCommand({
|
const { data } = await ThingModelApi.calculateModbusCommand({
|
||||||
productId: product.value.id,
|
productId: product.value.id,
|
||||||
registerAddress: registerAddress,
|
registerAddress: registerAddress,
|
||||||
functionCode: property.value.modbusConfig?.functionCode || 3
|
functionCode: property.value.modbusConfig?.functionCode || 3,
|
||||||
|
registerCount: property.value.modbusConfig?.registerCount || 1,
|
||||||
|
byteOrder: property.value.modbusConfig?.byteOrder || 2 // 默认小端模式
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新表单数据
|
// 更新表单数据
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue