phase 2 tcp

This commit is contained in:
flower_linux
2026-06-12 21:23:21 +08:00
parent 628ccf1409
commit ebff25e0d5
75 changed files with 3014 additions and 289 deletions

View File

@@ -5,15 +5,34 @@
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_s1_r40001",
"logicalPointId": "EdgeDevice_01/MotorTemperature",
"scale": 0.1,
"enabled": false
"enabled": true
},
{
"bindingId": "bind_speed_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_s1_r40002",
"logicalPointId": "EdgeDevice_01/MotorSpeed",
"enabled": true
},
{
"bindingId": "bind_current_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_tcp_s255_r40001",
"logicalPointId": "EdgeDevice_01/MotorCurrent",
"enabled": true
},
{
"bindingId": "bind_voltage_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_tcp_s255_r40002",
"logicalPointId": "EdgeDevice_01/MotorVoltage",
"enabled": true
},
{
"bindingId": "bind_valve_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_s1_r40002",
"logicalPointId": "EdgeDevice_01/ValveOpening",
"scale": 1.0,
"enabled": true
}
]

View File

@@ -18,6 +18,39 @@
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorTemperature",
"dataTopic": "data/EdgeDevice_01/MotorTemperature"
},
{
"logicalPointId": "MotorSpeed",
"displayName": "电机转速",
"signalType": "AI",
"unit": "rpm",
"range": [0, 1000],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorSpeed",
"dataTopic": "data/EdgeDevice_01/MotorSpeed"
},
{
"logicalPointId": "MotorCurrent",
"displayName": "电机电流",
"signalType": "AI",
"unit": "A",
"range": [0, 100],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorCurrent",
"dataTopic": "data/EdgeDevice_01/MotorCurrent"
},
{
"logicalPointId": "MotorVoltage",
"displayName": "电机电压",
"signalType": "AI",
"unit": "V",
"range": [0, 100],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorVoltage",
"dataTopic": "data/EdgeDevice_01/MotorVoltage"
},
{
"logicalPointId": "ValveOpening",
"displayName": "阀门开度",

View File

@@ -23,6 +23,51 @@
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorTemperature",
"dataTopic": "data/EdgeDevice_01/MotorTemperature"
},
{
"pointId": "MotorSpeed",
"name": "MotorSpeed",
"displayName": "电机转速",
"signalType": "AI",
"physicalChannel": "AI_Channel_02",
"register": 40002,
"unit": "rpm",
"scale": 1.0,
"range": [0, 1000],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorSpeed",
"dataTopic": "data/EdgeDevice_01/MotorSpeed"
},
{
"pointId": "MotorCurrent",
"name": "MotorCurrent",
"displayName": "电机电流",
"signalType": "AI",
"physicalChannel": "AI_Channel_03",
"register": 40001,
"unit": "A",
"scale": 0.1,
"range": [0, 100],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorCurrent",
"dataTopic": "data/EdgeDevice_01/MotorCurrent"
},
{
"pointId": "MotorVoltage",
"name": "MotorVoltage",
"displayName": "电机电压",
"signalType": "AI",
"physicalChannel": "AI_Channel_04",
"register": 40002,
"unit": "V",
"scale": 1.0,
"range": [0, 100],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorVoltage",
"dataTopic": "data/EdgeDevice_01/MotorVoltage"
},
{
"pointId": "ValveOpening",
"name": "ValveOpening",

View File

@@ -13,15 +13,47 @@ devices:
physicalChannel: AI_Channel_01
register: 40001
unit: "℃"
scale: 0.1
range: [0, 200]
access: read
dataTopic: data/EdgeDevice_01/MotorTemperature
- pointId: MotorSpeed
displayName: 电机转速
signalType: AI
physicalChannel: AI_Channel_02
register: 40002
unit: rpm
scale: 1.0
range: [0, 1000]
access: read
dataTopic: data/EdgeDevice_01/MotorSpeed
- pointId: MotorCurrent
displayName: 电机电流
signalType: AI
physicalChannel: AI_Channel_03
register: 40001
unit: A
scale: 0.1
range: [0, 100]
access: read
dataTopic: data/EdgeDevice_01/MotorCurrent
- pointId: MotorVoltage
displayName: 电机电压
signalType: AI
physicalChannel: AI_Channel_04
register: 40002
unit: V
scale: 1.0
range: [0, 100]
access: read
dataTopic: data/EdgeDevice_01/MotorVoltage
- pointId: ValveOpening
displayName: 阀门开度
signalType: AO
physicalChannel: AO_Channel_01
register: 40002
unit: "%"
scale: 1.0
range: [0, 100]
access: read_write
cmdTopic: control/cmd/EdgeDevice_01/ValveOpening/set

View File

@@ -5,7 +5,25 @@
"bindingId": "bind_temp_01",
"physicalPointId": "edge01/phy_modbus_s1_r40001",
"logicalPointId": "EdgeDevice_01/MotorTemperature",
"enabled": false
"enabled": true
},
{
"bindingId": "bind_speed_01",
"physicalPointId": "edge01/phy_modbus_s1_r40002",
"logicalPointId": "EdgeDevice_01/MotorSpeed",
"enabled": true
},
{
"bindingId": "bind_current_01",
"physicalPointId": "edge01/phy_modbus_tcp_s255_r40001",
"logicalPointId": "EdgeDevice_01/MotorCurrent",
"enabled": true
},
{
"bindingId": "bind_voltage_01",
"physicalPointId": "edge01/phy_modbus_tcp_s255_r40002",
"logicalPointId": "EdgeDevice_01/MotorVoltage",
"enabled": true
},
{
"bindingId": "bind_valve_01",

View File

@@ -10,6 +10,22 @@
"dataBits": 8,
"stopBits": 1,
"pollIntervalMs": 500
},
{
"channelId": "eth_modbus_tcp_0",
"protocol": "modbus",
"transport": "tcp_rtu",
"host": "192.168.31.253",
"tcpPort": 502,
"pollIntervalMs": 500
},
{
"channelId": "can_0",
"protocol": "canopen",
"transport": "can",
"interface": "can0",
"bitrate": 500000,
"pollIntervalMs": 200
}
]
}

