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
91002187
Commit
91002187
authored
Mar 08, 2017
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profinet stall action added, and Profibus StartupTime to ignore errorcount at startup
parent
08f1360d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
20 deletions
+98
-20
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
+10
-3
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
+55
-12
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
+2
-0
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
+2
-0
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+29
-5
No files found.
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
View file @
91002187
...
...
@@ -109,6 +109,8 @@ static pwr_tStatus IoRackInit (
errh_Info
(
"Init of Profibus DP Slave and Modules %s"
,
name
);
op
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
local
->
start_time
=
(
int
)(
op
->
StartupTime
/
ctx
->
ScanTime
);
// Do configuration check and initialize modules.
...
...
@@ -329,10 +331,14 @@ static pwr_tStatus IoRackRead (
{
pwr_sClass_Pb_Profiboard
*
mp
;
pwr_sClass_Pb_DP_Slave
*
sp
;
io_sRackLocal
*
local
=
(
io_sRackLocal
*
)
rp
->
Local
;
sp
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
mp
=
(
pwr_sClass_Pb_Profiboard
*
)
ap
->
op
;
if
(
local
->
start_cnt
<
local
->
start_time
)
local
->
start_cnt
++
;
/* The reading of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
...
...
@@ -342,7 +348,8 @@ static pwr_tStatus IoRackRead (
sp
->
ErrorCount
=
0
;
}
else
{
sp
->
ErrorCount
++
;
if
(
local
->
start_cnt
>=
local
->
start_time
)
sp
->
ErrorCount
++
;
}
if
(
sp
->
ErrorCount
==
sp
->
ErrorSoftLimit
)
{
...
...
@@ -355,11 +362,11 @@ static pwr_tStatus IoRackRead (
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
rp
->
Objid
);
}
if
(
sp
->
ErrorCount
>
sp
->
Error
SoftLimit
&&
sp
->
StallAction
>
=
pwr_ePbStallAction_ResetInputs
)
{
if
(
sp
->
ErrorCount
>
sp
->
Error
HardLimit
&&
sp
->
StallAction
=
=
pwr_ePbStallAction_ResetInputs
)
{
memset
(
&
sp
->
Inputs
,
0
,
sp
->
BytesOfInput
);
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorHardLimit
&&
sp
->
StallAction
>
=
pwr_ePbStallAction_EmergencyBreak
)
{
if
(
sp
->
ErrorCount
>
sp
->
ErrorHardLimit
&&
sp
->
StallAction
=
=
pwr_ePbStallAction_EmergencyBreak
)
{
ctx
->
Node
->
EmergBreakTrue
=
1
;
}
}
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
View file @
91002187
...
...
@@ -55,6 +55,7 @@ static pwr_tStatus IoRackInit (
)
{
io_sPnCardLocal
*
local_card
;
io_sPnRackLocal
*
local
;
io_sCard
*
cardp
;
short
input_counter
;
short
output_counter
;
...
...
@@ -79,6 +80,9 @@ static pwr_tStatus IoRackInit (
errh_Info
(
"Init of Profinet Device and Modules %s"
,
name
);
op
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
local
=
(
io_sPnRackLocal
*
)
rp
->
Local
;
local
->
start_time
=
(
int
)(
op
->
StartupTime
/
ctx
->
ScanTime
);
// Do configuration check and initialize modules.
...
...
@@ -231,9 +235,11 @@ static pwr_tStatus IoRackRead (
io_sRack
*
rp
)
{
pwr_sClass_PnDevice
*
sp
;
pwr_sClass_PnDevice
*
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
io_sPnRackLocal
*
local
=
(
io_sPnRackLocal
*
)
rp
->
Local
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
if
(
local
->
start_cnt
<
local
->
start_time
)
local
->
start_cnt
++
;
/* The reading of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
...
...
@@ -242,17 +248,30 @@ static pwr_tStatus IoRackRead (
sp
->
ErrorCount
=
0
;
}
else
{
sp
->
ErrorCount
++
;
if
(
local
->
start_cnt
>=
local
->
start_time
)
sp
->
ErrorCount
++
;
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorSoftLimit
)
{
if
(
((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
>
0
)
memset
(((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
inputs
,
0
,
((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
);
if
(
sp
->
ErrorCount
==
sp
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', stall action %d"
,
rp
->
Name
,
sp
->
StallAction
);
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
rp
->
Objid
);
sp
->
ErrorCount
++
;
}
else
if
(
sp
->
ErrorCount
==
sp
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
rp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
rp
->
Objid
);
sp
->
ErrorCount
++
;
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorHardLimit
)
{
if
(
sp
->
StallAction
==
pwr_ePbStallAction_ResetInputs
)
{
if
(
((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
>
0
)
memset
(((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
inputs
,
0
,
((
io_sPnRackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
);
}
else
if
(
sp
->
StallAction
==
pwr_ePbStallAction_EmergencyBreak
)
ctx
->
Node
->
EmergBreakTrue
=
1
;
}
// if (sp->ErrorCount > sp->ErrorHardLimit && sp->StallAction >= pwr_ePbStallAction_EmergencyBreak) {
// ctx->Node->EmergBreakTrue = 1;
// }
return
IO__SUCCESS
;
}
...
...
@@ -267,13 +286,37 @@ static pwr_tStatus IoRackWrite (
io_sRack
*
rp
)
{
pwr_sClass_PnDevice
*
sp
;
pwr_sClass_PnDevice
*
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
io_sPnRackLocal
*
local
=
(
io_sPnRackLocal
*
)
rp
->
Local
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
/* The writing of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
if
(
sp
->
Status
==
PB__NORMAL
)
{
sp
->
ErrorCount
=
0
;
}
else
{
if
(
local
->
start_cnt
>=
local
->
start_time
)
sp
->
ErrorCount
++
;
}
if
(
sp
->
ErrorCount
==
sp
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', stall action %d"
,
rp
->
Name
,
sp
->
StallAction
);
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
rp
->
Objid
);
sp
->
ErrorCount
++
;
}
else
if
(
sp
->
ErrorCount
==
sp
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
rp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
rp
->
Objid
);
sp
->
ErrorCount
++
;
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorHardLimit
)
{
if
(
sp
->
StallAction
==
pwr_ePbStallAction_EmergencyBreak
)
ctx
->
Node
->
EmergBreakTrue
=
1
;
}
return
IO__SUCCESS
;
}
...
...
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
View file @
91002187
...
...
@@ -76,6 +76,8 @@
typedef
struct
_io_sRackLocal
{
unsigned
char
fdl
;
unsigned
char
dp
;
unsigned
int
start_time
;
unsigned
int
start_cnt
;
}
io_sRackLocal
;
...
...
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
View file @
91002187
...
...
@@ -45,6 +45,8 @@ typedef struct _io_sPnRackLocal {
unsigned
char
*
inputs
;
unsigned
char
*
outputs
;
void
*
userdata
;
unsigned
int
start_time
;
unsigned
int
start_cnt
;
}
io_sPnRackLocal
;
typedef
struct
_io_sPnCardLocal
{
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
91002187
...
...
@@ -1150,7 +1150,7 @@ Volume Profibus $ClassVolume 0.0.250.7
Object RtBody $ObjBodyDef 1 16-JAN-2006 09:46:40.50
Body SysBody 16-JAN-2006 09:46:40.50
Attr StructName = "Pb_DP_Slave"
Attr NextAix = "_X4
4
"
Attr NextAix = "_X4
5
"
EndBody
!/**
! Description of slave
...
...
@@ -1425,6 +1425,13 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object StartupTime $Attribute 44 22-FEB-2017 12:50:19.18
Body SysBody 22-FEB-2017 12:50:20.51
Attr PgmName = "StartupTime"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Length of the parameter data to be sent to the slave during initialization.
!*/
...
...
@@ -1772,13 +1779,14 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndObject
Object Template Pb_DP_Slave 2149285888 01-JAN-1970 01:00:00.00
Body RtBody
01-JAN-1970 01:00:00.0
0
Body RtBody
22-FEB-2017 12:49:46.9
0
Attr Process = 1
Attr StallAction = 1
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr WdFact1 = 10
Attr WdFact2 = 10
Attr StartupTime = 5.000000e+00
EndBody
EndObject
EndObject
...
...
@@ -3427,7 +3435,7 @@ Volume Profibus $ClassVolume 0.0.250.7
Object RtBody $ObjBodyDef 1 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
Attr StructName = "PnDevice"
Attr NextAix = "_X10
6
"
Attr NextAix = "_X10
8
"
EndBody
!/**
! Description.
...
...
@@ -3506,6 +3514,20 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object StallAction $Attribute 106 22-FEB-2017 15:27:36.86
Body SysBody 22-FEB-2017 15:27:36.86
Attr PgmName = "StallAction"
Attr Size = 4
Attr TypeRef = "Profibus:Type-PbStallActionEnum"
EndBody
EndObject
Object StartupTime $Attribute 107 22-FEB-2017 16:11:42.18
Body SysBody 22-FEB-2017 16:11:42.18
Attr PgmName = "StartupTime"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! ErrorCount will increase every cycle if status is not PN__NORMAL.
!*/
...
...
@@ -3798,8 +3820,10 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndObject
Object Template PnDevice 2151907328 01-JAN-1970 01:00:00.00
Body RtBody
30-JUN-2010 11:04:35.19
Body RtBody
22-FEB-2017 16:12:07.73
Attr Process = 1
Attr StallAction = 1
Attr StartupTime = 5.000000e+00
Attr ErrorSoftLimit = 100
Attr ErrorHardLimit = 1000
EndBody
...
...
@@ -3878,7 +3902,7 @@ Volume Profibus $ClassVolume 0.0.250.7
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 = 4
0
Attr Size = 4
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
...
...
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