DeviceInformation.cin

Improved device structure
This commit is contained in:
Jonny007-MKD 2014-07-10 07:56:55 +00:00
parent decc7357e7
commit 3e3a24a2a3
11 changed files with 279 additions and 227 deletions

View file

@ -1,4 +1,4 @@
;CANoe Version |4|7|1|35761 MakeConfig ;CANoe Version |4|7|1|52132 MakeConfig
Version: 8.2.40 Build 40 Version: 8.2.40 Build 40
32 PRO 32 PRO
5 5
@ -348,7 +348,7 @@ VCaplOptionsStreamer 3 Begin_Of_Object
End_Of_Object VCaplOptionsStreamer 3 End_Of_Object VCaplOptionsStreamer 3
VSVConfigurationStreamer 3 Begin_Of_Object VSVConfigurationStreamer 3 Begin_Of_Object
1 1
829 830
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<systemvariables version="4"> <systemvariables version="4">
<namespace name="" comment=""> <namespace name="" comment="">
@ -356,7 +356,7 @@ VSVConfigurationStreamer 3 Begin_Of_Object
<namespace name="Modbus" comment=""> <namespace name="Modbus" comment="">
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Port" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="502" /> <variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Port" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="502" />
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="MaxTransmissionCount" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="2" /> <variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="MaxTransmissionCount" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="2" />
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="ms" name="RequestTimeout" comment="" bitcount="0" isSigned="true" encoding="65001" type="int" startValue="10" /> <variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="ms" name="RequestTimeout" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="10" />
</namespace> </namespace>
</namespace> </namespace>
</namespace> </namespace>
@ -1261,37 +1261,9 @@ Grafik-Fenster
237 237
0 0
0 0
1
0 0
0 0
0 0
-11
0
0
0
0
0
0
0
400
0
Tahoma
0
1
0
0
0
-11
0
0
0
34
0
0
0
400
0
Tahoma
0 0
1 1
1 1
@ -2961,7 +2933,7 @@ End_Of_Object VGrMnBox 3
VDOLocalInfoStruct 3 Begin_Of_Object VDOLocalInfoStruct 3 Begin_Of_Object
3 3
1 1
95 98
VDAOBus 4 Begin_Of_Object VDAOBus 4 Begin_Of_Object
1 1
1 1
@ -3091,7 +3063,7 @@ VSimulinkModelViewerConfiguration 7 Begin_Of_Object
End_Of_Object VSimulinkModelViewerConfiguration 7 End_Of_Object VSimulinkModelViewerConfiguration 7
1 1
0 0
580410699 4212996857
0 0
NodeSignalPanelBustypeCount 0 NodeSignalPanelBustypeCount 0
End_Of_Object VSimulationNode 6 End_Of_Object VSimulationNode 6
@ -3129,7 +3101,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 233 1 2882400001 98 331 371 619 2882400002 0 0 0 0 0 0 1 2882400001 1270 1270 373 373 2882400002 0 0 0 408326576 0 407053980 3 1 1 0 59420 1 233 1 2882400001 98 331 371 619 2882400002 0 0 0 0 0 0 1 2882400001 1270 1270 373 373 2882400002 0 0 0 335238400 0 336542644 3
SS_BEGIN_COMMON_INFO SS_BEGIN_COMMON_INFO
1 1
0 0
@ -3141,7 +3113,7 @@ Ethernet
11 11
1 1
1 1
408424704 1 0 1 0 0 1 0 0 0 2000 1 335879144 1 0 1 0 0 1 0 0 0 2000 1
SS_BEGIN_COMMON_INFO SS_BEGIN_COMMON_INFO
1 1
3 3
@ -3252,7 +3224,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
@ -3564,6 +3536,7 @@ End
FiltersEnd FiltersEnd
0 0 0 0
END_OF_WORKSPACE_MEMBER_DATA END_OF_WORKSPACE_MEMBER_DATA
END_OF_WORKSPACE_MEMBER END_OF_WORKSPACE_MEMBER
1 1

View file

@ -1,4 +1,4 @@
;CANoe Version |4|7|1|38817 ModbusNet ;CANoe Version |4|7|1|55205 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="{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 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
kPersistNoLineBreak kPersistNoLineBreak
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> 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>
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
@ -4880,10 +4880,10 @@ MDI_DOCK_INFO_END
0 1 -1 -1 -8 -30 0 0 890 487 0 1 -1 -1 -8 -30 0 0 890 487
6 3 0 0 0 0 0 0 890 483 0 0 1 20372 1904 0 0 0 0 0 0 0 0 -1 -1 32767 0 0 0 0 0 0 0 347 323 1 0 0 0 1 641 0 59421 1 6 3 0 0 0 0 0 0 890 483 0 0 1 20372 1904 0 0 0 0 0 0 0 0 -1 -1 32767 0 0 0 0 0 0 0 347 323 1 0 0 0 1 641 0 59421 1
END_OF_DOCK_INFO END_OF_DOCK_INFO
0 1
0 0
1 1
0 1 -1 -1 -1 -1 -293 402 601 893 0 1 -1 -1 -1 -1 240 244 1134 735
0 0
1 1
776 389 776 389
@ -4937,7 +4937,7 @@ End_Of_Object VGrMnBox 3
VDOLocalInfoStruct 3 Begin_Of_Object VDOLocalInfoStruct 3 Begin_Of_Object
3 3
1 1
243 248
VDAOBus 4 Begin_Of_Object VDAOBus 4 Begin_Of_Object
1 1
1 1
@ -5200,7 +5200,7 @@ VBoxRoot 12 Begin_Of_Object
1 1
3 3
1 -1 2 3 -1 -1 -8 -30 171 76 688 306 1 -1 2 3 -1 -1 -8 -30 171 76 688 306
Debugger - Client_2 Debugger - Client_100
1 1
MDI_DOCK_INFO_END MDI_DOCK_INFO_END
@ -5441,7 +5441,7 @@ VSimulinkModelViewerConfiguration 7 Begin_Of_Object
End_Of_Object VSimulinkModelViewerConfiguration 7 End_Of_Object VSimulinkModelViewerConfiguration 7
1 1
0 0
1368551005 498267762
0 0
NodeSignalPanelBustypeCount 0 NodeSignalPanelBustypeCount 0
End_Of_Object VSimulationNode 6 End_Of_Object VSimulationNode 6
@ -5576,7 +5576,7 @@ VSimulinkModelViewerConfiguration 7 Begin_Of_Object
End_Of_Object VSimulinkModelViewerConfiguration 7 End_Of_Object VSimulinkModelViewerConfiguration 7
1 1
0 0
1368551005 498267762
0 0
NodeSignalPanelBustypeCount 0 NodeSignalPanelBustypeCount 0
End_Of_Object VSimulationNode 6 End_Of_Object VSimulationNode 6
@ -5609,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
@ -5687,11 +5687,105 @@ 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="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.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.SE id="5" intVal="0" key="1702391908"/> <IPPlugIn.SE id="102" intVal="0" key="1919247220"/>
<IPPlugIn.SE id="5" index="1" intVal="0" key="1702391908"/> <IPPlugIn.SE id="102" index="1" intVal="986" key="1919247220"/>
<IPPlugIn.SE id="5" index="2" intVal="0" key="1702391908"/> <IPPlugIn.SE id="102" index="2" intVal="0" key="1919247220"/>
<IPPlugIn.SE id="5" index="3" intVal="0" key="1702391908"/> <IPPlugIn.SE id="102" index="3" intVal="507" key="1919247220"/>
<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"/>
@ -5702,104 +5796,10 @@ 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="1003" intVal="0" key="2003072104"/> <IPPlugIn.SE id="5" intVal="0" key="1702391908"/>
<IPPlugIn.SE id="1003" intVal="0" key="1886352248"/> <IPPlugIn.SE id="5" index="1" intVal="0" key="1702391908"/>
<IPPlugIn.SE id="1003" intVal="0" key="1886352249"/> <IPPlugIn.SE id="5" index="2" intVal="0" key="1702391908"/>
<IPPlugIn.SE id="127" intVal="0" key="1651534958"/> <IPPlugIn.SE id="5" index="3" intVal="0" key="1702391908"/>
<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
@ -5835,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 681 881 432 632 2882400002 0 0 0 0 0 0 3 1 1 0 59420 1 176 1 2882400001 336 512 272 727 2882400002 0 0 0 0 0 0 1 2882400001 1214 1214 274 274 2882400002 0 0 0 355173464 355403088 354462900 3
SS_BEGIN_COMMON_INFO SS_BEGIN_COMMON_INFO
1 1
0 0
@ -5847,7 +5847,7 @@ Ether1
11 11
1 1
1 1
0 1 0 1 0 1 1 0 0 0 2000 1 421824208 1 0 1 0 1 1 0 0 0 2000 1
SS_BEGIN_COMMON_INFO SS_BEGIN_COMMON_INFO
1 1
3 3
@ -5958,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 -1 -1 -1 -1 -10088 -10000 -9070 -9233 22 2 3 -32088 -32000 -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
@ -6279,6 +6279,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

View file

@ -2,7 +2,8 @@
includes includes
{ {
#include "include/DeviceInformation.cin" #include "include/DeviceInformation.cin"
#include "include/ModbusUdpClientCommon.cin" #include "include/ModbusUdp.cin"
#include "include/ModbusClient.cin"
} }
variables variables
@ -23,22 +24,22 @@ variables
dword gScanFirst, gScanLast; // The first and last IP address as dword dword gScanFirst, gScanLast; // The first and last IP address as dword
word ADi, ADn, ADl; // Some variables for "AnalyzeDevices" word ADi, ADn, ADl; // Some variables for "AnalyzeDevices"
byte gMaxTransmissionCount; byte ggMaxTransmissionCount;
} }
on preStart on preStart
{ {
// List of IPs of devices go here byte i = 0;
// List of IPs of devices goes here
strncpy(gIps[0], "192.168.1.100", 16); ///strncpy(gIps[i++], "192.168.1.100", elCount(gIps));
strncpy(gIps[2], "192.168.1.101", 16); ///strncpy(gIps[i++], "192.168.1.101", elCount(gIps));
strncpy(gIps[1], "192.168.100.2", 16); ///strncpy(gIps[i++], "192.168.100.2", elCount(gIps));
//strncpy(gIps[3], "192.168.1.8", 16); ///strncpy(gIps[i++], "192.168.1.8", elCount(gIps));
// Scan a range of IPs for devices (if nothing was set above). Start and Stop go here // Scan a range of IPs for devices (if nothing was set above). Start and Stop go here
// Please note: Currently .255 will be skipped! Don't use it for devices // Please note: Currently .255 will be skipped! Don't use this address for devices
strncpy(gScanFirstIp, "192.168.1.2", 16); strncpy(gScanFirstIp, "192.168.1.2", elCount(gScanFirstIp));
strncpy(gScanLastIp, "192.168.1.20", 16); strncpy(gScanLastIp, "192.168.1.20", elCount(gScanLastIp));
// Name of the project // Name of the project
strncpy(name, "Modbus", elCount(name)); strncpy(name, "Modbus", elCount(name));
@ -47,14 +48,14 @@ on preStart
strncpy(fnSysvar, "include/SysVars/generated.vsysvar", elCount(fnSysvar)); strncpy(fnSysvar, "include/SysVars/generated.vsysvar", elCount(fnSysvar));
strncpy(fnDbc, "include/DBC/generated.dbc", elCount(fnDbc)); strncpy(fnDbc, "include/DBC/generated.dbc", elCount(fnDbc));
OutputDebugLevel = Error; OutputDebugLevel = Debug;//Error;
} }
on start on start
{ {
gMaxTransmissionCount = @sysvar::Config::Modbus::MaxTransmissionCount; // save the value ggMaxTransmissionCount = @sysvar::Config::Modbus::MaxTransmissionCount; // save the value
@sysvar::Config::Modbus::MaxTransmissionCount = 1; // and then don't retransmit
DeviceInit(All);
if (gIps.Size() == 0) // if no IP address were specified if (gIps.Size() == 0) // if no IP address were specified
DetectDevices(); // scan network for devices (Step1) DetectDevices(); // scan network for devices (Step1)
else else
@ -88,11 +89,11 @@ void DetectDevices()
{ {
write("Scanning from %s to %s with timeout of %d ms", gScanFirstIp, gScanLastIp, @sysvar::Config::Modbus::RequestTimeout); write("Scanning from %s to %s with timeout of %d ms", gScanFirstIp, gScanLastIp, @sysvar::Config::Modbus::RequestTimeout);
gScanFirst = ipGetAddressAsNumber(gScanFirstIp); // We have to use big endian here gScanFirst = ipGetAddressAsNumber(gScanFirstIp); // We have to use big endian here
gScanLast = swapDWord(ipGetAddressAsNumber(gScanLastIp)); // But not here :) gScanLast = swapDWord(ipGetAddressAsNumber(gScanLastIp)); // But not here :)
writeLineEx(0, 0, "%d.%d.%d.%d ", gScanFirst & 0xFF, (gScanFirst >> 8) & 0xFF, (gScanFirst >> 16) & 0xFF, gScanFirst >> 24); writeLineEx(0, 0, "%d.%d.%d.%d ", gScanFirst & 0xFF, (gScanFirst >> 8) & 0xFF, (gScanFirst >> 16) & 0xFF, gScanFirst >> 24);
ModbusConnectTo(gScanFirst, @sysvar::Config::Modbus::Port); // Open socket and set variables ModbusInit(gScanFirstIp, @sysvar::Config::Modbus::Port, @sysvar::Config::Modbus::RequestTimeout, 1); // Open socket and set variables
ModbusReadBits(0, 1); // Start device detection ModbusReadBits(0, 1); // Start device detection
} }
// This function will increment the IP address and continue the detection // This function will increment the IP address and continue the detection
@ -101,7 +102,7 @@ void DetectDevicesNext()
{ {
gScanFirst = swapDWord(gScanFirst); gScanFirst = swapDWord(gScanFirst);
gScanFirst++; gScanFirst++;
if ((gScanFirst & 0xFF) == 0xFF) // .255 if ((gScanFirst & 0xFF) == 0xFF) // skip .255
{ {
gScanFirst++; gScanFirst++;
writeLineEx(0, 0, "%d.%d.%d.%d ", gScanFirst >> 24, (gScanFirst >> 16) & 0xFF, (gScanFirst >> 8) & 0xFF, gScanFirst & 0xFF); writeLineEx(0, 0, "%d.%d.%d.%d ", gScanFirst >> 24, (gScanFirst >> 16) & 0xFF, (gScanFirst >> 8) & 0xFF, gScanFirst & 0xFF);
@ -109,7 +110,7 @@ void DetectDevicesNext()
if (gScanFirst > gScanLast) if (gScanFirst > gScanLast)
{ {
@sysvar::Config::Modbus::MaxTransmissionCount = gMaxTransmissionCount; @sysvar::Config::Modbus::MaxTransmissionCount = ggMaxTransmissionCount;
MakeIpNets(); MakeIpNets();
return; return;
} }
@ -147,6 +148,7 @@ void MakeIpNets()
if (gIps.Size() == 0) // If no devices were specified and detected if (gIps.Size() == 0) // If no devices were specified and detected
{ {
writeDbg(MbError, "No devices found!");
stop(); // Don't do anything stop(); // Don't do anything
return; return;
} }
@ -183,7 +185,7 @@ void AnalyzeDevices()
if (gRemoteIP != INVALID_IP) // If we already do have a socket if (gRemoteIP != INVALID_IP) // If we already do have a socket
gRemoteIP = ips[ADi]; // use it gRemoteIP = ips[ADi]; // use it
else // else create a new one else // else create a new one
ModbusConnectTo(ips[ADi], @sysvar::Config::Modbus::Port); _ModbusConnectTo(ips[ADi], @sysvar::Config::Modbus::Port);
// request something special to get the vendor // request something special to get the vendor
// since there is no common register that holds the vendor // since there is no common register that holds the vendor
@ -227,7 +229,7 @@ void OnModbusReadRegistersFailed(enum ModbusRequestError error, enum ModbusExcep
{ {
gIpsSorted[ips[ADi]].Vendor = Wago; gIpsSorted[ips[ADi]].Vendor = Wago;
// request information // request information
ADn = DeviceGetInformation(Wago); ADn = _DeviceGetInformation(Wago);
return; return;
} }
@ -251,11 +253,11 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
gIpsSorted[ips[ADi]].Vendor = BuR; gIpsSorted[ips[ADi]].Vendor = BuR;
// request further information // request further information
ADn = DeviceGetInformation(BuR); ADn = _DeviceGetInformation(BuR);
return; return;
} }
DeviceParseRegister(gIpsSorted[ips[ADi]], mbreq.Address, mbres.Data, mbreq.Count); _DeviceParseRegister(gIpsSorted[ips[ADi]], mbreq.Address, mbres.Data, mbreq.Count);
if (--ADn == 0) // If we received all registers if (--ADn == 0) // If we received all registers
AnalyzeDevicesNext(); AnalyzeDevicesNext();
@ -359,33 +361,33 @@ void GenSysvars()
PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"InputRegisters\" comment=\"Number of input registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\""); PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"InputRegisters\" comment=\"Number of input registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"");
PutString(gIpsSorted[ipN].DeviceIOs.InputRegisters); PutString(gIpsSorted[ipN].DeviceIOs.InputRegisters);
PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\""); PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"");
PutString((word)gDevRegMaxCount); PutString((word)thisDev.MaxRegisterCount);
PutString("\" maxValuePhys=\""); PutString("\" maxValuePhys=\"");
PutString((word)gDevRegMaxCount); PutString((word)thisDev.MaxRegisterCount);
PutString("\" />\n"); PutString("\" />\n");
// InputBits // InputBits
PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"InputBits\" comment=\"Number of input bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\""); PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"InputBits\" comment=\"Number of input bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"");
PutString(gIpsSorted[ipN].DeviceIOs.InputBits); PutString(gIpsSorted[ipN].DeviceIOs.InputBits);
PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\""); PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"");
PutString((word)gDevBitMaxCount); PutString((word)thisDev.MaxBitCount);
PutString("\" maxValuePhys=\""); PutString("\" maxValuePhys=\"");
PutString((word)gDevBitMaxCount); PutString((word)thisDev.MaxBitCount);
PutString("\" />\n"); PutString("\" />\n");
// OutputRegisters // OutputRegisters
PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"OutputRegisters\" comment=\"Number of output registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\""); PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"OutputRegisters\" comment=\"Number of output registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"");
PutString(gIpsSorted[ipN].DeviceIOs.OutputRegisters); PutString(gIpsSorted[ipN].DeviceIOs.OutputRegisters);
PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\""); PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"");
PutString((word)gDevRegMaxCount); PutString((word)thisDev.MaxRegisterCount);
PutString("\" maxValuePhys=\""); PutString("\" maxValuePhys=\"");
PutString((word)gDevRegMaxCount); PutString((word)thisDev.MaxRegisterCount);
PutString("\" />\n"); PutString("\" />\n");
// OutputBits // OutputBits
PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"OutputBits\" comment=\"Number of output bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\""); PutString(" <variable anlyzLocal=\"2\" readOnly=\"true\" valueSequence=\"false\" unit=\"\" name=\"OutputBits\" comment=\"Number of output bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"");
PutString(gIpsSorted[ipN].DeviceIOs.OutputBits); PutString(gIpsSorted[ipN].DeviceIOs.OutputBits);
PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\""); PutString("\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"");
PutString((word)gDevBitMaxCount); PutString((word)thisDev.MaxBitCount);
PutString("\" maxValuePhys=\""); PutString("\" maxValuePhys=\"");
PutString((word)gDevBitMaxCount); PutString((word)thisDev.MaxBitCount);
PutString("\" />\n"); PutString("\" />\n");
PutString(" </namespace>\n"); PutString(" </namespace>\n");

View file

@ -34,13 +34,22 @@ 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(thisDev.Address.Read.OutputBit, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputBits); // Read the start status of the output bits if (gSocketState < CONNECTING) // We are not connecting and not connected
ModbusReadOutRegisters(thisDev.Address.Read.OutputReg, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputRegisters); // Read the start status of the output registers return;
ModbusReadOutBits(thisDev.Addr.Read.OutputBits, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::OutputBits); // Read the start status of the output bits
ModbusReadOutRegisters(thisDev.Addr.Read.OutputRegisters, @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);
} }
// Stop all transactions and close connection
on preStop
{
ModbusEnd();
}
// Modbus events ---------------------------------------------------------------------- // Modbus events ----------------------------------------------------------------------
/// All these events will be called by functions out of ModbusClientCommon.cin /// All these events will be called by functions out of ModbusClientCommon.cin
@ -119,7 +128,7 @@ void OnModbusReadBitsSuccess(struct ModbusResReceiveBits mbres, byte bitStatus[]
case ReadBitsOut: // 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 - thisDev.Address.Read.OutputBit; // Get the offset to the base output bit address offset = mbreq.Address - thisDev.Addr.Read.OutputBits; // 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];
@ -130,7 +139,7 @@ void OnModbusReadBitsSuccess(struct ModbusResReceiveBits mbres, byte bitStatus[]
case ReadBitsIn: // 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 - thisDev.Address.Read.InputBit; // Get the offset to the base input bit address offset = mbreq.Address - thisDev.Addr.Read.InputBits; // 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];
@ -149,7 +158,7 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
case ReadRegistersOut: // 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 - thisDev.Address.Read.OutputReg; // Get the offset to the base output register address offset = mbreq.Address - thisDev.Addr.Read.OutputRegisters; // 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];
@ -160,7 +169,7 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
case ReadRegistersIn: // 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 - thisDev.Address.Read.InputReg; // Get the offset to the base input bit address offset = mbreq.Address - thisDev.Addr.Read.InputRegisters; // 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];
@ -185,15 +194,30 @@ void OnModbusWriteMasksSuccess(struct ModbusResConfirmMasks mbres){}
// It will pass as argument what happened. Please see the log (increase debug level in preStart) for more details. // It will pass as argument what happened. Please see the log (increase debug level in preStart) for more details.
void OnModbusClientPanics(enum FatalErrors reason) void OnModbusClientPanics(enum FatalErrors reason)
{ {
writeLineEx(0, 4, "<%NODE_NAME%> FATAL! %d", reason);
switch(reason) switch(reason)
{ {
case ParsingBuffer: case ParsingBuffer:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Error while parsing the received buffer", reason);
runError(1001, reason);
break;
case ModbusPackageWasSplit: case ModbusPackageWasSplit:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Error while parsing the received buffer: The Modbus package was split", reason);
runError(1001, reason);
break;
case VendorIdUnknown: case VendorIdUnknown:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Error: Vendor ID unknown", reason);
runError(1001, reason);
break;
case FuncCodeIncorrect:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Error: Function code is incorrect", reason);
runError(1001, reason);
break;
case AddressFailure:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Error: Start address is incorrect", reason);
runError(1001, reason); runError(1001, reason);
break; break;
case ConnectionError: case ConnectionError:
writeLineEx(0, 4, "<%NODE_NAME%> Fatal Connection Error", reason);
gtRead.Cancel(); gtRead.Cancel();
break; break;
} }
@ -203,8 +227,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(thisDev.Address.Read.InputReg, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputRegisters); ModbusReadRegisters(thisDev.Addr.Read.InputRegisters, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputRegisters);
ModbusReadBits(thisDev.Address.Read.InputBit, @sysvar::%BUS_TYPE%%CHANNEL%::%NODE_NAME%::Info::InputBits); ModbusReadBits(thisDev.Addr.Read.InputBits, @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

View file

@ -90,6 +90,34 @@ void writeDbg(enum DebugLvl lvl, char format[], char string1[], char string2[])
} }
// 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[], char string1[], char string2[], long num1, long num2)
{
char msg[500];
byte lVl;
if (lvl < OutputDebugLevel)
return;
lVl = (byte)lvl >> 4;
writeDbgFormat(lVl, msg, format);
writeLineEx(1, lVl, msg, string1, string2, num1, num2);
}
// 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[], char string1[], char string2[], long num1)
{
char msg[500];
byte lVl;
if (lvl < OutputDebugLevel)
return;
lVl = (byte)lvl >> 4;
writeDbgFormat(lVl, msg, format);
writeLineEx(1, lVl, msg, string1, string2, num1);
}
// 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 num, char string[]) void writeDbg(enum DebugLvl lvl, char format[], long num, char string[])
{ {
char msg[500]; char msg[500];
@ -118,6 +146,20 @@ void writeDbg(enum DebugLvl lvl, char format[], char string[], long num)
} }
// 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[], char string[], long num, float fl)
{
char msg[500];
byte lVl;
if (lvl < OutputDebugLevel)
return;
lVl = (byte)lvl >> 4;
writeDbgFormat(lVl, msg, format);
writeLineEx(1, lVl, msg, string, num, fl);
}
// 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) void writeDbg(enum DebugLvl lvl, char format[], long num1)
{ {
char msg[500]; char msg[500];

View file

@ -20,24 +20,25 @@ variables
{ {
struct // Start addresses Read struct // Start addresses Read
{ {
word OutputBit; word OutputBits;
word OutputReg; word OutputRegisters;
word InputBit; word InputBits;
word InputReg; word InputRegisters;
} Read; } Read;
struct // Start addresses Write struct // Start addresses Write
{ {
word OutputBit; word OutputBits;
word OutputReg; word OutputRegisters;
} Write; } Write;
} Address; } Addr;
word BitMaxCount; // Max number of bits word MaxBitCount; // Max number of bits
word RegMaxCount; // Max number of registers word MaxRegisterCount; // Max number of registers
byte ReceiveWindow; byte ReceiveWindow;
} thisDev; } 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
{ {
All = 0xFFFF,
Wago = 23, // Wago Wago = 23, // Wago
BuR = 2 // B&R BuR = 2 // B&R
}; };
@ -68,27 +69,32 @@ void DeviceInit(byte vendor)
{ {
switch ((enum Vendor) vendor) switch ((enum Vendor) vendor)
{ {
case All: // information that may apply to all devices
thisDev.MaxBitCount = 0x0100;
thisDev.MaxRegisterCount = 0x0100;
thisDev.ReceiveWindow = 1;
break;
case Wago: case Wago:
thisDev.Address.Read.InputBit = 0x0000; // Wago inputs start at 0x000 thisDev.Addr.Read.InputBits = 0x0000; // Wago inputs start at 0x000
thisDev.Address.Read.InputReg = 0x0000; thisDev.Addr.Read.InputRegisters = 0x0000;
thisDev.Address.Read.OutputBit = 0x0200; // Wago reading outputs start at 0x200 thisDev.Addr.Read.OutputBits = 0x0200; // Wago reading outputs start at 0x200
thisDev.Address.Read.OutputReg = 0x0200; thisDev.Addr.Read.OutputRegisters = 0x0200;
thisDev.Address.Write.OutputBit = 0x0000; // Wago writing outputs start at 0x000 thisDev.Addr.Write.OutputBits = 0x0000; // Wago writing outputs start at 0x000
thisDev.Address.Write.OutputReg = 0x0000; thisDev.Addr.Write.OutputRegisters = 0x0000;
thisDev.BitMaxCount = 0x0100; // Wago allows up to 256 inputs thisDev.MaxBitCount = 0x0200; // Wago allows up to 512 digital inputs (trial & error)
thisDev.RegMaxCount = 0x0100; thisDev.MaxRegisterCount = 0x0100; // Wago allows up to 256 analog inputs (trial & error)
thisDev.ReceiveWindow = 5; // Wago can handle 5 requests simultaneously thisDev.ReceiveWindow = 5; // Wago can handle 5 requests simultaneously
break; break;
case BuR: case BuR:
thisDev.Address.Read.InputBit = 0x0000; // B&R inputs start at 0x000 thisDev.Addr.Read.InputBits = 0x0000; // B&R inputs start at 0x000
thisDev.Address.Read.InputReg = 0x0000; thisDev.Addr.Read.InputRegisters = 0x0000;
thisDev.Address.Read.OutputBit = 0x0000; // B&R reading digital outputs start at 0x000 thisDev.Addr.Read.OutputBits = 0x0000; // B&R reading digital outputs start at 0x000
thisDev.Address.Read.OutputReg = 0x0800; // B&R reading analog outputs start at 0x800 thisDev.Addr.Read.OutputRegisters = 0x0800; // B&R reading analog outputs start at 0x800
thisDev.Address.Write.OutputBit = 0x0000; // B&R writing outputs start at 0x000 thisDev.Addr.Write.OutputBits = 0x0000; // B&R writing outputs start at 0x000
thisDev.Address.Write.OutputReg = 0x0000; thisDev.Addr.Write.OutputRegisters = 0x0000;
thisDev.BitMaxCount = 0x4000; // B&R allows up to 16348 digital inputs thisDev.MaxBitCount = 0x4000; // B&R allows up to 16348 digital inputs
thisDev.RegMaxCount = 0x0800; // B&R allows up to 2048 analog inputs thisDev.MaxRegisterCount = 0x0800; // B&R allows up to 2048 analog inputs
thisDev.ReceiveWindow = 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);

View file

@ -75,6 +75,8 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
return error; return error;
} }
gSocketState = CONNECTING;
EthSetTokenData(gPacket, "eth", "source" , elCount(gLocalMac), gLocalMac); EthSetTokenData(gPacket, "eth", "source" , elCount(gLocalMac), gLocalMac);
EthSetTokenData(gPacket, "eth", "destination" , elCount(broadcastMac), broadcastMac); EthSetTokenData(gPacket, "eth", "destination" , elCount(broadcastMac), broadcastMac);
EthSetTokenInt(gPacket, "arp", "hwType" , 1); // Ethernet EthSetTokenInt(gPacket, "arp", "hwType" , 1); // Ethernet
@ -148,18 +150,18 @@ byte _ModbusSnd(byte buffer[], word length)
_ModbusConnectTo(gRemoteIP, gRemotePort); _ModbusConnectTo(gRemoteIP, gRemotePort);
if (gSocketState != OK) if (gSocketState != OK)
{ {
writeDbg(ConnWarning, "EilSnd: Reconnecting failed! Doing nothing."); writeDbg(ConnWarning, "_ModbusSnd: Reconnecting failed!");
return 1; return 1;
} }
case OK: case OK:
break; break;
default: default:
writeDbg(ConnWarning, "EilSnd: Socket status is not OK! Doing nothing."); writeDbg(ConnWarning, "_ModbusSnd: Socket status is not OK!);
return 1; return 1;
} }
bin_to_strhex(buffer, str); bin_to_strhex(buffer, str);
writeDbg(ConnDebug, "EilSnd: %s (Länge: %d)", str, length); writeDbg(ConnDebug, "_ModbusSnd: %s (Länge: %d)", str, length);
EthResizeToken(gPacket, "udp", "data" , length*8); EthResizeToken(gPacket, "udp", "data" , length*8);
EthSetTokenData(gPacket, "udp", "data" , length, buffer); EthSetTokenData(gPacket, "udp", "data" , length, buffer);

View file

@ -28,7 +28,7 @@ variables
word Protocol; word Protocol;
word Length; word Length;
byte UnitID; byte UnitID;
byte FuncCode; /*enum ModbusFuncCode*/ byte FuncCode;
}; };
// Read Data from the host. We only need the start address and the number of bits/registers we want to read // Read Data from the host. We only need the start address and the number of bits/registers we want to read
_align(1) struct ModbusReqRead _align(1) struct ModbusReqRead
@ -147,6 +147,8 @@ variables
ModbusPackageWasSplit, ModbusPackageWasSplit,
DeviceCodeUnknown, DeviceCodeUnknown,
VendorIdUnknown, VendorIdUnknown,
ConnectionError ConnectionError,
FuncCodeIncorrect,
AddressFailure
}; };
} }

View file

@ -101,7 +101,7 @@ word _ModbusConnectTo(dword remoteIp, word remotePort)
else else
{ {
writeDbg(ConnDebug, "_ModbusConnectTo: WSAE would block"); writeDbg(ConnDebug, "_ModbusConnectTo: WSAE would block");
gSocketState = NULL; gSocketState = CONNECTING;
} }
return 0; return 0;
} }

View file

@ -150,7 +150,7 @@ byte _ModbusSnd(byte buffer[], word length)
} }
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, Time: %f)", str, length, timeNowFloat()/100000.0);
if (gSocket.SendTo(gRemoteIP, gRemotePort, buffer, length) != 0) if (gSocket.SendTo(gRemoteIP, gRemotePort, buffer, length) != 0)
{ {

View file

@ -11,7 +11,7 @@ variables
char gIpLastErrStr[512] = ""; char gIpLastErrStr[512] = "";
// The state of the socket will be safed here. This way we can check if we can send/receive packets // The state of the socket will be safed here. This way we can check if we can send/receive packets
enum SocketState { NULL, OK, ERROR, CLOSED }; enum SocketState { NULL = 100, CONNECTING = 120, OK = 200, ERROR = 0, CLOSED = 20};
enum SocketState gSocketState = NULL; enum SocketState gSocketState = NULL;
dword gRemoteIP = INVALID_IP; dword gRemoteIP = INVALID_IP;