File tree Expand file tree Collapse file tree 5 files changed +64
-13
lines changed
src/dsian.TcPnScanner.CLI
tests/dsian.TcPnScanner.IntegrationTests Expand file tree Collapse file tree 5 files changed +64
-13
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ internal static class Constants
21
21
22
22
internal const uint SUBMODULE_INDEX_START = 0x031C0000u ;
23
23
24
+ internal const ushort SUBSLOT_NR_PORT1 = 32769 ;
25
+
26
+ internal const ushort SUBSLOT_NR_PORT2 = 32770 ;
27
+
24
28
internal const uint BOX_IMAGE_ID = 121 ;
25
29
26
30
internal const uint API_IMAGE_ID = 4 ;
@@ -35,4 +39,5 @@ internal static class Constants
35
39
internal const uint BOX_PROFINET_FLAGS = 0x410u ;
36
40
37
41
internal const uint BOX_PROFINET_FRAME_OFFSET = 0x8000u ;
42
+
38
43
}
Original file line number Diff line number Diff line change @@ -2965,6 +2965,9 @@ public partial class TcSmItemDeviceBoxProfinetAPIModuleSubModule
2965
2965
2966
2966
private uint subModuleIdentNumberField ;
2967
2967
2968
+ private uint typeOfSubmoduleField ;
2969
+ private bool typeOfSubmoduleFieldSpecified ;
2970
+
2968
2971
private uint subSlotNumberField ;
2969
2972
2970
2973
private bool isFixSubmoduleField ;
@@ -3091,6 +3094,35 @@ public uint SubModuleIdentNumber
3091
3094
}
3092
3095
}
3093
3096
3097
+ /// <remarks/>
3098
+ [ System . Xml . Serialization . XmlAttributeAttribute ( ) ]
3099
+ public uint TypeOfSubModule
3100
+ {
3101
+ get
3102
+ {
3103
+ return this . typeOfSubmoduleField ;
3104
+ }
3105
+ set
3106
+ {
3107
+ this . typeOfSubmoduleField = value ;
3108
+ this . typeOfSubmoduleFieldSpecified = true ;
3109
+ }
3110
+ }
3111
+
3112
+ /// <remarks/>
3113
+ [ System . Xml . Serialization . XmlIgnoreAttribute ( ) ]
3114
+ public bool TypeOfSubModuleSpecified
3115
+ {
3116
+ get
3117
+ {
3118
+ return this . typeOfSubmoduleFieldSpecified ;
3119
+ }
3120
+ set
3121
+ {
3122
+ this . typeOfSubmoduleFieldSpecified = value ;
3123
+ }
3124
+ }
3125
+
3094
3126
/// <remarks/>
3095
3127
[ System . Xml . Serialization . XmlAttributeAttribute ( ) ]
3096
3128
public uint SubSlotNumber
@@ -3144,6 +3176,7 @@ public uint AddSubModFlags
3144
3176
set
3145
3177
{
3146
3178
this . addSubModFlagsField = value ;
3179
+ this . addSubModFlagsFieldSpecified = true ;
3147
3180
}
3148
3181
}
3149
3182
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ private static TcSmItemDeviceBoxProfinetAPIModuleSubModule[] GetSubModules(APIEx
184
184
185
185
foreach ( var submodule in api . Submodules )
186
186
{
187
- subModules . Add ( new TcSmItemDeviceBoxProfinetAPIModuleSubModule
187
+ var subModuleToAdd = new TcSmItemDeviceBoxProfinetAPIModuleSubModule
188
188
{
189
189
Id = PrintAsHex ( CreateModuleIndex ( Constants . SUBMODULE_INDEX_START , ( ushort ) ( submodule . SubslotNumber + 1 ) ) ) ,
190
190
Name = $ "Subterm { submodule . SubslotNumber } { PrintSubTermIoLabel ( submodule ) } ",
@@ -195,7 +195,16 @@ private static TcSmItemDeviceBoxProfinetAPIModuleSubModule[] GetSubModules(APIEx
195
195
APINr = api . APIId ,
196
196
APINrSpecified = api . APIId != 0 ,
197
197
Vars = GetIoVarsForSubmodule ( submodule )
198
- } ) ;
198
+
199
+ } ;
200
+ if ( IsPortSubmodule ( submodule ) )
201
+ {
202
+ subModuleToAdd . Name += $ " (Port { submodule . SubslotNumber - ( Constants . SUBSLOT_NR_PORT1 - 1 ) } )";
203
+ subModuleToAdd . PortData = "" ;
204
+ subModuleToAdd . TypeOfSubModule = 2 ;
205
+ subModuleToAdd . AddSubModFlags = 28 ;
206
+ }
207
+ subModules . Add ( subModuleToAdd ) ;
199
208
}
200
209
201
210
return subModules . ToArray ( ) ;
@@ -292,4 +301,8 @@ private static string PrintAsHex(uint index)
292
301
{
293
302
return $ "#x{ index : X08} ";
294
303
}
304
+ private static bool IsPortSubmodule ( in Submodule submodule )
305
+ {
306
+ return submodule . SubslotNumber >= Constants . SUBSLOT_NR_PORT1 && submodule . SubslotNumber <= Constants . SUBSLOT_NR_PORT2 ;
307
+ }
295
308
}
Original file line number Diff line number Diff line change 18
18
<Description >Scans a PROFINET and adds all Stations to a PROFINET IO Device (TF6270)</Description >
19
19
<Copyright >Copyright (c) 2023 densogiaichned</Copyright >
20
20
<Title >TwinCAT Profinet Device Scanner</Title >
21
- <Version >0.3.1 </Version >
21
+ <Version >0.4.0 </Version >
22
22
<AssemblyVersion >$(Version)</AssemblyVersion >
23
23
<FileVersion >$(Version)</FileVersion >
24
24
<IncludeSourceRevisionInInformationalVersion >false</IncludeSourceRevisionInInformationalVersion >
55
55
<PackageReference Include =" CommandLineParser" Version =" 2.9.1" />
56
56
<PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 8.0.0" />
57
57
<PackageReference Include =" Microsoft.Extensions.Logging" Version =" 8.0.0" />
58
- <PackageReference Include =" Serilog" Version =" 3.1.1 " />
58
+ <PackageReference Include =" Serilog" Version =" 4.0.0 " />
59
59
<PackageReference Include =" Serilog.Extensions.Logging" Version =" 8.0.0" />
60
- <PackageReference Include =" Serilog.Sinks.Console" Version =" 5 .0.1 " />
61
- <PackageReference Include =" Serilog.Sinks.File" Version =" 5 .0.0" />
62
- <PackageReference Include =" SharpPcap" Version =" 6.2.5 " />
60
+ <PackageReference Include =" Serilog.Sinks.Console" Version =" 6 .0.0 " />
61
+ <PackageReference Include =" Serilog.Sinks.File" Version =" 6 .0.0" />
62
+ <PackageReference Include =" SharpPcap" Version =" 6.3.0 " />
63
63
</ItemGroup >
64
64
65
65
</Project >
Original file line number Diff line number Diff line change 10
10
</PropertyGroup >
11
11
12
12
<ItemGroup >
13
- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.9 .0" />
14
- <PackageReference Include =" Verify" Version =" 23.1.0 " />
15
- <PackageReference Include =" Verify.Xunit" Version =" 23.1.0 " />
16
- <PackageReference Include =" xunit" Version =" 2.6.6 " />
17
- <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.5.6 " >
13
+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.10 .0" />
14
+ <PackageReference Include =" Verify" Version =" 25.3.1 " />
15
+ <PackageReference Include =" Verify.Xunit" Version =" 25.3.1 " />
16
+ <PackageReference Include =" xunit" Version =" 2.9.0 " />
17
+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.8.2 " >
18
18
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
19
19
<PrivateAssets >all</PrivateAssets >
20
20
</PackageReference >
21
- <PackageReference Include =" coverlet.collector" Version =" 6.0.0 " >
21
+ <PackageReference Include =" coverlet.collector" Version =" 6.0.2 " >
22
22
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
23
23
<PrivateAssets >all</PrivateAssets >
24
24
</PackageReference >
You can’t perform that action at this time.
0 commit comments