View File

@@ -24,6 +24,65 @@
"writable": true
}
]
},
{
"physicalDeviceId": "phy_modbus_tcp_slave_255",
"channelId": "eth_modbus_tcp_0",
"protocol": "modbus",
"slaveId": 255,
"points": [
{
"physicalPointId": "phy_modbus_tcp_s255_r40001",
"register": 40001,
"function": 3,
"scale": 0.1,
"signalType": "AI",
"writable": false,
"pollIntervalMs": 500
},
{
"physicalPointId": "phy_modbus_tcp_s255_r40002",
"register": 40002,
"function": 3,
"writeFunction": 6,
"scale": 1.0,
"signalType": "AO",
"writable": true,
"pollIntervalMs": 500
}
]
},
{
"physicalDeviceId": "phy_canopen_node_1",
"channelId": "can_0",
"protocol": "canopen",
"nodeId": 1,
"edsPath": "samples/minimal.eds",
"points": [
{
"physicalPointId": "phy_can_s1_temp",
"objectIndex": 25600,
"subIndex": 1,
"pdoType": "tpdo",
"cobId": 385,
"scale": 0.1,
"signalType": "AI",
"writable": false,
"reportOnChange": true,
"deadband": 0.5,
"pollIntervalMs": 500
},
{
"physicalPointId": "phy_can_s1_setpoint",
"objectIndex": 25601,
"subIndex": 1,
"pdoType": "sdo",
"scale": 1.0,
"signalType": "AO",
"writable": true,
"pollIntervalMs": 1000
}
]
}
]
}

View File

@@ -0,0 +1,47 @@
[DeviceInfo]
VendorName=Softbus
ProductName=DemoCANopenNode
[1000]
ParameterName=Device type
DataType=0x0007
AccessType=ro
DefaultValue=0x00000191
[1001]
ParameterName=Error register
DataType=0x0005
AccessType=ro
DefaultValue=0x00
[1800]
ParameterName=TPDO communication parameter
ObjectType=0x09
[1800sub1]
ParameterName=COB-ID used by TPDO
DataType=0x0007
AccessType=rw
DefaultValue=0x00000180
[1800sub2]
ParameterName=Transmission type
DataType=0x0005
AccessType=rw
DefaultValue=0xFF
[1A00]
ParameterName=TPDO mapping parameter
ObjectType=0x09
[1A00sub1]
ParameterName=1st mapped object
DataType=0x0007
AccessType=rw
DefaultValue=0x64000110
[6400]
ParameterName=Temperature
DataType=0x0006
AccessType=ro
DefaultValue=0x00

View File

@@ -0,0 +1,12 @@
{
"channels": [
{
"channelId": "can_0",
"protocol": "canopen",
"transport": "can",
"interface": "can0",
"bitrate": 500000,
"pollIntervalMs": 200
}
]
}

View File

@@ -0,0 +1,36 @@
{
"devices": [
{
"physicalDeviceId": "phy_canopen_node_1",
"channelId": "can_0",
"protocol": "canopen",
"nodeId": 1,
"edsPath": "samples/minimal.eds",
"points": [
{
"physicalPointId": "phy_can_s1_temp",
"objectIndex": 25600,
"subIndex": 1,
"pdoType": "tpdo",
"cobId": 385,
"scale": 0.1,
"signalType": "AI",
"writable": false,
"reportOnChange": true,
"deadband": 0.5,
"pollIntervalMs": 500
},
{
"physicalPointId": "phy_can_s1_setpoint",
"objectIndex": 25601,
"subIndex": 1,
"pdoType": "sdo",
"scale": 1.0,
"signalType": "AO",
"writable": true,
"pollIntervalMs": 1000
}
]
}
]
}