Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
开源群组
pyprofibus
Commits
0abfaff8
Commit
0abfaff8
authored
4 years ago
by
Michael Buesch
Browse files
Options
Download
Email Patches
Plain Diff
dp: Print debug message, if slave requeste Set_Prm frame
parent
5538b2e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
pyprofibus/dp.py
pyprofibus/dp.py
+11
-10
pyprofibus/dp_master.py
pyprofibus/dp_master.py
+5
-1
No files found.
pyprofibus/dp.py
View file @
0abfaff8
...
...
@@ -305,7 +305,7 @@ class DpTelegram_SlaveDiag_Con(DpTelegram):
dsap
=
DpTelegram
.
SSAP_MS0
,
ssap
=
DpTelegram
.
DSAP_SLAVE_DIAG
):
DpTelegram
.
__init__
(
self
,
da
=
da
,
sa
=
sa
,
fc
=
fc
,
dsap
=
dsap
,
ssap
=
ssap
)
dsap
=
dsap
,
ssap
=
ssap
)
self
.
b0
=
0
self
.
b1
=
0
self
.
b2
=
0
...
...
@@ -376,19 +376,20 @@ class DpTelegram_SlaveDiag_Con(DpTelegram):
def
hasOnebit
(
self
):
return
(
self
.
b1
&
self
.
B1_ONE
)
!=
0
def
prmReq
(
self
):
return
(
self
.
b1
&
self
.
B1_PRMREQ
)
!=
0
def
needsNewPrmCfg
(
self
):
return
((
self
.
b0
&
self
.
B0_CFGFLT
)
!=
0
or
\
(
self
.
b0
&
self
.
B0_PRMFLT
)
!=
0
or
\
return
((
self
.
b0
&
self
.
B0_CFGFLT
)
!=
0
or
(
self
.
b0
&
self
.
B0_PRMFLT
)
!=
0
or
(
self
.
b1
&
self
.
B1_PRMREQ
)
!=
0
)
def
isReadyDataEx
(
self
):
return
not
((
self
.
b0
&
(
\
self
.
B0_STANOEX
|
\
self
.
B0_STANORDY
|
\
self
.
B0_CFGFLT
|
\
self
.
B0_PRMFLT
))
!=
0
or
\
(
self
.
b1
&
(
\
self
.
B1_PRMREQ
))
!=
0
)
return
((
self
.
b0
&
(
self
.
B0_STANOEX
|
self
.
B0_STANORDY
|
self
.
B0_CFGFLT
|
self
.
B0_PRMFLT
))
==
0
and
(
self
.
b1
&
(
self
.
B1_PRMREQ
))
==
0
)
class
DpTelegram_SetPrm_Req
(
DpTelegram
):
# Station status
...
...
This diff is collapsed.
Click to expand it.
pyprofibus/dp_master.py
View file @
0abfaff8
...
...
@@ -529,6 +529,10 @@ class DpMaster(object):
self
.
__errorMsg
(
"Slave %d reports a faulty "
"parameterization (Set_Prm)."
%
\
slave
.
slaveDesc
.
slaveAddr
)
if
telegram
.
prmReq
():
self
.
__debugMsg
(
"Slave %d requests a new "
"parameterization (Set_Prm)."
%
\
slave
.
slaveDesc
.
slaveAddr
)
if
telegram
.
isNotSupp
():
self
.
__errorMsg
(
"Slave %d replied with "
"
\"
function not supported
\"
. "
...
...
@@ -543,9 +547,9 @@ class DpMaster(object):
self
.
__debugMsg
(
"Slave %d diagnostic "
"always-one-bit is zero."
%
\
slave
.
slaveDesc
.
slaveAddr
)
if
telegram
.
hasExtDiag
():
pass
#TODO turn on red DIAG-LED
if
telegram
.
isReadyDataEx
():
slave
.
setState
(
slave
.
STATE_DX
)
return
None
...
...
This diff is collapsed.
Click to expand it.
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