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
c95797a2
Commit
c95797a2
authored
Dec 13, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profinet configurator, fix for non consecutive modules (refs #240)
parent
eb5cc397
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
191 additions
and
322 deletions
+191
-322
profibus/lib/wb/src/wb_c_pndevice.cpp
profibus/lib/wb/src/wb_c_pndevice.cpp
+76
-86
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+29
-18
src/exp/com/src/os_linux/upgrade.sh
src/exp/com/src/os_linux/upgrade.sh
+2
-2
src/exp/com/src/os_linux/upgrade_pb.pwr_com
src/exp/com/src/os_linux/upgrade_pb.pwr_com
+84
-216
No files found.
profibus/lib/wb/src/wb_c_pndevice.cpp
View file @
c95797a2
...
@@ -168,98 +168,40 @@ int pndevice_save_cb( void *sctx)
...
@@ -168,98 +168,40 @@ int pndevice_save_cb( void *sctx)
ldh_eName_Hierarchy
,
name
,
sizeof
(
name
),
&
size
);
ldh_eName_Hierarchy
,
name
,
sizeof
(
name
),
&
size
);
if
(
EVEN
(
sts
))
goto
return_now
;
if
(
EVEN
(
sts
))
goto
return_now
;
// Do a temporary rename all module object to avoid name collisions
// Check that Slot attribute corresponds to the and module_oid
#if 0
for
(
unsigned
int
i
=
1
;
i
<
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
();
i
++
)
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
]
->
module_oid
=
pwr_cNOid
;
for
(
sts
=
ldh_GetChild
(
ctx
->
ldhses
,
ctx
->
aref
.
Objid
,
&
oid
);
for
(
sts
=
ldh_GetChild
(
ctx
->
ldhses
,
ctx
->
aref
.
Objid
,
&
oid
);
ODD
(
sts
);
ODD
(
sts
);
sts
=
ldh_GetNextSibling
(
ctx
->
ldhses
,
oid
,
&
oid
))
{
sts
=
ldh_GetNextSibling
(
ctx
->
ldhses
,
oid
,
&
oid
))
{
sts = ldh_ObjidToName( ctx->ldhses, oid, cdh_mName_object, name,
unsigned
int
*
slotnumberp
,
slotnumber
;
sizeof(name), &size);
if ( EVEN(sts)) goto return_now;
strcat( name, "__tmp");
sts = ldh_ChangeObjectName( ctx->ldhses, oid, name);
if ( EVEN(sts)) goto return_now;
}
#endif
for
(
unsigned
int
i
=
1
;
i
<
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
();
i
++
)
{
sts
=
ldh_GetObjectPar
(
ctx
->
ldhses
,
oid
,
"RtBody"
,
GsdmlSlotData
*
slot
=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
];
"Slot"
,
(
char
**
)
&
slotnumberp
,
&
size
);
pwr_tCid
cid
;
if
(
EVEN
(
sts
))
{
pwr_tOid
prev
;
MsgWindow
::
message
(
'E'
,
"Not a Profinet module object"
,
msgw_ePop_Yes
,
oid
);
pwr_tObjName
mname
;
continue
;
}
slotnumber
=
*
slotnumberp
;
free
(
slotnumberp
);
int
found
=
0
;
if
(
slotnumber
>=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
())
{
sprintf
(
mname
,
"M%d"
,
slot
->
slot_idx
);
MsgWindow
::
message
(
'E'
,
"Slot too large"
,
msgw_ePop_Yes
,
oid
);
continue
;
}
if
(
cdh_ObjidIsNotNull
(
slot
->
module_oid
))
{
if
(
cdh_ObjidIsNotNull
(
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
slotnumber
]
->
module_oid
))
{
MsgWindow
::
message
(
'E'
,
"Slot already used"
,
msgw_ePop_Yes
,
oid
);
continue
;
}
// Find module object
if
(
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
slotnumber
]
->
module_class
==
pwr_cNCid
)
sts
=
ldh_GetObjectClass
(
ctx
->
ldhses
,
slot
->
module_oid
,
&
cid
);
// Should be removed
if
(
ODD
(
sts
))
{
continue
;
if
(
cid
==
slot
->
module_class
)
{
// Module object found and class is ok
found
=
1
;
// Check if name is changed
sts
=
ldh_ObjidToName
(
ctx
->
ldhses
,
slot
->
module_oid
,
cdh_mName_object
,
name
,
sizeof
(
name
),
&
size
);
if
(
EVEN
(
sts
))
goto
return_now
;
#if 0
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
slotnumber
]
->
module_oid
=
oid
;
if ( strcmp( name, mname) != 0) {
// Change name
sts = ldh_ChangeObjectName( ctx->ldhses, slot->module_oid, mname);
if ( EVEN(sts)) goto return_now;
}
#endif
// Check that sibling position is right
sts
=
ldh_GetPreviousSibling
(
ctx
->
ldhses
,
slot
->
module_oid
,
&
prev
);
if
(
i
==
0
)
{
// Should be first sibling
if
(
ODD
(
sts
))
{
// Move to first sibling
sts
=
ldh_MoveObject
(
ctx
->
ldhses
,
slot
->
module_oid
,
ctx
->
aref
.
Objid
,
ldh_eDest_IntoFirst
);
}
}
else
{
if
(
(
ODD
(
sts
)
&&
cdh_ObjidIsNotEqual
(
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
-
1
]
->
module_oid
,
prev
))
||
EVEN
(
sts
))
{
// Move to next to i-1
sts
=
ldh_MoveObject
(
ctx
->
ldhses
,
slot
->
module_oid
,
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
-
1
]
->
module_oid
,
ldh_eDest_After
);
}
}
}
else
{
// New class, delete current object, reuse the name
sts
=
ldh_ObjidToName
(
ctx
->
ldhses
,
slot
->
module_oid
,
ldh_eName_Object
,
mname
,
sizeof
(
mname
),
&
size
);
if
(
EVEN
(
sts
))
goto
return_now
;
sts
=
ldh_DeleteObjectTree
(
ctx
->
ldhses
,
slot
->
module_oid
,
0
);
if
(
EVEN
(
sts
))
goto
return_now
;
}
}
}
if
(
!
found
&&
slot
->
module_class
!=
pwr_cNCid
)
{
// Create a new module object
if
(
i
==
1
)
sts
=
ldh_CreateObject
(
ctx
->
ldhses
,
&
slot
->
module_oid
,
mname
,
slot
->
module_class
,
ctx
->
aref
.
Objid
,
ldh_eDest_IntoFirst
);
else
sts
=
ldh_CreateObject
(
ctx
->
ldhses
,
&
slot
->
module_oid
,
mname
,
slot
->
module_class
,
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
-
1
]
->
module_oid
,
ldh_eDest_After
);
if
(
EVEN
(
sts
))
{
printf
(
"Error creating module object, %d
\n
"
,
sts
);
sts
=
0
;
goto
return_now
;
}
}
}
}
// Remove modules that wasn't configured any more
// Remove modules that wasn't configured any more
...
@@ -287,6 +229,54 @@ int pndevice_save_cb( void *sctx)
...
@@ -287,6 +229,54 @@ int pndevice_save_cb( void *sctx)
for
(
int
i
=
0
;
i
<
mcnt
;
i
++
)
for
(
int
i
=
0
;
i
<
mcnt
;
i
++
)
sts
=
ldh_DeleteObjectTree
(
ctx
->
ldhses
,
moid
[
i
],
0
);
sts
=
ldh_DeleteObjectTree
(
ctx
->
ldhses
,
moid
[
i
],
0
);
// Create new module objects
for
(
unsigned
int
i
=
0
;
i
<
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
();
i
++
)
{
GsdmlSlotData
*
slot
=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
];
if
(
cdh_ObjidIsNull
(
slot
->
module_oid
)
&&
slot
->
module_class
!=
pwr_cNCid
)
{
char
mname
[
20
];
sprintf
(
mname
,
"M%d"
,
i
);
if
(
i
==
1
)
sts
=
ldh_CreateObject
(
ctx
->
ldhses
,
&
slot
->
module_oid
,
mname
,
slot
->
module_class
,
ctx
->
aref
.
Objid
,
ldh_eDest_IntoFirst
);
else
{
// Find sibling
pwr_tOid
dest_oid
=
pwr_cNOid
;
int
dest_found
=
0
;
for
(
int
j
=
i
-
1
;
j
>
0
;
j
--
)
{
if
(
cdh_ObjidIsNotNull
(
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
j
]
->
module_oid
))
{
dest_oid
=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
j
]
->
module_oid
;
dest_found
=
1
;
break
;
}
}
if
(
!
dest_found
)
sts
=
ldh_CreateObject
(
ctx
->
ldhses
,
&
slot
->
module_oid
,
mname
,
slot
->
module_class
,
ctx
->
aref
.
Objid
,
ldh_eDest_IntoFirst
);
else
sts
=
ldh_CreateObject
(
ctx
->
ldhses
,
&
slot
->
module_oid
,
mname
,
slot
->
module_class
,
dest_oid
,
ldh_eDest_After
);
}
if
(
EVEN
(
sts
))
{
MsgWindow
::
message
(
'E'
,
"Error creating module object"
,
mname
);
sts
=
0
;
goto
return_now
;
}
pwr_tAttrRef
aaref
;
pwr_tAttrRef
modulearef
=
cdh_ObjidToAref
(
slot
->
module_oid
);
// Set Slot
pwr_tUInt32
slotnumber
=
i
;
sts
=
ldh_ArefANameToAref
(
ctx
->
ldhses
,
&
modulearef
,
"Slot"
,
&
aaref
);
if
(
EVEN
(
sts
))
goto
return_now
;
sts
=
ldh_WriteAttribute
(
ctx
->
ldhses
,
&
aaref
,
&
slotnumber
,
sizeof
(
slotnumber
));
if
(
EVEN
(
sts
))
goto
return_now
;
}
}
for
(
unsigned
int
i
=
0
;
i
<
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
.
size
();
i
++
)
{
GsdmlSlotData
*
slot
=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
];
GsdmlSlotData
*
slot
=
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
i
];
...
@@ -810,12 +800,12 @@ pwr_tStatus pndevice_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref,
...
@@ -810,12 +800,12 @@ pwr_tStatus pndevice_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref,
pwr_tStatus
pndevice_init
(
device_sCtx
*
ctx
)
pwr_tStatus
pndevice_init
(
device_sCtx
*
ctx
)
{
{
pwr_tOid
module_oid
;
pwr_tOid
module_oid
;
int
corrupt
=
1
;
int
corrupt
=
0
;
unsigned
int
idx
;
unsigned
int
idx
;
pwr_tStatus
sts
;
pwr_tStatus
sts
;
// Identify module objects
// Identify module objects
#if 0
int
size
;
int
size
;
pwr_tObjName
module_name
;
pwr_tObjName
module_name
;
...
@@ -836,7 +826,7 @@ pwr_tStatus pndevice_init( device_sCtx *ctx)
...
@@ -836,7 +826,7 @@ pwr_tStatus pndevice_init( device_sCtx *ctx)
}
}
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
idx
]
->
module_oid
=
module_oid
;
ctx
->
attr
->
attrnav
->
dev_data
.
slot_data
[
idx
]
->
module_oid
=
module_oid
;
}
}
#endif
if
(
corrupt
)
{
if
(
corrupt
)
{
corrupt
=
0
;
corrupt
=
0
;
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
c95797a2
...
@@ -3840,7 +3840,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3840,7 +3840,7 @@ Volume Profibus $ClassVolume 0.0.250.7
Object RtBody $ObjBodyDef 1 21-APR-2009 13:41:08.17
Object RtBody $ObjBodyDef 1 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
Attr StructName = "PnModule"
Attr StructName = "PnModule"
Attr NextAix = "_X2
2
"
Attr NextAix = "_X2
3
"
EndBody
EndBody
!/**
!/**
! Description of this module.
! Description of this module.
...
@@ -3873,6 +3873,17 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3873,6 +3873,17 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Slot number. Used by the Profinet configurator.
!*/
Object Slot $Attribute 22 09-DEC-2016 14:42:22.14
Body SysBody 09-DEC-2016 14:43:00.76
Attr PgmName = "Slot"
Attr Size = 40
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! @Summary Process that handles the module. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the module. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the module.
! Process that handles the module.
!
!
...
@@ -3979,7 +3990,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3979,7 +3990,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! There are two SAP types reflecting the different characteristics of Master Stations and
! There are two SAP types reflecting the different characteristics of Master Stations and
! Slave Stations. Usually, "regular" SAP's are activated o Master Stations whereas Responder
! Slave Stations. Usually, "regular" SAP's are activated o Master Stations whereas Responder
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
!
!
! A (R)SAP is defined by an address in the interval 0-63. A SAP is used to issue data transfers
! A (R)SAP is defined by an address in the interval 0-63. A SAP is used to issue data transfers
! to a remote SAP or RSAP. A SAP can also be used to request data from a remote RSAP.
! to a remote SAP or RSAP. A SAP can also be used to request data from a remote RSAP.
! A RSAP cannot request data from a remote (R)SAP. It is used to respond on a data request
! A RSAP cannot request data from a remote (R)SAP. It is used to respond on a data request
...
@@ -3988,16 +3999,16 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3988,16 +3999,16 @@ Volume Profibus $ClassVolume 0.0.250.7
! This object defines a SAP or RSAP and it's address. Also defined is the slave address
! This object defines a SAP or RSAP and it's address. Also defined is the slave address
! of the node that this SAP will exchange data with. It should be created as a child to a
! of the node that this SAP will exchange data with. It should be created as a child to a
! Pb_Profiboard.
! Pb_Profiboard.
!
!
! See Proview documentation 'Guide to I/O Systems' for more information.
! See Proview documentation 'Guide to I/O Systems' for more information.
!
!
! @bConfiguration
! @bConfiguration
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
!
!
! For the SAP more than one instance can be created of the types SDA, SDN and SRD. These
! For the SAP more than one instance can be created of the types SDA, SDN and SRD. These
! different type are used to send data to a remote SAP (types SDA and SDN) or to request data and
! different type are used to send data to a remote SAP (types SDA and SDN) or to request data and
! if needed, at the same time send, data (type SRD). See more on class Pb_FDL_DataTransfer.
! if needed, at the same time send, data (type SRD). See more on class Pb_FDL_DataTransfer.
!
!
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! the data that will be sent back by a SRD request.
! the data that will be sent back by a SRD request.
!
!
...
@@ -4257,37 +4268,37 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4257,37 +4268,37 @@ Volume Profibus $ClassVolume 0.0.250.7
!
!
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! network is made possible.
! network is made possible.
!
!
! There are two SAP types reflecting the different characteristics of Master Stations and
! There are two SAP types reflecting the different characteristics of Master Stations and
! Slave Stations. Usually, "regular" SAP's are activated on Master Stations whereas Responder
! Slave Stations. Usually, "regular" SAP's are activated on Master Stations whereas Responder
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
!
!
! There are five types of data transfer services that can be configured. Three for sending and/or
! There are five types of data transfer services that can be configured. Three for sending and/or
! requesting data and two for preparing reply data (only one supported).
! requesting data and two for preparing reply data (only one supported).
!
!
! The first three of them are used from a SAP and cannot be used with a responder SAP (RSAP). These
! The first three of them are used from a SAP and cannot be used with a responder SAP (RSAP). These
! are SDA (Send Data with Acknowledge), SDN (Send Data with No acknowledge) and SRD (Send and Request
! are SDA (Send Data with Acknowledge), SDN (Send Data with No acknowledge) and SRD (Send and Request
! Data with reply). When requesting data no data need to be sent.
! Data with reply). When requesting data no data need to be sent.
!
!
! The other two services are used together with a responder SAP (RSAP) to prepare the reply data
! The other two services are used together with a responder SAP (RSAP) to prepare the reply data
! that will be sent back to a SAP upon the receipt of a SDA, SDN or SRD. These are RU (Reply-Update,
! that will be sent back to a SAP upon the receipt of a SDA, SDN or SRD. These are RU (Reply-Update,
! this one is not supported) and RUM (Reply-Update-Multiple)
! this one is not supported) and RUM (Reply-Update-Multiple)
!
!
! Each data transfer is configured with the destination address (address of remote (R)SAP).
! Each data transfer is configured with the destination address (address of remote (R)SAP).
!
!
! The data that is to be sent or received are created as standard I/O channels which should be
! The data that is to be sent or received are created as standard I/O channels which should be
! created as children to the Pb_FDL_DataTransfer-object. When receiveing data, the data will always
! created as children to the Pb_FDL_DataTransfer-object. When receiveing data, the data will always
! be directed to the first (top) Pb_FDL_DataTransfer-object found as a child to the
! be directed to the first (top) Pb_FDL_DataTransfer-object found as a child to the
! Pb_FDL_SAP-object.
! Pb_FDL_SAP-object.
!
!
! See Proview documentation 'Guide to I/O Systems' for more information.
! See Proview documentation 'Guide to I/O Systems' for more information.
!
!
! @bConfiguration
! @bConfiguration
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
!
!
! I/O-channels are created as children to the Pb_FDL_DataTransfer-object to represent the
! I/O-channels are created as children to the Pb_FDL_DataTransfer-object to represent the
! data being sent and/or received.
! data being sent and/or received.
!
!
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! the data that will be sent back by a SRD request.
! the data that will be sent back by a SRD request.
!
!
...
@@ -4341,11 +4352,11 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4341,11 +4352,11 @@ Volume Profibus $ClassVolume 0.0.250.7
! FDLIF_SRD - Send and Request Data with reply
! FDLIF_SRD - Send and Request Data with reply
! FDLIF_RU - Reply Update (not supprted, RUM will always be used)
! FDLIF_RU - Reply Update (not supprted, RUM will always be used)
! FDLIF_RUM - Reply Update Multiple
! FDLIF_RUM - Reply Update Multiple
!
!
! SDA and SDN can also receive data explictly sent with a SDA or SDN service from a
! SDA and SDN can also receive data explictly sent with a SDA or SDN service from a
! remote SAP. If more than one Pb_FDL_DataTransfer objects have been created for a single
! remote SAP. If more than one Pb_FDL_DataTransfer objects have been created for a single
! SAP then the first child will receive the data.
! SAP then the first child will receive the data.
!*/
!*/
Object Type $Attribute 16 14-AUG-2014 15:43:27.65
Object Type $Attribute 16 14-AUG-2014 15:43:27.65
Body SysBody 14-AUG-2014 15:44:26.58
Body SysBody 14-AUG-2014 15:44:26.58
Attr PgmName = "Type"
Attr PgmName = "Type"
...
@@ -4356,7 +4367,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4356,7 +4367,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!/**
!/**
! Result of operation.
! Result of operation.
! FDL_OK - If no error was reported during operation.
! FDL_OK - If no error was reported during operation.
!*/
!*/
Object Result $Attribute 18 21-AUG-2014 14:33:17.09
Object Result $Attribute 18 21-AUG-2014 14:33:17.09
Body SysBody 21-AUG-2014 15:06:59.67
Body SysBody 21-AUG-2014 15:06:59.67
Attr PgmName = "Result"
Attr PgmName = "Result"
...
@@ -4367,7 +4378,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4367,7 +4378,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!/**
!/**
! Send request.
! Send request.
! Setting of this flag will trigger the data transfer service.
! Setting of this flag will trigger the data transfer service.
!*/
!*/
Object SendReq $Attribute 17 14-AUG-2014 15:58:41.14
Object SendReq $Attribute 17 14-AUG-2014 15:58:41.14
Body SysBody 14-AUG-2014 15:58:47.91
Body SysBody 14-AUG-2014 15:58:47.91
Attr PgmName = "SendReq"
Attr PgmName = "SendReq"
...
...
src/exp/com/src/os_linux/upgrade.sh
View file @
c95797a2
...
@@ -628,7 +628,7 @@ usage()
...
@@ -628,7 +628,7 @@ usage()
{
{
cat
<<
EOF
cat
<<
EOF
upgrade.sh Upgrade from V5.
3.1 to V5.4.0
upgrade.sh Upgrade from V5.
4 to V5.5
Pass
Pass
...
@@ -636,7 +636,7 @@ usage()
...
@@ -636,7 +636,7 @@ usage()
savedirectory Save directory volume.
savedirectory Save directory volume.
classvolumes Create loadfiles for classvolumes.
classvolumes Create loadfiles for classvolumes.
updateclasses Update classes.
updateclasses Update classes.
cnvobjects
Create OpPlaceWeb object
s.
cnvobjects
Update Profinet module
s.
compile Compile all plcprograms in the database
compile Compile all plcprograms in the database
createload Create new loadfiles.
createload Create new loadfiles.
buildnodes Build all nodes in the project.
buildnodes Build all nodes in the project.
...
...
src/exp/com/src/os_linux/upgrade_pb.pwr_com
View file @
c95797a2
!** Invisible: Script for
to create OpPlaceWeb from WebHandler objects during upgrading from V5.3 to V5.4
!** Invisible: Script for
upgrading Profinet modules during upgrading from V5.4 to V5.5
!
!
# Proview Open Source Process Control.
# Proview Open Source Process Control.
# Copyright (C) 2005-2016 SSAB EMEA AB.
# Copyright (C) 2005-2016 SSAB EMEA AB.
...
@@ -35,234 +35,102 @@
...
@@ -35,234 +35,102 @@
# General Public License plus this exception.
# General Public License plus this exception.
!
!
!
!
! Script
to create OpPlaceWeb objects during upgrading from V5.3 to V5.4
,
! Script
for upgrading Profinet modules during upgrading from V5.4 to V5.5
,
!
!
!
Find all WebHandler objects and create an OpPlaceWeb
.
!
Sets the Slot attribute
.
!
!
main()
function int is_numeric( string s)
string s1;
int ret = 0;
int len;
s1 = extract( 1, 1, s);
if ( s1 == "0" || s1 == "1" || s1 == "2" || s1 == "3" || s1 == "4" || s1 == "5" || s1 == "6" || s1 == "7" || s1 == "8" || s1 == "9")
ret = 1;
endif
len = strlen(s);
if ( len > 1)
s1 = extract( 2, 1, s);
if ( s1 == "0" || s1 == "1" || s1 == "2" || s1 == "3" || s1 == "4" || s1 == "5" || s1 == "6" || s1 == "7" || s1 == "8" || s1 == "9")
ret = 1;
endif
endif
return ret;
endfunction
function int set_slot( string mclass)
string name;
string name;
string
op
name;
string
s
name;
string
aname
;
string
snum
;
string aopname
;
int num
;
string attr
str
;
string attr;
int attri
nt;
string pare
nt;
string child;
string child;
string prevchild;
string class;
string nchild;
string nclass;
int idx;
int sts;
verify(0);
verify(0);
name = GetClassListAttrRef("WebHandler");
name = GetClassList( mclass);
while ( name != "")
while ( name != "")
sname = CutObjectName( name, 1);
idx = strrchr( name, "-") - 1;
snum = extract( 2, 5, sname);
opname = extract( 1, idx, name);
opname = opname + "-OpWeb";
num = is_numeric( snum);
printf( "--\n");
if ( num == 1)
printf( "-- Creating OpPlaceWeb object %s\n", opname);
printf( "--\n");
num = snum;
sts = CreateObject( "OpWeb", "OpPlaceWeb", name, 3);
if ( EVEN(sts))
attr = name + ".Slot";
printf( "** Unable to create object %s, sts %d\n", opname, sts);
SetAttribute( attr, num);
quit
printf( "%s %d\n", name, num);
endif
else
# Count siblings
aname = name + ".FileName";
parent = GetParent( name);
aopname = opname + ".FileName";
child = GetChild( parent);
attrstr = GetAttribute( aname, sts);
num = 1;
if ( EVEN(sts))
while ( child != "")
printf( "Attribute error: %s\n", aname);
if ( child == name)
endif
attr = name + ".Slot";
sts = SetAttribute( aopname, attrstr);
SetAttribute( attr, num);
if ( EVEN(sts))
printf( "%s %d\n", name, num);
printf( "Attribute error: %s\n", aopname);
break;
endif
endif
aname = name + ".Title";
aopname = opname + ".Title";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".Text";
aopname = opname + ".Text";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableLanguage";
aopname = opname + ".EnableLanguage";
attrint = GetAttribute( aname, sts);
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableLogin";
aopname = opname + ".EnableLogin";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableAlarmList";
aopname = opname + ".EnableAlarmList";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableEventLog";
aopname = opname + ".EnableEventLog";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".DisableHelp";
aopname = opname + ".DisableHelp";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".DisableProview";
aopname = opname + ".DisableProview";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".Language";
aopname = opname + ".Language";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".StyleSheet";
aopname = opname + ".StyleSheet";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".StartURL";
child = GetNextSibling( child);
aopname = opname + ".StartURL";
num++;
attrstr = GetAttribute( aname, sts);
endwhile
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
endif
aname = name + ".LoadArchives";
name = GetNextObject( name);
aopname = opname + ".LoadArchives";
attrstr = GetAttribute( aname, sts);
endwhile
if ( EVEN(sts))
return 1;
printf( "Attribute error: %s\n", aname);
endfunction
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".PwrHost";
aopname = opname + ".PwrHost";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".AppletSignature";
main()
aopname = opname + ".AppletSignature";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
# Move WebGraph, WebLink, AppGraph and AppLink objects
set_slot( "PnModule");
child = GetChild( name);
set_slot( "BaseFcPPO3PnModule");
prevchild = "";
set_slot( "ABB_ACS880_PnModule");
while ( child != "")
set_slot( "Siemens_Di4_PnModule");
class = GetObjectClass( child);
set_slot( "Siemens_Di2_PnModule");
if ( class == "WebGraph" || class == "WebLink" || class == "AppGraph" || class == "AppLink")
set_slot( "Siemens_Do4_PnModule");
MoveObject( child, opname, 2);
set_slot( "Siemens_Do2_PnModule");
child = prevchild;
set_slot( "Siemens_Di32_PnModule");
endif
set_slot( "Siemens_D16_PnModule");
if ( class == "$NodeHier")
set_slot( "Siemens_Dx16_PnModule");
nchild = GetChild( child);
set_slot( "Siemens_Di8_PnModule");
if ( nchild != "")
set_slot( "Siemens_Do32_PnModule");
nclass = GetObjectClass( nchild);
set_slot( "Siemens_Do16_PnModule");
if ( nclass == "WebGraph" || nclass == "WebLink" || nclass == "AppGraph" || nclass == "AppLink")
set_slot( "Siemens_Do8_PnModule");
MoveObject( child, opname, 2);
set_slot( "Siemens_Ai8_PnModule");
child = prevchild;
set_slot( "Siemens_Ai4_PnModule");
endif
set_slot( "Siemens_Ai2_PnModule");
endif
set_slot( "Siemens_Ao8_PnModule");
endif
set_slot( "Siemens_Ao4_PnModule");
prevchild = child;
set_slot( "Sinamics_Tgm1_PnModule");
if ( child == "")
child = GetChild( name);
else
child = GetNextSibling( child);
endif
endwhile
name = GetNextAttrRef( "WebHandler", name);
endwhile
save
endmain
endmain
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