DeviceInformation.cin
Moved device information into structure PollingModbusClient.can Use device structure ModbusClient.cin Use device structure and enum ModbusFuncCode ModbusEil.cin ModbusTcp.cin Fixes
This commit is contained in:
parent
7b08b19840
commit
decc7357e7
8 changed files with 377 additions and 293 deletions
|
@ -1,4 +1,4 @@
|
||||||
;CANoe Version |4|7|1|55221 ModbusNet
|
;CANoe Version |4|7|1|38817 ModbusNet
|
||||||
Version: 8.2.40 Build 40
|
Version: 8.2.40 Build 40
|
||||||
32 PRO
|
32 PRO
|
||||||
10
|
10
|
||||||
|
@ -746,9 +746,9 @@ Begin_Of_Multi_Line_String
|
||||||
kPersistNoLineBreak
|
kPersistNoLineBreak
|
||||||
ey="{28077F35-C142-4ACC-B040-1BF0AB026C11}" Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" DockedSize="201, 281" FloatingLocation="111, 442" FloatingSize="1192, 514" HasOptions="False" ImageIndex="-1" Text="Trace" TitleBarText="Trace"><AutoHideStateInfo RootDock="Bottom" /><DockedInsideHostStateInfo RootDock="Bottom" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></ToolWindowContainer><ToolWindowContainer Dock="Top" Size="1192, 227" SelectedToolWindowGuid="7f29b491-3ada-4572-b140-b422651d6fed"><ToolWindow Key="{8F3DFCAC-9CCB-45C2-AF10-5DEC039B5956}" Guid="7f29b491-3ada-4572-b140-b422651d6fed" DockedSize="201, 223" FloatingLocation="6, 433" FloatingSize="300, 180" HasOptions="False" ImageIndex="-1" Text="Write" TitleBarText="Write"><AutoHideStateInfo RootDock="Top" /><DockedInsideHostStateInfo RootDock="Top" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></ToolWindowContainer></HostContainerControl><AutoHide Dock="Lef
|
ey="{28077F35-C142-4ACC-B040-1BF0AB026C11}" Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" DockedSize="201, 281" FloatingLocation="111, 442" FloatingSize="1192, 514" HasOptions="False" ImageIndex="-1" Text="Trace" TitleBarText="Trace"><AutoHideStateInfo RootDock="Bottom" /><DockedInsideHostStateInfo RootDock="Bottom" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></ToolWindowContainer><ToolWindowContainer Dock="Top" Size="1192, 227" SelectedToolWindowGuid="7f29b491-3ada-4572-b140-b422651d6fed"><ToolWindow Key="{8F3DFCAC-9CCB-45C2-AF10-5DEC039B5956}" Guid="7f29b491-3ada-4572-b140-b422651d6fed" DockedSize="201, 223" FloatingLocation="6, 433" FloatingSize="300, 180" HasOptions="False" ImageIndex="-1" Text="Write" TitleBarText="Write"><AutoHideStateInfo RootDock="Top" /><DockedInsideHostStateInfo RootDock="Top" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></ToolWindowContainer></HostContainerControl><AutoHide Dock="Lef
|
||||||
kPersistNoLineBreak
|
kPersistNoLineBreak
|
||||||
t" /><AutoHide Dock="Right" /><AutoHide Dock="Top" /><AutoHide Dock="Bottom" /><TabbedDocuments Orientation="Horizontal" /><FloatingContainers /><Hidden><ToolWindow Key="{49714911-9568-49CC-A9CE-3B0905658C4A}" Guid="db27ffca-d17e-40f0-a70b-be70fe5eb4ec" State="DockableInsideHost" DockedSize="381, 0" FloatingLocation="1151, 79" FloatingSize="300, 180"><AutoHideStateInfo RootDock="Right" /><DockedInsideHostStateInfo RootDock="Right" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow><ToolWindow Key="{F5E09530-AAE7-48d9-B925-CEF5027AA97D}" Guid="b2726676-2b89-4fee-b1a3-2be7bfbdec73" State="DockableOutsideHost" DockedSize="176, 228" FloatingLocation="518, 238" FloatingSize="325, 380"><AutoHideStateInfo RootDock="Left" /><DockedInsideHostStateInfo RootDock="Left" IsAttached="False"><DockedBy Guid="87323901-fe96-4011-a82f-0e1b8627507a" RootDock="Left" DockOperationType="RightOuter" IsTopMost="True" /><DockedBy Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" RootD
|
t" /><AutoHide Dock="Right" /><AutoHide Dock="Top" /><AutoHide Dock="Bottom" /><TabbedDocuments Orientation="Horizontal" /><FloatingContainers /><Hidden><ToolWindow Key="{224229E5-10CA-425F-8B6F-C213CD04C44F}" Guid="859d3aae-7aff-47f2-8ca4-bb7d01f32282" State="DockableInsideHost" DockedSize="424, 358" FloatingLocation="347, 323" FloatingSize="890, 483"><AutoHideStateInfo RootDock="Right" /><DockedInsideHostStateInfo RootDock="Right" IsAttached="False"><DockedBy Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" RootDock="Bottom" DockOperationType="TopOuter" IsTopMost="True" /><DockedBy Guid="7f29b491-3ada-4572-b140-b422651d6fed" RootDock="Top" DockOperationType="BottomOuter" IsTopMost="True" /></DockedInsideHostStateInfo><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow><ToolWindow Key="{49714911-9568-49CC-A9CE-3B0905658C4A}" Guid="db27ffca-d17e-40f0-a70b-be70fe5eb4ec" State="DockableInsideHost" DockedSize="381, 0" FloatingLocation="1151, 79" FloatingSize="300, 180"><AutoHideStat
|
||||||
kPersistNoLineBreak
|
kPersistNoLineBreak
|
||||||
ock="Bottom" DockOperationType="TopOuter" IsTopMost="True" /><DockedBy Guid="7f29b491-3ada-4572-b140-b422651d6fed" RootDock="Top" DockOperationType="BottomOuter" IsTopMost="True" /></DockedInsideHostStateInfo><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow><ToolWindow Key="{224229E5-10CA-425F-8B6F-C213CD04C44F}" Guid="859d3aae-7aff-47f2-8ca4-bb7d01f32282" State="DockableInsideHost" DockedSize="424, 358" FloatingLocation="347, 323" FloatingSize="890, 483"><AutoHideStateInfo RootDock="Right" /><DockedInsideHostStateInfo RootDock="Right" IsAttached="False"><DockedBy Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" RootDock="Bottom" DockOperationType="TopOuter" IsTopMost="True" /><DockedBy Guid="7f29b491-3ada-4572-b140-b422651d6fed" RootDock="Top" DockOperationType="BottomOuter" IsTopMost="True" /></DockedInsideHostStateInfo><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></Hidden></LayoutData><CustomData /></ToolWindowLayout>
|
eInfo RootDock="Right" /><DockedInsideHostStateInfo RootDock="Right" IsAttached="False" /><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow><ToolWindow Key="{F5E09530-AAE7-48d9-B925-CEF5027AA97D}" Guid="b2726676-2b89-4fee-b1a3-2be7bfbdec73" State="DockableOutsideHost" DockedSize="176, 228" FloatingLocation="518, 238" FloatingSize="325, 380"><AutoHideStateInfo RootDock="Left" /><DockedInsideHostStateInfo RootDock="Left" IsAttached="False"><DockedBy Guid="87323901-fe96-4011-a82f-0e1b8627507a" RootDock="Left" DockOperationType="RightOuter" IsTopMost="True" /><DockedBy Guid="ac9be154-bd12-4ff9-b255-03e05277dbe2" RootDock="Bottom" DockOperationType="TopOuter" IsTopMost="True" /><DockedBy Guid="7f29b491-3ada-4572-b140-b422651d6fed" RootDock="Top" DockOperationType="BottomOuter" IsTopMost="True" /></DockedInsideHostStateInfo><DockedOutsideHostStateInfo IsAttached="False" /></ToolWindow></Hidden></LayoutData><CustomData /></ToolWindowLayout>
|
||||||
End_Of_Serialized_Data 3
|
End_Of_Serialized_Data 3
|
||||||
End_Of_Object VDesktop 3
|
End_Of_Object VDesktop 3
|
||||||
VDesktop 3 Begin_Of_Object
|
VDesktop 3 Begin_Of_Object
|
||||||
|
@ -1380,7 +1380,7 @@ End_Of_Serialized_Data 15
|
||||||
End_Of_Object VSysVarObject 15
|
End_Of_Object VSysVarObject 15
|
||||||
[MeasurementObject]
|
[MeasurementObject]
|
||||||
Client_2::InputBits_[0]
|
Client_2::InputBits_[0]
|
||||||
"" 223 b86b8 0. 1. -100. 100. 1 0 0 0 36000000 1 1 0 0
|
"" 1 b86b8 0. 1. -100. 100. 0.1 0 0 0 36000000 1 1 0 0
|
||||||
VSysVarObject 15 Begin_Of_Object
|
VSysVarObject 15 Begin_Of_Object
|
||||||
1
|
1
|
||||||
VHostSignal 16 Begin_Of_Object
|
VHostSignal 16 Begin_Of_Object
|
||||||
|
@ -1414,7 +1414,7 @@ End_Of_Serialized_Data 15
|
||||||
End_Of_Object VSysVarObject 15
|
End_Of_Object VSysVarObject 15
|
||||||
[MeasurementObject]
|
[MeasurementObject]
|
||||||
Client_2::InputBits_[1]
|
Client_2::InputBits_[1]
|
||||||
"" 223 d7ff -1. 1. -100. 100. 1 0 0 0 36000000 1 1 0 0
|
"" 1 d7ff -1. 1. -100. 100. 0.2 0 0 0 36000000 1 1 0 0
|
||||||
VSysVarObject 15 Begin_Of_Object
|
VSysVarObject 15 Begin_Of_Object
|
||||||
1
|
1
|
||||||
VHostSignal 16 Begin_Of_Object
|
VHostSignal 16 Begin_Of_Object
|
||||||
|
@ -1448,7 +1448,7 @@ End_Of_Serialized_Data 15
|
||||||
End_Of_Object VSysVarObject 15
|
End_Of_Object VSysVarObject 15
|
||||||
[MeasurementObject]
|
[MeasurementObject]
|
||||||
Client_3::InputBits_[5]
|
Client_3::InputBits_[5]
|
||||||
"" 223 9314ff 0. 1. -100. 100. 1 0 0 0 36000000 1 1 0 0
|
"" 1 9314ff 0. 1. -100. 100. 0.1 0 0 0 36000000 1 1 0 0
|
||||||
VSysVarObject 15 Begin_Of_Object
|
VSysVarObject 15 Begin_Of_Object
|
||||||
1
|
1
|
||||||
VHostSignal 16 Begin_Of_Object
|
VHostSignal 16 Begin_Of_Object
|
||||||
|
@ -1482,7 +1482,7 @@ End_Of_Serialized_Data 15
|
||||||
End_Of_Object VSysVarObject 15
|
End_Of_Object VSysVarObject 15
|
||||||
[MeasurementObject]
|
[MeasurementObject]
|
||||||
Client_2::InputRegisters_[0]
|
Client_2::InputRegisters_[0]
|
||||||
"" 223 ff00 2741. 6073. -100. 100. 500 0 0 0 36000000 1 1 0 0
|
"" 1 ff00 2741. 6073. -100. 100. 500 0 0 0 36000000 1 1 0 0
|
||||||
VSysVarObject 15 Begin_Of_Object
|
VSysVarObject 15 Begin_Of_Object
|
||||||
1
|
1
|
||||||
VHostSignal 16 Begin_Of_Object
|
VHostSignal 16 Begin_Of_Object
|
||||||
|
@ -1516,9 +1516,9 @@ End_Of_Serialized_Data 15
|
||||||
End_Of_Object VSysVarObject 15
|
End_Of_Object VSysVarObject 15
|
||||||
[MeasurementObject]
|
[MeasurementObject]
|
||||||
Client_3::InputRegisters_[3]
|
Client_3::InputRegisters_[3]
|
||||||
"" 223 228b22 8971. 19903. -100. 100. 1000 0 0 0 36000000 1 1 0 0
|
"" 1 228b22 8971. 19903. -100. 100. 1000 0 0 0 36000000 1 1 0 0
|
||||||
[GraphWindow:x_x_x_x_x_x_WindowBk_Grid_AxisBk_XAxisFr_YAxisFr_x_x_x_x_x_x]
|
[GraphWindow:x_x_x_x_x_x_WindowBk_Grid_AxisBk_XAxisFr_YAxisFr_x_x_x_x_x_x]
|
||||||
721742.55151999998 1037422.41889 423751.50296999997 200000 36000000 1 ffffff b2b2b2 ffffff 0 0 0 0 1 1 1 0
|
0 315679.86736999999 315679.86736999999 200000 36000000 1 ffffff b2b2b2 ffffff 0 0 0 0 1 1 1 0
|
||||||
0 30 5000
|
0 30 5000
|
||||||
0
|
0
|
||||||
0 100
|
0 100
|
||||||
|
@ -1797,7 +1797,7 @@ End_Of_Serialized_Data 14
|
||||||
6
|
6
|
||||||
1
|
1
|
||||||
14
|
14
|
||||||
ver=2: FT TF TF FT FT FT;F T Config;F T Ethernet1;F T GLLogger;T F _Statistics
|
ver=2: FT TF TF FT FT FT;F T Config;F T Ethernet1;F T Ethernet100;F T GLLogger;T F _Statistics
|
||||||
End_Of_Serialized_Data 14
|
End_Of_Serialized_Data 14
|
||||||
7
|
7
|
||||||
0
|
0
|
||||||
|
@ -1823,7 +1823,10 @@ End_Of_Serialized_Data 14
|
||||||
16
|
16
|
||||||
0
|
0
|
||||||
17
|
17
|
||||||
0
|
1
|
||||||
|
14
|
||||||
|
ver=2: FT
|
||||||
|
End_Of_Serialized_Data 14
|
||||||
18
|
18
|
||||||
0
|
0
|
||||||
19
|
19
|
||||||
|
@ -4120,7 +4123,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::DeviceCode
|
DeviceCode
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4156,7 +4159,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::SerialCode
|
SerialCode
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4192,7 +4195,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::InputBits
|
InputBits
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4228,7 +4231,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::InputRegisters
|
InputRegisters
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4264,7 +4267,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::OutputBits
|
OutputBits
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4300,7 +4303,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::OutputRegisters
|
OutputRegisters
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4336,7 +4339,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Info::Modules
|
Modules
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4372,7 +4375,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Data::OutputBits
|
OutputBits
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4408,7 +4411,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Data::InputBits
|
InputBits
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4588,7 +4591,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Config::Interval
|
Interval
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4624,7 +4627,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_2::Data::InputRegisters [0]
|
InputRegisters
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4660,7 +4663,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_3::Data::InputBits
|
InputBits
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4696,7 +4699,7 @@ VSysVarObject 14 Begin_Of_Object
|
||||||
VHostSignal 15 Begin_Of_Object
|
VHostSignal 15 Begin_Of_Object
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
Ethernet1::Client_3::Data::InputRegisters
|
InputRegisters
|
||||||
0
|
0
|
||||||
End_Of_Object VHostSignal 15
|
End_Of_Object VHostSignal 15
|
||||||
14
|
14
|
||||||
|
@ -4880,7 +4883,7 @@ END_OF_DOCK_INFO
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
0 1 -1 -1 -1 -1 -205 402 689 893
|
0 1 -1 -1 -1 -1 -293 402 601 893
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
776 389
|
776 389
|
||||||
|
@ -4934,7 +4937,7 @@ End_Of_Object VGrMnBox 3
|
||||||
VDOLocalInfoStruct 3 Begin_Of_Object
|
VDOLocalInfoStruct 3 Begin_Of_Object
|
||||||
3
|
3
|
||||||
1
|
1
|
||||||
238
|
243
|
||||||
VDAOBus 4 Begin_Of_Object
|
VDAOBus 4 Begin_Of_Object
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
@ -4954,16 +4957,16 @@ VProgrammedNode 7 Begin_Of_Object
|
||||||
VConfigurationRoot 8 Begin_Of_Object
|
VConfigurationRoot 8 Begin_Of_Object
|
||||||
1
|
1
|
||||||
End_Of_Object VConfigurationRoot 8
|
End_Of_Object VConfigurationRoot 8
|
||||||
<VFileName V4 QL> 1 "include\CAPL\ModbusClient.can"
|
<VFileName V4 QL> 1 "include\CAPL\PollingModbusClient.can"
|
||||||
1
|
1
|
||||||
J:\HsKA\NB7\Bachelorthesis\CANoe\Modbus-CAPL\include\CAPL\ModbusClient.cbf
|
J:\HsKA\NB7\Bachelorthesis\CANoe\Modbus-CAPL\include\CAPL\PollingModbusClient.cbf
|
||||||
Client_2
|
Client_100
|
||||||
Modbus
|
Modbus
|
||||||
5
|
5
|
||||||
ECU 2
|
ECU 2
|
||||||
ECU 2
|
ECU 2
|
||||||
EOF_TITLE_INFO
|
EOF_TITLE_INFO
|
||||||
Client_2
|
Client_100
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
|
@ -4994,7 +4997,7 @@ EOF_MBSSDATA
|
||||||
EOF_NLDATA
|
EOF_NLDATA
|
||||||
0
|
0
|
||||||
EOF_ASSEMBLYDATA
|
EOF_ASSEMBLYDATA
|
||||||
<VFileName V4 QL> 1 "include\CAPL\ModbusClient.cbf"
|
<VFileName V4 QL> 1 "include\CAPL\PollingModbusClient.cbf"
|
||||||
VIPBStackSetting 8 Begin_Of_Object
|
VIPBStackSetting 8 Begin_Of_Object
|
||||||
3
|
3
|
||||||
1
|
1
|
||||||
|
@ -5046,7 +5049,7 @@ End_Of_Object VIPBStackSetting 8
|
||||||
NDebugger::VDebuggerHost 8 Begin_Of_Object
|
NDebugger::VDebuggerHost 8 Begin_Of_Object
|
||||||
2
|
2
|
||||||
0
|
0
|
||||||
27
|
28
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
1
|
1
|
||||||
<VFileName V4 QL> 1 "ModbusTcpCommon.cin"
|
<VFileName V4 QL> 1 "ModbusTcpCommon.cin"
|
||||||
|
@ -5124,26 +5127,6 @@ NDebugger::VFile 9 Begin_Of_Object
|
||||||
End_Of_Object NDebugger::VFile 9
|
End_Of_Object NDebugger::VFile 9
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
1
|
1
|
||||||
<VFileName V4 QL> 1 "include\CAPL\include\Common.cin"
|
|
||||||
28
|
|
||||||
End_Of_Object NDebugger::VFile 9
|
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
|
||||||
1
|
|
||||||
<VFileName V4 QL> 1 "include\CAPL\include\ModbusClientCommon.cin"
|
|
||||||
29
|
|
||||||
End_Of_Object NDebugger::VFile 9
|
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
|
||||||
1
|
|
||||||
<VFileName V4 QL> 1 "include\CAPL\include\TcpUdpCommon.cin"
|
|
||||||
33
|
|
||||||
End_Of_Object NDebugger::VFile 9
|
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
|
||||||
1
|
|
||||||
<VFileName V4 QL> 1 "include\CAPL\ModbusClient.can"
|
|
||||||
35
|
|
||||||
End_Of_Object NDebugger::VFile 9
|
|
||||||
NDebugger::VFile 9 Begin_Of_Object
|
|
||||||
1
|
|
||||||
<VFileName V4 QL> 1 "include\CAPL\include\EilCommon.cin"
|
<VFileName V4 QL> 1 "include\CAPL\include\EilCommon.cin"
|
||||||
36
|
36
|
||||||
End_Of_Object NDebugger::VFile 9
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
@ -5182,6 +5165,31 @@ NDebugger::VFile 9 Begin_Of_Object
|
||||||
<VFileName V4 QL> 1 "include\CAPL\include\DeviceInformation.cin"
|
<VFileName V4 QL> 1 "include\CAPL\include\DeviceInformation.cin"
|
||||||
43
|
43
|
||||||
End_Of_Object NDebugger::VFile 9
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
|
1
|
||||||
|
<VFileName V4 QL> 1 "include\CAPL\PollingModbusClient.can"
|
||||||
|
44
|
||||||
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
|
1
|
||||||
|
<VFileName V4 QL> 1 "include\CAPL\include\Common.cin"
|
||||||
|
45
|
||||||
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
|
1
|
||||||
|
<VFileName V4 QL> 1 "include\CAPL\include\ModbusClient.cin"
|
||||||
|
46
|
||||||
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
|
1
|
||||||
|
<VFileName V4 QL> 1 "include\CAPL\include\ModbusUdp.cin"
|
||||||
|
47
|
||||||
|
End_Of_Object NDebugger::VFile 9
|
||||||
|
NDebugger::VFile 9 Begin_Of_Object
|
||||||
|
1
|
||||||
|
<VFileName V4 QL> 1 "include\CAPL\include\TcpUdpEilCommon.cin"
|
||||||
|
48
|
||||||
|
End_Of_Object NDebugger::VFile 9
|
||||||
VNETStandaloneComponent 9 Begin_Of_Object
|
VNETStandaloneComponent 9 Begin_Of_Object
|
||||||
1
|
1
|
||||||
VNETControlBox 10 Begin_Of_Object
|
VNETControlBox 10 Begin_Of_Object
|
||||||
|
@ -5258,7 +5266,7 @@ End_Of_Object VUniqueBox 11
|
||||||
1 -1 0 0 0 0 0 0 0 0 0 0
|
1 -1 0 0 0 0 0 0 0 0 0 0
|
||||||
0
|
0
|
||||||
End_Of_Object VNETControlBox 10
|
End_Of_Object VNETControlBox 10
|
||||||
132
|
150
|
||||||
APPDIR Vector.CANoe.Debugger.DLL
|
APPDIR Vector.CANoe.Debugger.DLL
|
||||||
Vector.CANoe.Debugger, Version=8.2.40.0, Culture=neutral, PublicKeyToken=null
|
Vector.CANoe.Debugger, Version=8.2.40.0, Culture=neutral, PublicKeyToken=null
|
||||||
Vector.CANoe.Debugger.DebuggerComponent
|
Vector.CANoe.Debugger.DebuggerComponent
|
||||||
|
@ -5300,34 +5308,52 @@ TypeRef:3
|
||||||
3
|
3
|
||||||
Int32
|
Int32
|
||||||
NrOfFiles
|
NrOfFiles
|
||||||
4
|
7
|
||||||
Int32
|
Int32
|
||||||
FileID0
|
FileID0
|
||||||
35
|
44
|
||||||
Int32
|
Int32
|
||||||
CurrentLine0
|
CurrentLine0
|
||||||
0
|
0
|
||||||
Int32
|
Int32
|
||||||
FileID1
|
FileID1
|
||||||
28
|
45
|
||||||
Int32
|
Int32
|
||||||
CurrentLine1
|
CurrentLine1
|
||||||
0
|
0
|
||||||
Int32
|
Int32
|
||||||
FileID2
|
FileID2
|
||||||
29
|
43
|
||||||
Int32
|
Int32
|
||||||
CurrentLine2
|
CurrentLine2
|
||||||
0
|
0
|
||||||
Int32
|
Int32
|
||||||
FileID3
|
FileID3
|
||||||
33
|
46
|
||||||
Int32
|
Int32
|
||||||
CurrentLine3
|
CurrentLine3
|
||||||
0
|
0
|
||||||
Int32
|
Int32
|
||||||
|
FileID4
|
||||||
|
42
|
||||||
|
Int32
|
||||||
|
CurrentLine4
|
||||||
|
0
|
||||||
|
Int32
|
||||||
|
FileID5
|
||||||
|
47
|
||||||
|
Int32
|
||||||
|
CurrentLine5
|
||||||
|
0
|
||||||
|
Int32
|
||||||
|
FileID6
|
||||||
|
48
|
||||||
|
Int32
|
||||||
|
CurrentLine6
|
||||||
|
0
|
||||||
|
Int32
|
||||||
SelectedFileID
|
SelectedFileID
|
||||||
35
|
44
|
||||||
Int32
|
Int32
|
||||||
NrOfWatchedVariables
|
NrOfWatchedVariables
|
||||||
0
|
0
|
||||||
|
@ -5415,7 +5441,7 @@ VSimulinkModelViewerConfiguration 7 Begin_Of_Object
|
||||||
End_Of_Object VSimulinkModelViewerConfiguration 7
|
End_Of_Object VSimulinkModelViewerConfiguration 7
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
169746433
|
1368551005
|
||||||
0
|
0
|
||||||
NodeSignalPanelBustypeCount 0
|
NodeSignalPanelBustypeCount 0
|
||||||
End_Of_Object VSimulationNode 6
|
End_Of_Object VSimulationNode 6
|
||||||
|
@ -5440,16 +5466,16 @@ VProgrammedNode 7 Begin_Of_Object
|
||||||
VConfigurationRoot 8 Begin_Of_Object
|
VConfigurationRoot 8 Begin_Of_Object
|
||||||
1
|
1
|
||||||
End_Of_Object VConfigurationRoot 8
|
End_Of_Object VConfigurationRoot 8
|
||||||
<VFileName V4 QL> 1 "include\CAPL\ModbusClient.can"
|
<VFileName V4 QL> 1 "include\CAPL\PollingModbusClient.can"
|
||||||
1
|
1
|
||||||
J:\HsKA\NB7\Bachelorthesis\CANoe\Modbus-CAPL\include\CAPL\ModbusClient2.cbf
|
J:\HsKA\NB7\Bachelorthesis\CANoe\Modbus-CAPL\include\CAPL\PollingModbusClient2.cbf
|
||||||
Client_3
|
Client_101
|
||||||
Modbus
|
Modbus
|
||||||
5
|
5
|
||||||
ECU 1
|
ECU 1
|
||||||
ECU 1
|
ECU 1
|
||||||
EOF_TITLE_INFO
|
EOF_TITLE_INFO
|
||||||
Client_3
|
Client_101
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
|
@ -5480,7 +5506,7 @@ EOF_MBSSDATA
|
||||||
EOF_NLDATA
|
EOF_NLDATA
|
||||||
0
|
0
|
||||||
EOF_ASSEMBLYDATA
|
EOF_ASSEMBLYDATA
|
||||||
<VFileName V4 QL> 1 "include\CAPL\ModbusClient2.cbf"
|
<VFileName V4 QL> 1 "include\CAPL\PollingModbusClient2.cbf"
|
||||||
VIPBStackSetting 8 Begin_Of_Object
|
VIPBStackSetting 8 Begin_Of_Object
|
||||||
3
|
3
|
||||||
1
|
1
|
||||||
|
@ -5550,7 +5576,7 @@ VSimulinkModelViewerConfiguration 7 Begin_Of_Object
|
||||||
End_Of_Object VSimulinkModelViewerConfiguration 7
|
End_Of_Object VSimulinkModelViewerConfiguration 7
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
169746433
|
1368551005
|
||||||
0
|
0
|
||||||
NodeSignalPanelBustypeCount 0
|
NodeSignalPanelBustypeCount 0
|
||||||
End_Of_Object VSimulationNode 6
|
End_Of_Object VSimulationNode 6
|
||||||
|
@ -5583,7 +5609,7 @@ VBoxRoot 9 Begin_Of_Object
|
||||||
1
|
1
|
||||||
3
|
3
|
||||||
1 1 1 1 0 166 -8 -30 61 86 1093 577
|
1 1 1 1 0 166 -8 -30 61 86 1093 577
|
||||||
|
Ethernet Packet Builder
|
||||||
1
|
1
|
||||||
|
|
||||||
MDI_DOCK_INFO_END
|
MDI_DOCK_INFO_END
|
||||||
|
@ -5661,105 +5687,11 @@ EOF_MBSSDATA
|
||||||
1
|
1
|
||||||
0 1
|
0 1
|
||||||
<IPPlugIn.PacketBuilder DefaultBusProtocolId="256" DefaultDestMacIdSelection="107" DefaultDestinationIPAddress="192 . 168 . 1 . 100" DefaultDestinationIPv6Address="0:0:0:0:0:0:0:0" DefaultDestinationMacId="FF:FF:FF:FF:FF:FF" DefaultDestinationPort="502" DefaultSourceIPAddress="192 . 168 . 1 . 10" DefaultSourceIPv6Address="0:0:0:0:0:0:0:0" DefaultSourceMacId="02:00:4C:4F:4F:50" DefaultSourcePort="2000" DefaultSrcMacIdSelection="1" Name="Ethernet Packet Builder">
|
<IPPlugIn.PacketBuilder DefaultBusProtocolId="256" DefaultDestMacIdSelection="107" DefaultDestinationIPAddress="192 . 168 . 1 . 100" DefaultDestinationIPv6Address="0:0:0:0:0:0:0:0" DefaultDestinationMacId="FF:FF:FF:FF:FF:FF" DefaultDestinationPort="502" DefaultSourceIPAddress="192 . 168 . 1 . 10" DefaultSourceIPv6Address="0:0:0:0:0:0:0:0" DefaultSourceMacId="02:00:4C:4F:4F:50" DefaultSourcePort="2000" DefaultSrcMacIdSelection="1" Name="Ethernet Packet Builder">
|
||||||
<IPPlugIn.VPersistentFrameWrapper AssignedChannelId="Eth 1" DestMacIdConfStateSel="111" FrameDescription="MB/UDP" FrameIsValid="1" InitialPacketType="5" PDBData="3 0 1651797619 1 3 1 1651797619 1 10 1 1651797619 1 8 0 1651797619 1 11 0 1651797619 1 4 0 1651797619 1 5 0 1651797619 1 5 1 1651797619 1 9 1 1651797619 1 " RawFrameData=" 0-30-de- 7-9a-fd- 0-19-db-cb-83-dd- 8- 0-45- 0- 0-27- 0- 0- 0- 0-40-11-f7-72-c0-a8- 1- 1-c0-a8- 1- 2-d5-66- 1-f6- 0-13-67-b5-30-30- 0- 0- 0- 5-ff-2b- e- 1- 0- 0- 0- 2- 0- 0- 0- 6-" RawFrameLength="60" SrcMacIdConfStateSel="105" WlanAddr1MacIdConfStateSel="111" WlanAddr2MacIdConfStateSel="111" WlanAddr3MacIdConfStateSel="111" WlanAddr4MacIdConfStateSel="111"/>
|
<IPPlugIn.VPersistentFrameWrapper AssignedChannelId="Eth 1" DestMacIdConfStateSel="111" FrameDescription="MB/UDP" FrameIsValid="1" InitialPacketType="5" PDBData="5 0 1651797619 1 9 1 1651797619 1 5 1 1651797619 1 4 0 1651797619 1 11 0 1651797619 1 8 0 1651797619 1 3 0 1651797619 1 10 1 1651797619 1 3 1 1651797619 1 " RawFrameData=" 0-30-de- 7-9a-fd- 0-19-db-cb-83-dd- 8- 0-45- 0- 0-27- 0- 0- 0- 0-40-11-f7-72-c0-a8- 1- 1-c0-a8- 1- 2-d5-66- 1-f6- 0-13-67-b5-30-30- 0- 0- 0- 5-ff-2b- e- 1- 0- 0- 0- 2- 0- 0- 0- 6-" RawFrameLength="60" SrcMacIdConfStateSel="105" WlanAddr1MacIdConfStateSel="111" WlanAddr2MacIdConfStateSel="111" WlanAddr3MacIdConfStateSel="111" WlanAddr4MacIdConfStateSel="111"/>
|
||||||
<IPPlugIn.SE id="102" intVal="0" key="1919247220"/>
|
<IPPlugIn.SE id="5" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="102" index="1" intVal="986" key="1919247220"/>
|
<IPPlugIn.SE id="5" index="1" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="102" index="2" intVal="0" key="1919247220"/>
|
<IPPlugIn.SE id="5" index="2" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="102" index="3" intVal="507" key="1919247220"/>
|
<IPPlugIn.SE id="5" index="3" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="102" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="102" intVal="199" key="1936292453"/>
|
|
||||||
<IPPlugIn.SE id="102" intVal="437" key="1920231791"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="1145393987" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="218" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="1" intVal="1397708114" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="1" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="1" intVal="156" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="2" intVal="1145394004" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="2" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="2" intVal="156" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="3" intVal="1347571540" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="3" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="18" intVal="1" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="19" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="20" intVal="1" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="20" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="19" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="18" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="3" intVal="125" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="4" intVal="1397316165" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="4" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="4" intVal="108" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="5" intVal="1348029508" key="1952540511"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="5" intVal="1" key="1986622303"/>
|
|
||||||
<IPPlugIn.SE id="1004" index="5" intVal="108" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="0" key="1886352249"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="0" key="1886352248"/>
|
|
||||||
<IPPlugIn.SE id="1004" intVal="0" key="7499639"/>
|
|
||||||
<IPPlugIn.SE id="125" intVal="0" key="7562604"/>
|
|
||||||
<IPPlugIn.SE id="102" index="1" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="102" index="1" intVal="531" key="1936292453"/>
|
|
||||||
<IPPlugIn.SE id="102" index="1" intVal="397" key="1920231791"/>
|
|
||||||
<IPPlugIn.SE id="1005" intVal="0" key="1886352249"/>
|
|
||||||
<IPPlugIn.SE id="1005" intVal="0" key="1886352248"/>
|
|
||||||
<IPPlugIn.SE id="1005" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="1" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="1" intVal="1" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="2" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="2" index="1" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="2" index="2" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="2" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="2" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="3" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="3" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="4" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="4" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="5" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="5" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="6" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="6" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="7" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="7" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="8" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="8" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="9" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="9" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="3" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="1" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="2" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="3" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="4" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="5" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="6" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="7" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="8" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="9" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="10" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="3" index="11" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="10" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="10" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="11" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="11" intVal="1" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="12" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="12" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="13" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="13" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="14" intVal="0" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="14" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="15" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="15" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="16" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="16" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="17" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="1005" index="17" intVal="0" key="1633907830"/>
|
|
||||||
<IPPlugIn.SE id="102" index="2" intVal="1" key="1702391908"/>
|
|
||||||
<IPPlugIn.SE id="102" index="2" intVal="219" key="1936292453"/>
|
|
||||||
<IPPlugIn.SE id="102" index="2" intVal="164" key="1920231791"/>
|
|
||||||
<IPPlugIn.SE id="127" intVal="0" key="1651534958"/>
|
|
||||||
<IPPlugIn.SE id="1003" intVal="0" key="1886352249"/>
|
|
||||||
<IPPlugIn.SE id="1003" intVal="0" key="1886352248"/>
|
|
||||||
<IPPlugIn.SE id="1003" intVal="0" key="2003072104"/>
|
|
||||||
<IPPlugIn.SE id="4" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="4" index="1" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" index="1" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="4" index="2" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" index="2" intVal="0" key="1702391908"/>
|
||||||
|
@ -5770,10 +5702,104 @@ EOF_MBSSDATA
|
||||||
<IPPlugIn.SE id="4" index="7" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" index="7" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="4" index="8" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" index="8" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="4" index="9" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="4" index="9" intVal="0" key="1702391908"/>
|
||||||
<IPPlugIn.SE id="5" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="1003" intVal="0" key="2003072104"/>
|
||||||
<IPPlugIn.SE id="5" index="1" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="1003" intVal="0" key="1886352248"/>
|
||||||
<IPPlugIn.SE id="5" index="2" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="1003" intVal="0" key="1886352249"/>
|
||||||
<IPPlugIn.SE id="5" index="3" intVal="0" key="1702391908"/>
|
<IPPlugIn.SE id="127" intVal="0" key="1651534958"/>
|
||||||
|
<IPPlugIn.SE id="3" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="1" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="102" index="2" intVal="164" key="1920231791"/>
|
||||||
|
<IPPlugIn.SE id="102" index="2" intVal="219" key="1936292453"/>
|
||||||
|
<IPPlugIn.SE id="102" index="2" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="2" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="3" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="4" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="5" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="6" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="7" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="8" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="9" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="10" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="11" intVal="1" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="12" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="13" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="14" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="15" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="16" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="17" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="17" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="16" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="15" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="14" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="13" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="12" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="11" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="10" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="10" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="3" index="11" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="2" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="2" index="1" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="2" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="3" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="4" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="5" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="6" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="7" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="8" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="9" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="9" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="8" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="7" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="6" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="5" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="4" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="3" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="2" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="2" index="2" intVal="0" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="1" intVal="1" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="1" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" intVal="0" key="1886352248"/>
|
||||||
|
<IPPlugIn.SE id="1005" intVal="0" key="1886352249"/>
|
||||||
|
<IPPlugIn.SE id="125" intVal="0" key="7562604"/>
|
||||||
|
<IPPlugIn.SE id="102" index="1" intVal="397" key="1920231791"/>
|
||||||
|
<IPPlugIn.SE id="102" index="1" intVal="531" key="1936292453"/>
|
||||||
|
<IPPlugIn.SE id="102" index="1" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="0" key="7499639"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="0" key="1886352248"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="0" key="1886352249"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="218" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="1" intVal="156" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="2" intVal="156" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="3" intVal="125" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="4" intVal="108" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="5" intVal="108" key="2003072104"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="5" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="5" intVal="1348029508" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="4" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="4" intVal="1397316165" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="3" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="3" intVal="1347571540" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="2" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="2" intVal="1145394004" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="1" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" index="1" intVal="1397708114" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="1" key="1986622303"/>
|
||||||
|
<IPPlugIn.SE id="1004" intVal="1145393987" key="1952540511"/>
|
||||||
|
<IPPlugIn.SE id="102" intVal="437" key="1920231791"/>
|
||||||
|
<IPPlugIn.SE id="102" intVal="199" key="1936292453"/>
|
||||||
|
<IPPlugIn.SE id="102" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="102" intVal="0" key="1919247220"/>
|
||||||
|
<IPPlugIn.SE id="102" index="1" intVal="986" key="1919247220"/>
|
||||||
|
<IPPlugIn.SE id="102" index="2" intVal="0" key="1919247220"/>
|
||||||
|
<IPPlugIn.SE id="102" index="3" intVal="507" key="1919247220"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="18" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="18" intVal="1" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="19" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="19" intVal="0" key="1633907830"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="20" intVal="1" key="1702391908"/>
|
||||||
|
<IPPlugIn.SE id="1005" index="20" intVal="1" key="1633907830"/>
|
||||||
</IPPlugIn.PacketBuilder>
|
</IPPlugIn.PacketBuilder>
|
||||||
End_Of_Object VSSPlugInConfiguration 6
|
End_Of_Object VSSPlugInConfiguration 6
|
||||||
NULL
|
NULL
|
||||||
|
@ -5809,7 +5835,7 @@ NULL
|
||||||
End_Of_Object VDOLocalInfoStruct 3
|
End_Of_Object VDOLocalInfoStruct 3
|
||||||
0.000000
|
0.000000
|
||||||
0 0
|
0 0
|
||||||
1 1 0 59420 1 176 1 2882400001 464 664 430 885 2882400002 0 0 0 0 0 20 1 2882400001 769 969 432 632 2882400002 0 0 0 0 0 0 3
|
1 1 0 59420 1 176 1 2882400001 464 664 430 885 2882400002 0 0 0 0 0 20 1 2882400001 681 881 432 632 2882400002 0 0 0 0 0 0 3
|
||||||
SS_BEGIN_COMMON_INFO
|
SS_BEGIN_COMMON_INFO
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
|
@ -5833,7 +5859,6 @@ Misc
|
||||||
1
|
1
|
||||||
SS_END_COMMON_INFO
|
SS_END_COMMON_INFO
|
||||||
|
|
||||||
|
|
||||||
EOF_BUSDATA
|
EOF_BUSDATA
|
||||||
1
|
1
|
||||||
_Start_VPRBSManager 1
|
_Start_VPRBSManager 1
|
||||||
|
@ -5933,7 +5958,7 @@ End_Of_Serialized_Data 2
|
||||||
End_Of_Object VWriteBox 2
|
End_Of_Object VWriteBox 2
|
||||||
VWinStore 2 Begin_Of_Object
|
VWinStore 2 Begin_Of_Object
|
||||||
1
|
1
|
||||||
22 2 3 -32088 -32000 -1 -1 -10088 -10000 -9070 -9233
|
22 2 3 -1 -1 -1 -1 -10088 -10000 -9070 -9233
|
||||||
End_Of_Child_List
|
End_Of_Child_List
|
||||||
End_Of_Object VWinStore 2
|
End_Of_Object VWinStore 2
|
||||||
VWinStore 2 Begin_Of_Object
|
VWinStore 2 Begin_Of_Object
|
||||||
|
@ -6253,6 +6278,7 @@ End
|
||||||
|
|
||||||
FiltersEnd
|
FiltersEnd
|
||||||
1 1
|
1 1
|
||||||
|
|
||||||
END_OF_WORKSPACE_MEMBER_DATA
|
END_OF_WORKSPACE_MEMBER_DATA
|
||||||
END_OF_WORKSPACE_MEMBER
|
END_OF_WORKSPACE_MEMBER
|
||||||
1
|
1
|
||||||
|
|
|
@ -23,6 +23,7 @@ on preStart
|
||||||
OutputDebugLevel = Warning; // The debug level (messages in write window)
|
OutputDebugLevel = Warning; // The debug level (messages in write window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Connect to Modbus server, read the status of output registers and bits and start the cyclic timer
|
||||||
on start
|
on start
|
||||||
{
|
{
|
||||||
char ip[16];
|
char ip[16];
|
||||||
|
@ -33,8 +34,8 @@ on start
|
||||||
writeDbg(MbInfo, "Connecting to %s:%d", ip, @sysvar::Config::Modbus::Port);
|
writeDbg(MbInfo, "Connecting to %s:%d", ip, @sysvar::Config::Modbus::Port);
|
||||||
ModbusInit(ip, @sysvar::Config::Modbus::Port, @sysvar::Config::Modbus::RequestTimeout, @sysvar::Config::Modbus::MaxTransmissionCount); // Connect to device. Opens socket and connection or what ever
|
ModbusInit(ip, @sysvar::Config::Modbus::Port, @sysvar::Config::Modbus::RequestTimeout, @sysvar::Config::Modbus::MaxTransmissionCount); // Connect to device. Opens socket and connection or what ever
|
||||||
|
|
||||||
ModbusReadOutBits(gDevOutputBitAddrR, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputBits); // Read the start status of the output bits
|
ModbusReadOutBits(thisDev.Address.Read.OutputBit, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputBits); // Read the start status of the output bits
|
||||||
ModbusReadOutRegisters(gDevOutputRegAddrR, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputRegisters); // Read the start status of the output registers
|
ModbusReadOutRegisters(thisDev.Address.Read.OutputReg, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputRegisters); // Read the start status of the output registers
|
||||||
|
|
||||||
if (@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Config::Interval > 0) // Start the polling timer
|
if (@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Config::Interval > 0) // Start the polling timer
|
||||||
setTimerCyclic(gtRead, 1, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Config::Interval);
|
setTimerCyclic(gtRead, 1, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Config::Interval);
|
||||||
|
@ -50,7 +51,7 @@ on start
|
||||||
/// error == FinalTimeout: The packet will not be resent
|
/// error == FinalTimeout: The packet will not be resent
|
||||||
/// error == Exception: The client responded with an exception (which again can have several reasons, see enum ModbusException)
|
/// error == Exception: The client responded with an exception (which again can have several reasons, see enum ModbusException)
|
||||||
|
|
||||||
/// This method gets called when an error occured while trying to read some bits (ModbusReadBits())
|
// This method gets called when an error occured while trying to read some bits (ModbusReadBits())
|
||||||
void OnModbusReadBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap)
|
void OnModbusReadBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap)
|
||||||
{
|
{
|
||||||
word i;
|
word i;
|
||||||
|
@ -70,7 +71,7 @@ void OnModbusReadBitsFailed(enum ModbusRequestError error, enum ModbusException
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This method gets called when an error occured while trying to read some registers (ModbusReadRegisters())
|
// This method gets called when an error occured while trying to read some registers (ModbusReadRegisters())
|
||||||
void OnModbusReadRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap)
|
void OnModbusReadRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap)
|
||||||
{
|
{
|
||||||
byte i;
|
byte i;
|
||||||
|
@ -90,17 +91,17 @@ void OnModbusReadRegistersFailed(enum ModbusRequestError error, enum ModbusExcep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This method gets called when an error occured while trying to set a bit (ModbusWriteBit())
|
// This method gets called when an error occured while trying to set a bit (ModbusWriteBit())
|
||||||
void OnModbusWriteBitFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusWriteBitFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
/// This method gets called when an error occured while trying to set a register (ModbusWriteRegister())
|
// This method gets called when an error occured while trying to set a register (ModbusWriteRegister())
|
||||||
void OnModbusWriteRegisterFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusWriteRegisterFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
/// This method gets called when an error occured while trying to apply a mask on a register (ModbusWriteMask())
|
// This method gets called when an error occured while trying to apply a mask on a register (ModbusWriteMask())
|
||||||
void OnModbusWriteMasksFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusWriteMasksFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
/// This method gets called when an error occured while trying to read and write registers (ModbusReadWriteRegisters())
|
// This method gets called when an error occured while trying to read and write registers (ModbusReadWriteRegisters())
|
||||||
void OnModbusReadWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusReadWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
/// This method gets called when an error occured while trying to set multiple bits (ModbusWriteBits())
|
// This method gets called when an error occured while trying to set multiple bits (ModbusWriteBits())
|
||||||
void OnModbusWriteBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusWriteBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
/// This method gets called when an error occured while trying to set multiple registers (ModbusWriteRegisters())
|
// This method gets called when an error occured while trying to set multiple registers (ModbusWriteRegisters())
|
||||||
void OnModbusWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
void OnModbusWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||||
|
|
||||||
// -- Modbus Success ------------------------------------------------------------------
|
// -- Modbus Success ------------------------------------------------------------------
|
||||||
|
@ -115,10 +116,10 @@ void OnModbusReadBitsSuccess(struct ModbusResReceiveBits mbres, byte bitStatus[]
|
||||||
|
|
||||||
switch (mbres.Header.FuncCode) // We assume that we separate between 0x01 and 0x02 even though the address space may be the same
|
switch (mbres.Header.FuncCode) // We assume that we separate between 0x01 and 0x02 even though the address space may be the same
|
||||||
{
|
{
|
||||||
case 0x01: // Read output bits
|
case ReadBitsOut: // Read output bits
|
||||||
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "OutputBits");
|
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "OutputBits");
|
||||||
|
|
||||||
offset = mbreq.Address - gDevOutputBitAddrR; // Get the offset to the base output bit address
|
offset = mbreq.Address - thisDev.Address.Read.OutputBit; // Get the offset to the base output bit address
|
||||||
for (i = 0; i < mbreq.Count; i++)
|
for (i = 0; i < mbreq.Count; i++)
|
||||||
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::OutputBits[i + offset] = bitStatus[i];
|
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::OutputBits[i + offset] = bitStatus[i];
|
||||||
|
|
||||||
|
@ -126,10 +127,10 @@ void OnModbusReadBitsSuccess(struct ModbusResReceiveBits mbres, byte bitStatus[]
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 0x02: // Read input bits
|
case ReadBitsIn: // Read input bits
|
||||||
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "InputBits");
|
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "InputBits");
|
||||||
|
|
||||||
offset = mbreq.Address - gDevInputBitAddr; // Get the offset to the base input bit address
|
offset = mbreq.Address - thisDev.Address.Read.InputBit; // Get the offset to the base input bit address
|
||||||
for (i = 0; i < mbreq.Count; i++)
|
for (i = 0; i < mbreq.Count; i++)
|
||||||
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::InputBits[i + offset] = bitStatus[i];
|
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::InputBits[i + offset] = bitStatus[i];
|
||||||
|
|
||||||
|
@ -145,10 +146,10 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
|
||||||
|
|
||||||
switch (mbres.Header.FuncCode) // We assume that we separate between 0x03 and 0x04 even though the address space may be the same
|
switch (mbres.Header.FuncCode) // We assume that we separate between 0x03 and 0x04 even though the address space may be the same
|
||||||
{
|
{
|
||||||
case 0x03: // Read output registers
|
case ReadRegistersOut: // Read output registers
|
||||||
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "OutputRegisters");
|
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "OutputRegisters");
|
||||||
|
|
||||||
offset = mbreq.Address - gDevOutputRegAddrR; // Get the offset to the base output register address
|
offset = mbreq.Address - thisDev.Address.Read.OutputReg; // Get the offset to the base output register address
|
||||||
for (i = 0; i < mbreq.Count; i++)
|
for (i = 0; i < mbreq.Count; i++)
|
||||||
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::OutputRegisters[i + offset] = mbres.Data[i];
|
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::OutputRegisters[i + offset] = mbres.Data[i];
|
||||||
|
|
||||||
|
@ -156,10 +157,10 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 0x04: // Read input registers
|
case ReadRegistersIn: // Read input registers
|
||||||
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "InputRegisters");
|
sysBeginVariableStructUpdate("%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data", "InputRegisters");
|
||||||
|
|
||||||
offset = mbreq.Address - gDevInputRegAddr; // Get the offset to the base input bit address
|
offset = mbreq.Address - thisDev.Address.Read.InputReg; // Get the offset to the base input bit address
|
||||||
for (i = 0; i < mbreq.Count; i++)
|
for (i = 0; i < mbreq.Count; i++)
|
||||||
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::InputRegisters[i + offset] = mbres.Data[i];
|
@sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Data::InputRegisters[i + offset] = mbres.Data[i];
|
||||||
|
|
||||||
|
@ -202,8 +203,8 @@ void OnModbusClientPanics(enum FatalErrors reason)
|
||||||
// The timer will continuously poll the input registers and intput bits
|
// The timer will continuously poll the input registers and intput bits
|
||||||
on timer gtRead
|
on timer gtRead
|
||||||
{
|
{
|
||||||
ModbusReadRegisters(0x0000, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputRegisters);
|
ModbusReadRegisters(thisDev.Address.Read.InputReg, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputRegisters);
|
||||||
ModbusReadBits(0x0000, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputBits);
|
ModbusReadBits(thisDev.Address.Read.InputBit, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Data::OutputBits is changed we will send this update to the device
|
// If Data::OutputBits is changed we will send this update to the device
|
||||||
|
|
|
@ -174,6 +174,20 @@ void writeDbg(enum DebugLvl lvl, char format[], long num1, long num2, long num3)
|
||||||
}
|
}
|
||||||
// This method prints the specified arguments to CAPL/Write Window if the debug level is high enough
|
// This method prints the specified arguments to CAPL/Write Window if the debug level is high enough
|
||||||
/// <writeDbg>
|
/// <writeDbg>
|
||||||
|
void writeDbg(enum DebugLvl lvl, char format[], long num1, long num2, long num3, char str[])
|
||||||
|
{
|
||||||
|
char msg[500];
|
||||||
|
byte lVl;
|
||||||
|
|
||||||
|
if (lvl < OutputDebugLevel)
|
||||||
|
return;
|
||||||
|
lVl = (byte)lvl >> 4;
|
||||||
|
|
||||||
|
writeDbgFormat(lVl, msg, format);
|
||||||
|
writeLineEx(1, lVl, msg, num1, num2, num3, str);
|
||||||
|
}
|
||||||
|
// This method prints the specified arguments to CAPL/Write Window if the debug level is high enough
|
||||||
|
/// <writeDbg>
|
||||||
void writeDbg(enum DebugLvl lvl, char format[], long num1, long num2, long num3, long num4)
|
void writeDbg(enum DebugLvl lvl, char format[], long num1, long num2, long num3, long num4)
|
||||||
{
|
{
|
||||||
char msg[500];
|
char msg[500];
|
||||||
|
|
|
@ -13,11 +13,28 @@
|
||||||
/// This file is used at two position: The majority of the functions are used to analyze devices when making the config. The minority has to be called when initiating a Modbus client so it knows about the addresses and window size.
|
/// This file is used at two position: The majority of the functions are used to analyze devices when making the config. The minority has to be called when initiating a Modbus client so it knows about the addresses and window size.
|
||||||
variables
|
variables
|
||||||
{
|
{
|
||||||
word gDevOutputBitAddrR, gDevOutputRegAddrR; // Output start addresses Read
|
// This structure is used by the Modbus Client.
|
||||||
word gDevOutputBitAddrW, gDevOutputRegAddrW; // Output start addresses Write
|
struct
|
||||||
word gDevInputBitAddr, gDevInputRegAddr; // Input start addresses
|
{
|
||||||
word gDevBitMaxCount, gDevRegMaxCount; // Max number of bits/registers
|
struct // Start addresses
|
||||||
word gDevReceiveWindow = 1; // Registers size
|
{
|
||||||
|
struct // Start addresses Read
|
||||||
|
{
|
||||||
|
word OutputBit;
|
||||||
|
word OutputReg;
|
||||||
|
word InputBit;
|
||||||
|
word InputReg;
|
||||||
|
} Read;
|
||||||
|
struct // Start addresses Write
|
||||||
|
{
|
||||||
|
word OutputBit;
|
||||||
|
word OutputReg;
|
||||||
|
} Write;
|
||||||
|
} Address;
|
||||||
|
word BitMaxCount; // Max number of bits
|
||||||
|
word RegMaxCount; // Max number of registers
|
||||||
|
byte ReceiveWindow;
|
||||||
|
} thisDev;
|
||||||
|
|
||||||
enum Vendor // The Vendor enum. All Vendors have to listed here and all listed vendors have to be implemented in this file
|
enum Vendor // The Vendor enum. All Vendors have to listed here and all listed vendors have to be implemented in this file
|
||||||
{
|
{
|
||||||
|
@ -52,26 +69,26 @@ void DeviceInit(byte vendor)
|
||||||
switch ((enum Vendor) vendor)
|
switch ((enum Vendor) vendor)
|
||||||
{
|
{
|
||||||
case Wago:
|
case Wago:
|
||||||
gDevInputBitAddr = 0x0000; // Wago inputs start at 0x000
|
thisDev.Address.Read.InputBit = 0x0000; // Wago inputs start at 0x000
|
||||||
gDevInputRegAddr = 0x0000;
|
thisDev.Address.Read.InputReg = 0x0000;
|
||||||
gDevOutputBitAddrR = 0x0200; // Wago reading outputs start at 0x200
|
thisDev.Address.Read.OutputBit = 0x0200; // Wago reading outputs start at 0x200
|
||||||
gDevOutputRegAddrR = 0x0200;
|
thisDev.Address.Read.OutputReg = 0x0200;
|
||||||
gDevOutputBitAddrW = 0x0000; // Wago writing outputs start at 0x000
|
thisDev.Address.Write.OutputBit = 0x0000; // Wago writing outputs start at 0x000
|
||||||
gDevOutputRegAddrW = 0x0000;
|
thisDev.Address.Write.OutputReg = 0x0000;
|
||||||
gDevBitMaxCount = 0x0100; // Wago allows up to 256 inputs
|
thisDev.BitMaxCount = 0x0100; // Wago allows up to 256 inputs
|
||||||
gDevRegMaxCount = 0x0100;
|
thisDev.RegMaxCount = 0x0100;
|
||||||
gDevReceiveWindow = 5; // Wago can handle 5 requests simultaneously
|
thisDev.ReceiveWindow = 5; // Wago can handle 5 requests simultaneously
|
||||||
break;
|
break;
|
||||||
case BuR:
|
case BuR:
|
||||||
gDevInputBitAddr = 0x0000; // B&R inputs start at 0x000
|
thisDev.Address.Read.InputBit = 0x0000; // B&R inputs start at 0x000
|
||||||
gDevInputRegAddr = 0x0000;
|
thisDev.Address.Read.InputReg = 0x0000;
|
||||||
gDevOutputBitAddrR = 0x0000; // B&R reading digital outputs start at 0x000
|
thisDev.Address.Read.OutputBit = 0x0000; // B&R reading digital outputs start at 0x000
|
||||||
gDevOutputRegAddrR = 0x0800; // B&R reading analog outputs start at 0x800
|
thisDev.Address.Read.OutputReg = 0x0800; // B&R reading analog outputs start at 0x800
|
||||||
gDevOutputBitAddrW = 0x0000; // B&R writing outputs start at 0x000
|
thisDev.Address.Write.OutputBit = 0x0000; // B&R writing outputs start at 0x000
|
||||||
gDevOutputRegAddrW = 0x0000;
|
thisDev.Address.Write.OutputReg = 0x0000;
|
||||||
gDevBitMaxCount = 0x4000; // B&R allows up to 16348 digital inputs
|
thisDev.BitMaxCount = 0x4000; // B&R allows up to 16348 digital inputs
|
||||||
gDevRegMaxCount = 0x0800; // B&R allows up to 2048 analog inputs
|
thisDev.RegMaxCount = 0x0800; // B&R allows up to 2048 analog inputs
|
||||||
gDevReceiveWindow = 1; // B&R can only handle 1 request at a time
|
thisDev.ReceiveWindow = 1; // B&R can only handle 1 request at a time
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
OnModbusClientPanics(VendorIdUnknown);
|
OnModbusClientPanics(VendorIdUnknown);
|
||||||
|
@ -244,6 +261,7 @@ void _DeviceParseRegister(struct device device, word address, word data[], word
|
||||||
{
|
{
|
||||||
byte i;
|
byte i;
|
||||||
|
|
||||||
|
//writeDbg(Debug, "_DeviceParseRegister: Address: 0x%04X, Data[0]: %d", address, data[0]);
|
||||||
switch (device.Vendor)
|
switch (device.Vendor)
|
||||||
{
|
{
|
||||||
case Wago:
|
case Wago:
|
||||||
|
@ -304,5 +322,8 @@ void _DeviceParseRegister(struct device device, word address, word data[], word
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
writeDbg(AlgoError, "DeviceGetInformation: Unknown vendor id: %d", device.Vendor);
|
||||||
|
OnModbusClientPanics(VendorIdUnknown);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
/// It provides following methods
|
/// It provides following methods
|
||||||
/// - ModbusInit() Prepare anything that Modbus works (open connection etc.)
|
/// - ModbusInit() Prepare anything that Modbus works (open connection etc.)
|
||||||
|
/// - ModbusEnd() Client up everything (close connection etc.)
|
||||||
|
|
||||||
/// - ModbusReadOutBits() Modbus Function Code: 0x01 (Discrete inputs)
|
/// - ModbusReadOutBits() Modbus Function Code: 0x01 (Discrete inputs)
|
||||||
/// - ModbusReadInBits() Modbus Function Code: 0x02 (Coils)
|
/// - ModbusReadInBits() Modbus Function Code: 0x02 (Coils)
|
||||||
|
@ -84,9 +85,19 @@ void ModbusInit(char Remote_IP[], word remotePort, word requestTimeout, byte max
|
||||||
gMaxTransmissionCount = maxRetransmissions;
|
gMaxTransmissionCount = maxRetransmissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This method cleans up everything: Closes the connection, clears the queues and stops the timer
|
||||||
|
// It has to be called by the user/modbus client at the end of the measurement
|
||||||
|
void ModbusEnd()
|
||||||
|
{
|
||||||
|
_ModbusDisconnect();
|
||||||
|
gQueuePending.Clear();
|
||||||
|
gQueueSent.Clear();
|
||||||
|
gtModbusRobin.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
// This method fills the ModbusApHeader structure 'mbap'.
|
// This method fills the ModbusApHeader structure 'mbap'.
|
||||||
// It gets called by the Modbus request methods
|
// It gets called by the Modbus request methods
|
||||||
void _ModbusMakeHeader(struct ModbusApHeader mbap, word length, byte funcCode)
|
void _ModbusMakeHeader(struct ModbusApHeader mbap, word length, enum ModbusFuncCode funcCode)
|
||||||
{
|
{
|
||||||
mbap.TxID = gTxID++; // [2] Transaction ID
|
mbap.TxID = gTxID++; // [2] Transaction ID
|
||||||
mbap.Protocol = 0x0000; // [2] Protocol ID = 0 = Modbus
|
mbap.Protocol = 0x0000; // [2] Protocol ID = 0 = Modbus
|
||||||
|
@ -102,23 +113,23 @@ void _ModbusMakeHeader(struct ModbusApHeader mbap, word length, byte funcCode)
|
||||||
// This method will submit a request to the Modbus server to read discrete inputs
|
// This method will submit a request to the Modbus server to read discrete inputs
|
||||||
void ModbusReadInBits(word address, long count)
|
void ModbusReadInBits(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadBits(0x02, address, count);
|
_ModbusReadBits(ReadBitsIn, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadBits>
|
/// <ModbusReadBits>
|
||||||
// This method will submit a request to the Modbus server to read coils
|
// This method will submit a request to the Modbus server to read coils
|
||||||
void ModbusReadBits(word address, long count)
|
void ModbusReadBits(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadBits(0x02, address, count);
|
_ModbusReadBits(ReadBitsIn, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadBits>
|
/// <ModbusReadBits>
|
||||||
// This method will submit a request to the Modbus server to read coils
|
// This method will submit a request to the Modbus server to read coils
|
||||||
void ModbusReadOutBits(word address, long count)
|
void ModbusReadOutBits(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadBits(0x01, address, count);
|
_ModbusReadBits(ReadBitsOut, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadBits>
|
/// <ModbusReadBits>
|
||||||
// This method will submit a request to the Modbus server to read discrete inputs or coils
|
// This method will submit a request to the Modbus server to read discrete inputs or coils
|
||||||
void _ModbusReadBits(byte funcCode, word address, long count)
|
void _ModbusReadBits(enum ModbusFuncCode funcCode, word address, long count)
|
||||||
{
|
{
|
||||||
const byte length = __size_of(struct ModbusReqRead);
|
const byte length = __size_of(struct ModbusReqRead);
|
||||||
byte buffer[length];
|
byte buffer[length];
|
||||||
|
@ -186,23 +197,23 @@ void _OnModbusReceiveBitsException(struct ModbusApHeader mbap, enum ModbusExcept
|
||||||
// This method will submit a request to the Modbus server to read input registers
|
// This method will submit a request to the Modbus server to read input registers
|
||||||
void ModbusReadInRegisters(word address, long count)
|
void ModbusReadInRegisters(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadRegisters(0x04, address, count);
|
_ModbusReadRegisters(ReadRegistersIn, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadRegisters>
|
/// <ModbusReadRegisters>
|
||||||
// This method will submit a request to the Modbus server to read holding registers
|
// This method will submit a request to the Modbus server to read holding registers
|
||||||
void ModbusReadRegisters(word address, long count)
|
void ModbusReadRegisters(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadRegisters(0x04, address, count);
|
_ModbusReadRegisters(ReadRegistersIn, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadRegisters>
|
/// <ModbusReadRegisters>
|
||||||
// This method will submit a request to the Modbus server to read holding registers
|
// This method will submit a request to the Modbus server to read holding registers
|
||||||
void ModbusReadOutRegisters(word address, long count)
|
void ModbusReadOutRegisters(word address, long count)
|
||||||
{
|
{
|
||||||
_ModbusReadRegisters(0x03, address, count);
|
_ModbusReadRegisters(ReadRegistersOut, address, count);
|
||||||
}
|
}
|
||||||
/// <ModbusReadRegisters>
|
/// <ModbusReadRegisters>
|
||||||
// This method will submit a request to the Modbus server to read input or holding registers
|
// This method will submit a request to the Modbus server to read input or holding registers
|
||||||
void _ModbusReadRegisters(byte funcCode, word address, long count)
|
void _ModbusReadRegisters(enum ModbusFuncCode funcCode, word address, long count)
|
||||||
{
|
{
|
||||||
const byte length = __size_of(struct ModbusReqRead);
|
const byte length = __size_of(struct ModbusReqRead);
|
||||||
byte buffer[length];
|
byte buffer[length];
|
||||||
|
@ -261,7 +272,7 @@ void _OnModbusReceiveRegistersException(struct ModbusApHeader mbap, enum ModbusE
|
||||||
void ModbusWriteBit(word address, byte value)
|
void ModbusWriteBit(word address, byte value)
|
||||||
{
|
{
|
||||||
const byte length = __size_of(struct ModbusReqWriteSingle);
|
const byte length = __size_of(struct ModbusReqWriteSingle);
|
||||||
const byte funcCode = 0x05; // B&R does not support 0x06
|
enum ModbusFuncCode funcCode = WriteBit;
|
||||||
byte buffer[length];
|
byte buffer[length];
|
||||||
struct ModbusReqWriteSingle mbreq;
|
struct ModbusReqWriteSingle mbreq;
|
||||||
|
|
||||||
|
@ -312,7 +323,7 @@ void _OnModbusConfirmBitException(struct ModbusApHeader mbap, enum ModbusExcepti
|
||||||
void ModbusWriteRegister(word address, word value)
|
void ModbusWriteRegister(word address, word value)
|
||||||
{
|
{
|
||||||
const byte length = __size_of(struct ModbusReqWriteSingle);
|
const byte length = __size_of(struct ModbusReqWriteSingle);
|
||||||
const byte funcCode = 0x06;
|
enum ModbusFuncCode funcCode = WriteRegister;
|
||||||
byte buffer[length];
|
byte buffer[length];
|
||||||
struct ModbusReqWriteSingle mbreq;
|
struct ModbusReqWriteSingle mbreq;
|
||||||
|
|
||||||
|
@ -362,7 +373,7 @@ void _OnModbusConfirmRegisterException(struct ModbusApHeader mbap, enum ModbusEx
|
||||||
void ModbusWriteBits(word address, long count, byte values[])
|
void ModbusWriteBits(word address, long count, byte values[])
|
||||||
{
|
{
|
||||||
const word maxLength = __size_of(struct ModbusReqWriteBits);
|
const word maxLength = __size_of(struct ModbusReqWriteBits);
|
||||||
const byte funcCode = 0x0F;
|
enum ModbusFuncCode funcCode = WriteBits;
|
||||||
byte buffer[maxLength];
|
byte buffer[maxLength];
|
||||||
struct ModbusReqWriteBits mbreq;
|
struct ModbusReqWriteBits mbreq;
|
||||||
word curCount;
|
word curCount;
|
||||||
|
@ -411,11 +422,11 @@ void ModbusWriteBits(word address, long count, byte values[])
|
||||||
// Use this when you simply have 1s and 0s
|
// Use this when you simply have 1s and 0s
|
||||||
void ModbusWriteBitsB(word address, long count, byte values[])
|
void ModbusWriteBitsB(word address, long count, byte values[])
|
||||||
{
|
{
|
||||||
byte buffer[gMaxBitsPerWrite/8]; // length
|
byte buffer[0x4000/8]; // Maximum value from B&R devices. *sigh*
|
||||||
word length;
|
word length;
|
||||||
dword ellCount;
|
dword ellCount;
|
||||||
dword i;
|
dword i;
|
||||||
dword j;
|
byte j;
|
||||||
char str1[20*2], str2[20*3];
|
char str1[20*2], str2[20*3];
|
||||||
|
|
||||||
length = (word)_ceil(count / 8.0);
|
length = (word)_ceil(count / 8.0);
|
||||||
|
@ -479,7 +490,7 @@ void _OnModbusConfirmBitsException(struct ModbusApHeader mbap, enum ModbusExcept
|
||||||
void ModbusWriteRegisters(word address, long count, word values[])
|
void ModbusWriteRegisters(word address, long count, word values[])
|
||||||
{
|
{
|
||||||
const word maxLength = __size_of(struct ModbusReqWriteRegisters);
|
const word maxLength = __size_of(struct ModbusReqWriteRegisters);
|
||||||
const byte funcCode = 0x10;
|
enum ModbusFuncCode funcCode = WriteRegisters;
|
||||||
byte buffer[maxLength];
|
byte buffer[maxLength];
|
||||||
struct ModbusReqWriteRegisters mbreq;
|
struct ModbusReqWriteRegisters mbreq;
|
||||||
word curCount;
|
word curCount;
|
||||||
|
@ -547,7 +558,7 @@ void _OnModbusConfirmRegistersException(struct ModbusApHeader mbap, enum ModbusE
|
||||||
void ModbusWriteMasks(word address, word and, word or)
|
void ModbusWriteMasks(word address, word and, word or)
|
||||||
{
|
{
|
||||||
const word length = __size_of(struct ModbusReqWriteMasks);
|
const word length = __size_of(struct ModbusReqWriteMasks);
|
||||||
const byte funcCode = 0x16;
|
enum ModbusFuncCode funcCode = MaskRegister;
|
||||||
byte buffer[length];
|
byte buffer[length];
|
||||||
struct ModbusReqWriteMasks mbreq;
|
struct ModbusReqWriteMasks mbreq;
|
||||||
|
|
||||||
|
@ -593,7 +604,7 @@ void _OnModbusConfirmMasksException(struct ModbusApHeader mbap, enum ModbusExcep
|
||||||
void ModbusReadWriteRegisters(word readAddress, long readCount, word writeAddress, long writeCount, word values[])
|
void ModbusReadWriteRegisters(word readAddress, long readCount, word writeAddress, long writeCount, word values[])
|
||||||
{
|
{
|
||||||
const word maxLength = __size_of(struct ModbusReqReadWriteRegisters);
|
const word maxLength = __size_of(struct ModbusReqReadWriteRegisters);
|
||||||
const byte funcCode = 0x17;
|
enum ModbusFuncCode funcCode = ReadWriteRegisters;
|
||||||
byte buffer[maxLength];
|
byte buffer[maxLength];
|
||||||
struct ModbusReqReadWriteRegisters mbreq;
|
struct ModbusReqReadWriteRegisters mbreq;
|
||||||
byte dataLength;
|
byte dataLength;
|
||||||
|
@ -691,6 +702,7 @@ void _OnModbusReceive(dword socket, long result, dword address, dword port, byte
|
||||||
writeDbg(ConnError, "OnModbusReceive error (%d): %s", gIpLastErr, gIpLastErrStr);
|
writeDbg(ConnError, "OnModbusReceive error (%d): %s", gIpLastErr, gIpLastErrStr);
|
||||||
_ModbusDisconnect();
|
_ModbusDisconnect();
|
||||||
}
|
}
|
||||||
|
_ModbusRecv();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <-OnModbusReceive>
|
/// <-OnModbusReceive>
|
||||||
|
@ -708,8 +720,8 @@ void _OnModbusReceive2(byte buffer[], dword size)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
writeDbg(ConnDebug, "OnModbusReceive2: Offset pre = %d", offset);
|
|
||||||
memcpy_n2h(mbap, buffer, offset);
|
memcpy_n2h(mbap, buffer, offset);
|
||||||
|
writeDbg(ConnDebug, "OnModbusReceive2: Offset pre = %d. TxID = %d", offset, mbap.TxID);
|
||||||
_OnModbusReceive2OnePacket(buffer, offset, mbap);
|
_OnModbusReceive2OnePacket(buffer, offset, mbap);
|
||||||
|
|
||||||
offset += __offset_of(struct ModbusApHeader, UnitID) + mbap.Length;
|
offset += __offset_of(struct ModbusApHeader, UnitID) + mbap.Length;
|
||||||
|
@ -778,12 +790,12 @@ void _OnModbusReceive2Exceptions(byte exCode, struct ModbusApHeader mbap)
|
||||||
|
|
||||||
switch (mbap.FuncCode)
|
switch (mbap.FuncCode)
|
||||||
{
|
{
|
||||||
case 0x80+ReadBits1:
|
case 0x80+ReadBitsOut:
|
||||||
case 0x80+ReadBits2:
|
case 0x80+ReadBitsIn:
|
||||||
_OnModbusReceiveBitsException(mbap, ex);
|
_OnModbusReceiveBitsException(mbap, ex);
|
||||||
break;
|
break;
|
||||||
case 0x80+ReadRegisters1:
|
case 0x80+ReadRegistersOut:
|
||||||
case 0x80+ReadRegisters2:
|
case 0x80+ReadRegistersIn:
|
||||||
_OnModbusReceiveRegistersException(mbap, ex);
|
_OnModbusReceiveRegistersException(mbap, ex);
|
||||||
break;
|
break;
|
||||||
case 0x80+WriteBit:
|
case 0x80+WriteBit:
|
||||||
|
@ -819,12 +831,12 @@ void _OnModbusReceive2Success(byte buffer[], struct ModbusApHeader mbap, int off
|
||||||
// Let's give the PDU to the corresponding function
|
// Let's give the PDU to the corresponding function
|
||||||
switch (mbap.FuncCode)
|
switch (mbap.FuncCode)
|
||||||
{
|
{
|
||||||
case ReadBits1:
|
case ReadBitsOut:
|
||||||
case ReadBits2:
|
case ReadBitsIn:
|
||||||
_OnModbusReceiveBits(mbuffer);
|
_OnModbusReceiveBits(mbuffer);
|
||||||
break;
|
break;
|
||||||
case ReadRegisters1:
|
case ReadRegistersOut:
|
||||||
case ReadRegisters2:
|
case ReadRegistersIn:
|
||||||
_OnModbusReceiveRegisters(mbuffer);
|
_OnModbusReceiveRegisters(mbuffer);
|
||||||
break;
|
break;
|
||||||
case WriteBit:
|
case WriteBit:
|
||||||
|
@ -913,12 +925,12 @@ on timer gtModbusRobin
|
||||||
memcpy_n2h(mbap, gQueueSent[TxID].Buffer);
|
memcpy_n2h(mbap, gQueueSent[TxID].Buffer);
|
||||||
switch(mbap.FuncCode) // throw an "error" in each case
|
switch(mbap.FuncCode) // throw an "error" in each case
|
||||||
{
|
{
|
||||||
case ReadBits1:
|
case ReadBitsOut:
|
||||||
case ReadBits2:
|
case ReadBitsIn:
|
||||||
OnModbusReadBitsFailed(reqError, None, mbap);
|
OnModbusReadBitsFailed(reqError, None, mbap);
|
||||||
break;
|
break;
|
||||||
case ReadRegisters1:
|
case ReadRegistersOut:
|
||||||
case ReadRegisters2:
|
case ReadRegistersIn:
|
||||||
OnModbusReadRegistersFailed(reqError, None, mbap);
|
OnModbusReadRegistersFailed(reqError, None, mbap);
|
||||||
break;
|
break;
|
||||||
case WriteBit:
|
case WriteBit:
|
||||||
|
@ -948,13 +960,12 @@ on timer gtModbusRobin
|
||||||
// Second: send new packets
|
// Second: send new packets
|
||||||
for (long TxID : gQueuePending)
|
for (long TxID : gQueuePending)
|
||||||
{
|
{
|
||||||
if (gQueueSent.Size() >= gDevReceiveWindow) // Device cannot handle that many messages at a time
|
if (gQueueSent.Size() >= thisDev.ReceiveWindow) // Device cannot handle that many messages at a time
|
||||||
break; // Wait for the next turn
|
break; // Wait for the next turn
|
||||||
|
|
||||||
// Now send the packet
|
// Now send the packet
|
||||||
// if packet was sent or the socket is not currently being opened
|
// if packet was sent or the socket is not currently being opened
|
||||||
// what was that thing with the socket state? Somehow it was neccessary...
|
if (_ModbusSnd(gQueuePending[TxID].Buffer, gQueuePending[TxID].Length) == 0)
|
||||||
if (_ModbusSnd(gQueuePending[TxID].Buffer, gQueuePending[TxID].Length) == 0 || gSocketState != NULL)
|
|
||||||
{
|
{
|
||||||
memcpy(gQueueSent[TxID], gQueuePending[TxID]); // move packet to sent queue
|
memcpy(gQueueSent[TxID], gQueuePending[TxID]); // move packet to sent queue
|
||||||
gQueuePending.Remove(TxID);
|
gQueuePending.Remove(TxID);
|
||||||
|
|
|
@ -40,7 +40,7 @@ word _ModbusConnectTo(char Remote_IP[], word remotePort)
|
||||||
return ipGetLastError();
|
return ipGetLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ModbusConnectTo(remoteIp, remotePort);
|
return _ModbusConnectTo(remoteIp, remotePort);
|
||||||
}
|
}
|
||||||
// This method prepares anything in a way that sending with ModbusSnd() is possible.
|
// This method prepares anything in a way that sending with ModbusSnd() is possible.
|
||||||
// Here: The method will create an ARP telegram to get the MAC address of the device with the specified remoteIp
|
// Here: The method will create an ARP telegram to get the MAC address of the device with the specified remoteIp
|
||||||
|
@ -63,7 +63,7 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
|
||||||
gRemoteIP = (remoteIp >> 24) | (remoteIp >> 8) & 0x0000FF00 | (remoteIp << 8) & 0x00FF0000 | (remoteIp << 24);
|
gRemoteIP = (remoteIp >> 24) | (remoteIp >> 8) & 0x0000FF00 | (remoteIp << 8) & 0x00FF0000 | (remoteIp << 24);
|
||||||
|
|
||||||
if (gPacket != 0)
|
if (gPacket != 0)
|
||||||
ModbusDisconnect();
|
_ModbusDisconnect();
|
||||||
// Try to create an ARP packet that gets the MAC from remote server
|
// Try to create an ARP packet that gets the MAC from remote server
|
||||||
gPacket = EthInitPacket("arp");
|
gPacket = EthInitPacket("arp");
|
||||||
if (gPacket == 0)
|
if (gPacket == 0)
|
||||||
|
@ -145,7 +145,7 @@ byte _ModbusSnd(byte buffer[], word length)
|
||||||
switch (gSocketState)
|
switch (gSocketState)
|
||||||
{
|
{
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
ModbusConnectTo(gRemoteIP, gRemotePort);
|
_ModbusConnectTo(gRemoteIP, gRemotePort);
|
||||||
if (gSocketState != OK)
|
if (gSocketState != OK)
|
||||||
{
|
{
|
||||||
writeDbg(ConnWarning, "EilSnd: Reconnecting failed! Doing nothing.");
|
writeDbg(ConnWarning, "EilSnd: Reconnecting failed! Doing nothing.");
|
||||||
|
|
|
@ -7,6 +7,20 @@ variables
|
||||||
const word gMaxBitsPerWrite = 1968; // Multiple of 8!
|
const word gMaxBitsPerWrite = 1968; // Multiple of 8!
|
||||||
const word gMaxRegsPerWrite = 123;
|
const word gMaxRegsPerWrite = 123;
|
||||||
|
|
||||||
|
enum ModbusFuncCode
|
||||||
|
{
|
||||||
|
ReadBitsOut = 0x01,
|
||||||
|
ReadBitsIn = 0x02,
|
||||||
|
ReadRegistersOut = 0x03,
|
||||||
|
ReadRegistersIn = 0x04,
|
||||||
|
WriteBit = 0x05,
|
||||||
|
WriteRegister = 0x06,
|
||||||
|
WriteBits = 0x0F,
|
||||||
|
WriteRegisters = 0x10,
|
||||||
|
MaskRegister = 0x16,
|
||||||
|
ReadWriteRegisters = 0x17
|
||||||
|
};
|
||||||
|
|
||||||
// A normal Modbus Application Header. Every Modbus Packet begins with these 7 (+FuncCode) Bytes
|
// A normal Modbus Application Header. Every Modbus Packet begins with these 7 (+FuncCode) Bytes
|
||||||
_align(1) struct ModbusApHeader
|
_align(1) struct ModbusApHeader
|
||||||
{
|
{
|
||||||
|
@ -127,27 +141,12 @@ variables
|
||||||
GatewayPathsNA = 0x0A,
|
GatewayPathsNA = 0x0A,
|
||||||
TargetOffline = 0x0B
|
TargetOffline = 0x0B
|
||||||
};
|
};
|
||||||
enum ModbusFuncCode
|
|
||||||
{
|
|
||||||
ReadBits1 = 0x01,
|
|
||||||
ReadBits2 = 0x02,
|
|
||||||
ReadRegisters1 = 0x03,
|
|
||||||
ReadRegisters2 = 0x04,
|
|
||||||
WriteBit = 0x05,
|
|
||||||
WriteRegister = 0x06,
|
|
||||||
WriteBits = 0x0F,
|
|
||||||
WriteRegisters = 0x10,
|
|
||||||
MaskRegister = 0x16,
|
|
||||||
ReadWriteRegisters = 0x17
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum FatalErrors
|
enum FatalErrors
|
||||||
{
|
{
|
||||||
ParsingBuffer = 0x00,
|
ParsingBuffer,
|
||||||
ModbusPackageWasSplit = 0x01,
|
ModbusPackageWasSplit,
|
||||||
DeviceCodeUnknown = 0x02,
|
DeviceCodeUnknown,
|
||||||
VendorIdUnknown = 0x03,
|
VendorIdUnknown,
|
||||||
ConnectionError = 0x04
|
ConnectionError
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -28,7 +28,7 @@ word _TcpOpenSocket()
|
||||||
|
|
||||||
if (EthGetAdapterStatus() != 2) // Not connected
|
if (EthGetAdapterStatus() != 2) // Not connected
|
||||||
{
|
{
|
||||||
writeDbg(ConnError, "TcpOpenSocket: Adapter status not ok: %d!", EthGetAdapterStatus());
|
writeDbg(ConnError, "_TcpOpenSocket: Adapter status not ok: %d!", EthGetAdapterStatus());
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return INVALID_IP;
|
return INVALID_IP;
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,13 @@ word _TcpOpenSocket()
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
{
|
{
|
||||||
gSocket.GetLastSocketErrorAsString(errorText, elcount(errorText));
|
gSocket.GetLastSocketErrorAsString(errorText, elcount(errorText));
|
||||||
writeDbg(ConnInfo, "TcpOpenSocket: could not open socket: (%d) %s", error, errorText);
|
writeDbg(ConnInfo, "_TcpOpenSocket: could not open socket: (%d) %s", error, errorText);
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writeDbg(ConnInfo, "Tcp socket opened.");
|
writeDbg(ConnInfo, "_TcpOpenSocket: Tcp socket opened.");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ word _ModbusConnectTo(char Remote_IP[], word remotePort)
|
||||||
remoteIp = IpGetAddressAsNumber(Remote_IP);
|
remoteIp = IpGetAddressAsNumber(Remote_IP);
|
||||||
if (remoteIp == INVALID_IP)
|
if (remoteIp == INVALID_IP)
|
||||||
{
|
{
|
||||||
writeDbg(ConnError, "TcpConnectTo: invalid server Ip address: %s", Remote_IP);
|
writeDbg(ConnError, "_ModbusConnectTo: invalid server Ip address: %s", Remote_IP);
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
|
||||||
long fehler;
|
long fehler;
|
||||||
|
|
||||||
// Try to open a socket
|
// Try to open a socket
|
||||||
fehler = TcpOpenSocket();
|
fehler = _TcpOpenSocket();
|
||||||
if (fehler != 0)
|
if (fehler != 0)
|
||||||
{
|
{
|
||||||
gSocketState = ERROR;
|
gSocketState = ERROR;
|
||||||
|
@ -93,16 +93,21 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
|
||||||
|
|
||||||
if (fehler != WSAEWOULDBLOCK) // OnTcpConnect will be called otherwise
|
if (fehler != WSAEWOULDBLOCK) // OnTcpConnect will be called otherwise
|
||||||
{
|
{
|
||||||
writeDbg(ConnError, "TcpConnectTo: No connection established: %d", fehler);
|
writeDbg(ConnError, "_ModbusConnectTo: No connection established: %d", fehler);
|
||||||
gSocketState = ERROR;
|
gSocketState = ERROR;
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return fehler;
|
return fehler;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writeDbg(ConnDebug, "_ModbusConnectTo: WSAE would block");
|
||||||
|
gSocketState = NULL;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writeDbg(ConnInfo, "TcpConnectTo: Successfully connected to server");
|
writeDbg(ConnInfo, "_ModbusConnectTo: Successfully connected to server");
|
||||||
gSocketState = OK;
|
gSocketState = OK;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -110,21 +115,21 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
|
||||||
|
|
||||||
// This method will be called when TcpSocket.Connect() had to defer the result (and returned WSAEWOULDBLOCK).
|
// This method will be called when TcpSocket.Connect() had to defer the result (and returned WSAEWOULDBLOCK).
|
||||||
// It checks whether the connection was opened successfully and sets the socket state accordingly
|
// It checks whether the connection was opened successfully and sets the socket state accordingly
|
||||||
void _OnTcpConnect(dword socket, long result)
|
void OnTcpConnect(dword socket, long result)
|
||||||
{
|
{
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
||||||
writeDbg(ConnError, "OnTcpConnect: (%d) %s", gSocket.GetLastSocketError(), gIpLastErrStr);
|
writeDbg(ConnError, "OnTcpConnect: (%d) %s", gSocket.GetLastSocketError(), gIpLastErrStr);
|
||||||
gSocketState = ERROR;
|
gSocketState = ERROR;
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writeDbg(ConnInfo, "OnTcpConnect: Successfully connected to server");
|
writeDbg(ConnInfo, "OnTcpConnect: Successfully connected to server");
|
||||||
gSocketState = OK;
|
gSocketState = OK;
|
||||||
ModbusStartQueue();
|
_ModbusStartQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +137,7 @@ void _OnTcpConnect(dword socket, long result)
|
||||||
// Here: Simply close the socket. This will also disconnect the remote device
|
// Here: Simply close the socket. This will also disconnect the remote device
|
||||||
void _ModbusDisconnect()
|
void _ModbusDisconnect()
|
||||||
{
|
{
|
||||||
|
writeDbg(ConnDebug, "_ModbusDisconnect: Disconnecting");
|
||||||
gSocket.Close();
|
gSocket.Close();
|
||||||
gSocketState = CLOSED;
|
gSocketState = CLOSED;
|
||||||
}
|
}
|
||||||
|
@ -144,8 +150,9 @@ void _ModbusRecv()
|
||||||
|
|
||||||
if (gSocketState != OK)
|
if (gSocketState != OK)
|
||||||
{
|
{
|
||||||
writeDbg(ConnWarning, "ModbusRecv: Socket status is not OK! Doing nothing.");
|
writeDbg(ConnWarning, "_ModbusRecv: Socket status is not OK!");
|
||||||
OnModbusClientPanics(ConnectionError);
|
_ModbusDisconnect();
|
||||||
|
// OnModbusClientPanics(ConnectionError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,8 +165,8 @@ void _ModbusRecv()
|
||||||
if (gIpLastErr != WSA_IO_PENDING) // Calling OnTcpReceive otherwise
|
if (gIpLastErr != WSA_IO_PENDING) // Calling OnTcpReceive otherwise
|
||||||
{
|
{
|
||||||
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
||||||
writeDbg(ConnError, "ModbusRecv: (%d) %s", gIpLastErr, gIpLastErrStr);
|
writeDbg(ConnError, "_ModbusRecv: (%d) %s", gIpLastErr, gIpLastErrStr);
|
||||||
ModbusDisconnect();
|
_ModbusDisconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,20 +185,25 @@ word _ModbusSnd(byte buffer[], word length)
|
||||||
_ModbusConnectTo(gRemoteIP, gRemotePort); // Try to (re)connect
|
_ModbusConnectTo(gRemoteIP, gRemotePort); // Try to (re)connect
|
||||||
if (gSocketState != OK) // If this didn't work
|
if (gSocketState != OK) // If this didn't work
|
||||||
{
|
{
|
||||||
writeDbg(ConnError, "ModbusSnd: Reconnecting failed!");
|
if (gSocketState != NULL) // not WSAE WOULD BLOCK
|
||||||
OnModbusClientPanics(ConnectionError);
|
{
|
||||||
|
writeDbg(ConnError, "_ModbusSnd: Reconnecting failed!");
|
||||||
|
OnModbusClientPanics(ConnectionError);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
case OK:
|
case OK:
|
||||||
break;
|
break;
|
||||||
|
case NULL:
|
||||||
|
return 1;
|
||||||
default:
|
default:
|
||||||
writeDbg(ConnError, "ModbusSnd: Socket status is not OK! Doing nothing.");
|
writeDbg(ConnError, "_ModbusSnd: Socket status is not OK!");
|
||||||
OnModbusClientPanics(ConnectionError);
|
OnModbusClientPanics(ConnectionError);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bin_to_strhex(buffer, str);
|
bin_to_strhex(buffer, str);
|
||||||
writeDbg(ConnDebug, "ModbusSnd: %s (Länge: %d)", str, length);
|
writeDbg(ConnDebug, "_ModbusSnd: %s (Länge: %d)", str, length);
|
||||||
|
|
||||||
if (gSocket.Send(buffer, length) != 0)
|
if (gSocket.Send(buffer, length) != 0)
|
||||||
{
|
{
|
||||||
|
@ -200,8 +212,8 @@ word _ModbusSnd(byte buffer[], word length)
|
||||||
if (gIpLastErr != WSA_IO_PENDING)
|
if (gIpLastErr != WSA_IO_PENDING)
|
||||||
{
|
{
|
||||||
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
gSocket.GetLastSocketErrorAsString(gIpLastErrStr, elcount(gIpLastErrStr));
|
||||||
writeDbg(ConnError, "ModbusSnd: (%d) %s", gIpLastErr, gIpLastErrStr);
|
writeDbg(ConnError, "_ModbusSnd: (%d) %s", gIpLastErr, gIpLastErrStr);
|
||||||
ModbusDisconnect();
|
_ModbusDisconnect();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
// else: tough luck!
|
// else: tough luck!
|
||||||
|
|
Loading…
Reference in a new issue