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
451c7cab
Commit
451c7cab
authored
Jan 20, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profinet: ModuleIdentNumber added to datafile
parent
ed6416af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
+18
-0
profibus/lib/cow/src/cow_pn_gsdml_data.cpp
profibus/lib/cow/src/cow_pn_gsdml_data.cpp
+3
-0
profibus/lib/cow/src/cow_pn_gsdml_data.h
profibus/lib/cow/src/cow_pn_gsdml_data.h
+1
-0
No files found.
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
View file @
451c7cab
...
...
@@ -1361,6 +1361,24 @@ int GsdmlAttrNav::save( const char *filename)
strncpy
(
dev_data
.
version
,
gsdml
->
ProfileHeader
->
Body
.
ProfileRevision
,
sizeof
(
dev_data
.
version
));
dev_data
.
byte_order
=
gsdml
->
byte_order
;
// Store ModuleIdentNumber
gsdml_UseableModules
*
um
=
device_item
->
UseableModules
;
for
(
unsigned
int
i
=
0
;
i
<
dev_data
.
slot_data
.
size
();
i
++
)
{
if
(
i
==
0
)
{
dev_data
.
slot_data
[
i
]
->
module_ident_number
=
device_item
->
Body
.
ModuleIdentNumber
;
}
else
{
if
(
dev_data
.
slot_data
[
i
]
->
module_enum_number
!=
0
)
{
gsdml_ModuleItem
*
mi
=
(
gsdml_ModuleItem
*
)
um
->
ModuleItemRef
[
dev_data
.
slot_data
[
i
]
->
module_enum_number
-
1
]
->
Body
.
ModuleItemTarget
.
p
;
dev_data
.
slot_data
[
i
]
->
module_ident_number
=
mi
->
Body
.
ModuleIdentNumber
;
}
else
dev_data
.
slot_data
[
i
]
->
module_ident_number
=
0
;
}
}
// Create IOCR data
if
(
dev_data
.
iocr_data
.
size
()
<
1
)
{
GsdmlIOCRData
*
iod
=
new
GsdmlIOCRData
();
...
...
profibus/lib/cow/src/cow_pn_gsdml_data.cpp
View file @
451c7cab
...
...
@@ -92,6 +92,7 @@ int GsdmlSlotData::print( ofstream& fp)
{
fp
<<
" <Slot ModuleEnumNumber=
\"
"
<<
module_enum_number
<<
"
\"
"
<<
endl
<<
" ModuleIdentNumber=
\"
"
<<
module_ident_number
<<
"
\"
"
<<
endl
<<
" ModuleClass=
\"
"
<<
module_class
<<
"
\"
"
<<
endl
<<
" ModuleText=
\"
"
<<
module_text
<<
"
\"
"
<<
endl
<<
" SlotNumber=
\"
"
<<
slot_number
<<
"
\"
>"
<<
endl
;
...
...
@@ -421,6 +422,8 @@ int GsdmlDataReader::tag_attribute( const char *name, const char *value)
if
(
strcmp
(
name
,
"ModuleEnumNumber"
)
==
0
)
sscanf
(
value
,
"%d"
,
&
sd
->
module_enum_number
);
else
if
(
strcmp
(
name
,
"ModuleIdentNumber"
)
==
0
)
sscanf
(
value
,
"%u"
,
&
sd
->
module_ident_number
);
else
if
(
strcmp
(
name
,
"ModuleClass"
)
==
0
)
sscanf
(
value
,
"%u"
,
&
sd
->
module_class
);
else
if
(
strcmp
(
name
,
"ModuleText"
)
==
0
)
...
...
profibus/lib/cow/src/cow_pn_gsdml_data.h
View file @
451c7cab
...
...
@@ -93,6 +93,7 @@ class GsdmlSlotData {
slot_number
(
0
),
slot_idx
(
0
)
{
module_text
[
0
]
=
0
;}
unsigned
int
module_enum_number
;
unsigned
int
module_ident_number
;
pwr_tCid
module_class
;
pwr_tOid
module_oid
;
char
module_text
[
160
];
...
...
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