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
daa37cf3
Commit
daa37cf3
authored
Aug 21, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserPrmData used if no ExtUserPrmData found
parent
6adc59e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
profibus/lib/rt/src/rt_pb_gsd.cpp
profibus/lib/rt/src/rt_pb_gsd.cpp
+26
-2
profibus/lib/rt/src/rt_pb_gsd.h
profibus/lib/rt/src/rt_pb_gsd.h
+3
-1
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
+8
-1
No files found.
profibus/lib/rt/src/rt_pb_gsd.cpp
View file @
daa37cf3
/*
* Proview $Id: rt_pb_gsd.cpp,v 1.
7 2007-02-21 14:08:57
claes Exp $
* Proview $Id: rt_pb_gsd.cpp,v 1.
8 2007-08-21 15:12:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -562,7 +562,7 @@ int pb_gsd::read( char *filename)
case
gsd_UserPrmData
:
case
gsd_OString
:
{
char
*
s
=
strchr
(
line
,
'='
);
str_to_ostring
(
(
unsigned
char
**
)
&
datap
->
data
,
s
+
1
,
256
,
0
);
str_to_ostring
(
(
unsigned
char
**
)
&
datap
->
data
,
s
+
1
,
256
,
&
datap
->
len
);
datap
->
found
=
1
;
break
;
}
...
...
@@ -1520,6 +1520,11 @@ int pb_gsd::get_svalue( char *key, char *value, int size)
case
gsd_SlaveFamily
:
strncpy
(
value
,
(
char
*
)
datap
->
data
,
size
);
return
1
;
case
gsd_UserPrmData
:
{
int
len
=
size
<
datap
->
len
?
size
:
datap
->
len
;
memcpy
(
value
,
(
char
*
)
datap
->
data
,
len
);
return
1
;
}
default:
return
0
;
}
...
...
@@ -2077,6 +2082,25 @@ void pb_gsd::pack_ext_user_prm_data( char *data, int *len)
*
len
=
data_idx
;
}
int
pb_gsd
::
get_user_prm_data
(
char
*
data
,
int
*
len
,
int
size
)
{
int
sts
;
sts
=
get_ivalue
(
"User_Prm_Data_Len"
,
len
);
if
(
EVEN
(
sts
))
{
*
len
=
0
;
return
0
;
}
sts
=
get_svalue
(
"User_Prm_Data"
,
data
,
size
);
if
(
EVEN
(
sts
))
{
*
len
=
0
;
return
0
;
}
return
1
;
}
int
pb_gsd
::
unpack_ext_user_prm_data
(
char
*
data
,
int
len
)
{
int
i
;
...
...
profibus/lib/rt/src/rt_pb_gsd.h
View file @
daa37cf3
/*
* Proview $Id: rt_pb_gsd.h,v 1.
5 2007-02-21 14:09:02
claes Exp $
* Proview $Id: rt_pb_gsd.h,v 1.
6 2007-08-21 15:12:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -86,6 +86,7 @@ typedef struct {
unsigned
int
value
;
void
*
data
;
int
found
;
int
len
;
}
gsd_sData
;
typedef
struct
sArea
{
...
...
@@ -232,6 +233,7 @@ class pb_gsd {
int
cut_module_conf
(
gsd_sModuleConf
*
m
);
int
paste_module_conf
(
gsd_sModuleConf
*
m
);
void
pack_config
(
char
*
config
,
int
*
len
);
int
get_user_prm_data
(
char
*
data
,
int
*
len
,
int
size
);
int
unpack_ext_user_prm_data
(
char
*
data
,
int
len
);
void
pack_ext_user_prm_data
(
char
*
data
,
int
*
len
);
void
compress
(
char
*
line
);
...
...
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
View file @
daa37cf3
/*
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.
9 2007-06-01 12:53:51
claes Exp $
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.
10 2007-08-21 15:12:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -190,8 +190,15 @@ int pb_dp_slave_save_cb( void *sctx)
int
len
;
memset
(
user_prm_data
,
0
,
sizeof
(
user_prm_data
));
// Get ExtUserPrmData
ctx
->
gsd
->
pack_ext_user_prm_data
(
(
char
*
)
user_prm_data
,
&
len
);
if
(
!
len
)
{
// Get UserPrmData instead
ctx
->
gsd
->
get_user_prm_data
(
(
char
*
)
user_prm_data
,
&
len
,
sizeof
(
user_prm_data
));
}
sts
=
ldh_ArefANameToAref
(
ctx
->
ldhses
,
&
ctx
->
aref
,
"PrmUserData"
,
&
aaref
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
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