Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
98167b8c
Commit
98167b8c
authored
Jan 13, 2020
by
Marcus Nordenberg
Committed by
Claes Sjöfors
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
profinet: honor fixedinslot attribute for the DAP
parent
8e4db86d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
12 deletions
+38
-12
profibus/lib/cow/src/cow_pn_gsdml.cpp
profibus/lib/cow/src/cow_pn_gsdml.cpp
+3
-0
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
+27
-10
profibus/lib/rt/src/rt_pn_gsdml_data.cpp
profibus/lib/rt/src/rt_pn_gsdml_data.cpp
+4
-1
profibus/lib/rt/src/rt_pn_gsdml_data.h
profibus/lib/rt/src/rt_pn_gsdml_data.h
+4
-1
No files found.
profibus/lib/cow/src/cow_pn_gsdml.cpp
View file @
98167b8c
...
@@ -6537,6 +6537,8 @@ gsdml_DeviceAccessPointItem::gsdml_DeviceAccessPointItem(pn_gsdml* g)
...
@@ -6537,6 +6537,8 @@ gsdml_DeviceAccessPointItem::gsdml_DeviceAccessPointItem(pn_gsdml* g)
void
gsdml_DeviceAccessPointItem
::
build
()
void
gsdml_DeviceAccessPointItem
::
build
()
{
{
Body
.
FixedInSlots
.
list
=
new
gsdml_Valuelist
(
Body
.
FixedInSlots
.
str
);
if
(
ModuleInfo
)
if
(
ModuleInfo
)
ModuleInfo
->
build
();
ModuleInfo
->
build
();
if
(
SubslotList
)
if
(
SubslotList
)
...
@@ -6553,6 +6555,7 @@ void gsdml_DeviceAccessPointItem::build()
...
@@ -6553,6 +6555,7 @@ void gsdml_DeviceAccessPointItem::build()
UseableSubmodules
->
build
();
UseableSubmodules
->
build
();
if
(
SlotList
)
if
(
SlotList
)
SlotList
->
build
();
SlotList
->
build
();
Body
.
PhysicalSlots
.
list
=
new
gsdml_Valuelist
(
Body
.
PhysicalSlots
.
str
);
Body
.
PhysicalSlots
.
list
=
new
gsdml_Valuelist
(
Body
.
PhysicalSlots
.
str
);
}
}
...
...
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
View file @
98167b8c
...
@@ -1257,25 +1257,43 @@ int GsdmlAttrNav::object_attr()
...
@@ -1257,25 +1257,43 @@ int GsdmlAttrNav::object_attr()
}
}
new
ItemPnDAP
(
this
,
"DAP"
,
sd
,
NULL
,
flow_eDest_IntoLast
);
new
ItemPnDAP
(
this
,
"DAP"
,
sd
,
NULL
,
flow_eDest_IntoLast
);
slot_cnt
++
;
slot_cnt
++
;
gsdml_ValuelistIterator
fixed_in_slots_iter
(
gsdml
->
ApplicationProcess
->
DeviceAccessPointList
->
DeviceAccessPointItem
[
device_num
-
1
]
->
Body
.
FixedInSlots
.
list
);
// Check to see if this DAP is supposed to be fixed in a specific slot (We assume the first one).
// We also assume the DAP is never placed in more than one slot.
// FixedInSlots attribute may apply to modules and submodules aswell but is not implemented (yet)
unsigned
int
fixed_position
=
fixed_in_slots_iter
.
begin
();
if
(
fixed_position
>
0
&&
sd
->
dap_fixed_slot
!=
1
)
{
sd
->
dap_fixed_slot
=
1
;
sd
->
slot_number
=
slot_cnt
;
}
gsdml_ValuelistIterator
iter
(
gsdml_ValuelistIterator
iter
(
gsdml
->
ApplicationProcess
->
DeviceAccessPointList
gsdml
->
ApplicationProcess
->
DeviceAccessPointList
->
DeviceAccessPointItem
[
device_num
-
1
]
->
DeviceAccessPointItem
[
device_num
-
1
]
->
Body
.
PhysicalSlots
.
list
);
->
Body
.
PhysicalSlots
.
list
);
for
(
unsigned
int
i
=
iter
.
begin
();
i
!=
iter
.
end
();
i
=
iter
.
next
())
{
// Add all the slots, the DAP goes to the first physical slot
if
(
i
==
0
)
int
first_slot
=
iter
.
begin
();
// DAP already created
for
(
unsigned
int
physical_slot
=
first_slot
;
physical_slot
!=
iter
.
end
();
physical_slot
=
iter
.
next
())
{
continue
;
//Skip the DAP
if
(
first_slot
==
physical_slot
)
physical_slot
=
iter
.
next
();
char
name
[
80
];
char
name
[
80
];
sprintf
(
name
,
"Slot %u"
,
i
);
sprintf
(
name
,
"Slot %u"
,
physical_slot
);
if
(
dev_data
.
slot_data
.
size
()
<=
slot_cnt
)
if
(
dev_data
.
slot_data
.
size
()
<=
slot_cnt
)
{
{
sd
=
new
GsdmlSlotData
();
sd
=
new
GsdmlSlotData
();
sd
->
slot_number
=
i
;
sd
->
slot_number
=
physical_slot
;
sd
->
slot_idx
=
slot_cnt
;
sd
->
slot_idx
=
slot_cnt
;
dev_data
.
slot_data
.
push_back
(
sd
);
dev_data
.
slot_data
.
push_back
(
sd
);
}
}
...
@@ -1283,8 +1301,7 @@ int GsdmlAttrNav::object_attr()
...
@@ -1283,8 +1301,7 @@ int GsdmlAttrNav::object_attr()
{
{
sd
=
dev_data
.
slot_data
[
slot_cnt
];
sd
=
dev_data
.
slot_data
[
slot_cnt
];
sd
->
slot_idx
=
slot_cnt
;
sd
->
slot_idx
=
slot_cnt
;
if
(
i
!=
sd
->
slot_number
)
if
(
physical_slot
!=
sd
->
slot_number
)
{
{
printf
(
"GSML-Error, datafile corrupt, unexpected slot number
\n
"
);
printf
(
"GSML-Error, datafile corrupt, unexpected slot number
\n
"
);
}
}
}
}
...
...
profibus/lib/rt/src/rt_pn_gsdml_data.cpp
View file @
98167b8c
...
@@ -136,7 +136,8 @@ int GsdmlSlotData::print(std::ofstream& fp, bool reverse_endianess)
...
@@ -136,7 +136,8 @@ int GsdmlSlotData::print(std::ofstream& fp, bool reverse_endianess)
<<
" ModuleIdentNumber=
\"
"
<<
module_ident_number
<<
"
\"\n
"
<<
" ModuleIdentNumber=
\"
"
<<
module_ident_number
<<
"
\"\n
"
<<
" ModuleClass=
\"
"
<<
module_class
<<
"
\"\n
"
<<
" ModuleClass=
\"
"
<<
module_class
<<
"
\"\n
"
<<
" ModuleText=
\"
"
<<
module_text
<<
"
\"\n
"
<<
" ModuleText=
\"
"
<<
module_text
<<
"
\"\n
"
<<
" SlotNumber=
\"
"
<<
slot_number
<<
"
\"
>
\n
"
;
<<
" SlotNumber=
\"
"
<<
slot_number
<<
"
\"\n
"
<<
" DapFixedInSlot=
\"
"
<<
dap_fixed_slot
<<
"
\"
>
\n
"
;
for
(
unsigned
int
i
=
0
;
i
<
subslot_data
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
subslot_data
.
size
();
i
++
)
{
{
...
@@ -610,6 +611,8 @@ int GsdmlDataReader::tag_attribute(const char* name, const char* value)
...
@@ -610,6 +611,8 @@ int GsdmlDataReader::tag_attribute(const char* name, const char* value)
strncpy
(
sd
->
module_text
,
value
,
sizeof
(
sd
->
module_text
));
strncpy
(
sd
->
module_text
,
value
,
sizeof
(
sd
->
module_text
));
else
if
(
streq
(
name
,
"SlotNumber"
))
else
if
(
streq
(
name
,
"SlotNumber"
))
sscanf
(
value
,
"%u"
,
&
sd
->
slot_number
);
sscanf
(
value
,
"%u"
,
&
sd
->
slot_number
);
else
if
(
streq
(
name
,
"DapFixedInSlot"
))
sscanf
(
value
,
"%u"
,
&
sd
->
dap_fixed_slot
);
break
;
break
;
}
}
case
gsdmldata_eTag_Subslot
:
case
gsdmldata_eTag_Subslot
:
...
...
profibus/lib/rt/src/rt_pn_gsdml_data.h
View file @
98167b8c
...
@@ -128,17 +128,20 @@ class GsdmlSlotData
...
@@ -128,17 +128,20 @@ class GsdmlSlotData
{
{
public:
public:
GsdmlSlotData
()
GsdmlSlotData
()
:
module_enum_number
(
0
),
module_class
(
0
),
module_oid
(
pwr_cNOid
),
:
module_enum_number
(
0
),
dap_fixed_slot
(
0
),
module_class
(
0
),
module_oid
(
pwr_cNOid
),
slot_number
(
0
),
slot_idx
(
0
)
slot_number
(
0
),
slot_idx
(
0
)
{
{
module_text
[
0
]
=
0
;
module_text
[
0
]
=
0
;
}
}
unsigned
int
module_enum_number
;
unsigned
int
module_enum_number
;
unsigned
int
module_ident_number
;
unsigned
int
module_ident_number
;
unsigned
int
dap_fixed_slot
;
pwr_tCid
module_class
;
pwr_tCid
module_class
;
pwr_tOid
module_oid
;
pwr_tOid
module_oid
;
char
module_text
[
160
];
char
module_text
[
160
];
unsigned
int
slot_number
;
unsigned
int
slot_number
;
unsigned
int
slot_idx
;
unsigned
int
slot_idx
;
std
::
vector
<
GsdmlSubslotData
*>
subslot_data
;
std
::
vector
<
GsdmlSubslotData
*>
subslot_data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment