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,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
}
]
}
]
}