Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebpfCAT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
karaboDevices
ebpfCAT
Commits
38e06102
Commit
38e06102
authored
2 years ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
pre-operational is good enough to read terminals
parent
f2622cf9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ebpfcat/ethercat.py
+3
-1
3 additions, 1 deletion
ebpfcat/ethercat.py
ebpfcat/scripts.py
+3
-3
3 additions, 3 deletions
ebpfcat/scripts.py
with
6 additions
and
4 deletions
ebpfcat/ethercat.py
+
3
−
1
View file @
38e06102
...
...
@@ -531,7 +531,7 @@ class Terminal:
ret
,
=
await
self
.
ec
.
roundtrip
(
ECCmd
.
FPRD
,
self
.
position
,
0x0130
,
"
H
"
)
return
ret
async
def
to_operational
(
self
):
async
def
to_operational
(
self
,
target
=
8
):
"""
try to bring the terminal to operational state
this tries to push the terminal through its state machine to the
...
...
@@ -556,6 +556,8 @@ class Terminal:
0x0130
,
"
H2xH
"
)
if
error
!=
0
:
raise
EtherCatError
(
f
"
AL register
{
error
}
"
)
if
state
==
target
:
return
async
def
get_error
(
self
):
"""
read the error register
"""
...
...
This diff is collapsed.
Click to expand it.
ebpfcat/scripts.py
+
3
−
3
View file @
38e06102
...
...
@@ -69,7 +69,7 @@ async def info():
i
+=
infos
[
i
]
+
1
if
args
.
sdo
:
await
t
.
to_operational
()
await
t
.
to_operational
(
4
)
ret
=
await
t
.
read_ODlist
()
for
k
,
v
in
ret
.
items
():
print
(
f
"
{
k
:
X
}
:
"
)
...
...
@@ -86,7 +86,7 @@ async def info():
else
:
print
(
f
"
{
r
}
"
)
if
args
.
pdo
:
await
t
.
to_operational
()
await
t
.
to_operational
(
4
)
await
t
.
parse_pdos
()
for
(
idx
,
subidx
),
(
sm
,
pos
,
fmt
)
in
t
.
pdos
.
items
():
print
(
f
"
{
idx
:
4
X
}
:
{
subidx
:
02
X
}
{
sm
}
{
pos
}
{
fmt
}
"
)
...
...
@@ -159,7 +159,7 @@ async def create_test():
await
t
.
initialize
(
-
i
,
await
ec
.
find_free_address
())
sdo
=
{}
if
t
.
has_mailbox
():
await
t
.
to_operational
()
await
t
.
to_operational
(
4
)
odlist
=
await
t
.
read_ODlist
()
for
k
,
v
in
odlist
.
items
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment