Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
ICS Control System Infrastructure
etherlabmaster
Commits
2001a788
Commit
2001a788
authored
17 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
CoE state machines raising error, if the slave does not support CoE.
parent
d80993ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
master/fsm_coe.c
+18
-0
18 additions, 0 deletions
master/fsm_coe.c
master/fsm_coe.h
+3
-6
3 additions, 6 deletions
master/fsm_coe.h
with
21 additions
and
6 deletions
master/fsm_coe.c
+
18
−
0
View file @
2001a788
...
@@ -249,6 +249,12 @@ void ec_fsm_coe_dict_start(ec_fsm_coe_t *fsm /**< finite state machine */)
...
@@ -249,6 +249,12 @@ void ec_fsm_coe_dict_start(ec_fsm_coe_t *fsm /**< finite state machine */)
ec_slave_t
*
slave
=
fsm
->
slave
;
ec_slave_t
*
slave
=
fsm
->
slave
;
uint8_t
*
data
;
uint8_t
*
data
;
if
(
!
(
slave
->
sii_mailbox_protocols
&
EC_MBOX_COE
))
{
EC_ERR
(
"Slave %u does not support CoE!
\n
"
,
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_error
;
return
;
}
if
(
!
(
data
=
ec_slave_mbox_prepare_send
(
slave
,
datagram
,
0x03
,
8
)))
{
if
(
!
(
data
=
ec_slave_mbox_prepare_send
(
slave
,
datagram
,
0x03
,
8
)))
{
fsm
->
state
=
ec_fsm_coe_error
;
fsm
->
state
=
ec_fsm_coe_error
;
return
;
return
;
...
@@ -955,6 +961,12 @@ void ec_fsm_coe_down_start(ec_fsm_coe_t *fsm /**< finite state machine */)
...
@@ -955,6 +961,12 @@ void ec_fsm_coe_down_start(ec_fsm_coe_t *fsm /**< finite state machine */)
EC_DBG
(
"Downloading Sdo 0x%04X:%i to slave %i.
\n
"
,
EC_DBG
(
"Downloading Sdo 0x%04X:%i to slave %i.
\n
"
,
sdodata
->
index
,
sdodata
->
subindex
,
slave
->
ring_position
);
sdodata
->
index
,
sdodata
->
subindex
,
slave
->
ring_position
);
if
(
!
(
slave
->
sii_mailbox_protocols
&
EC_MBOX_COE
))
{
EC_ERR
(
"Slave %u does not support CoE!
\n
"
,
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_error
;
return
;
}
if
(
slave
->
sii_rx_mailbox_size
<
6
+
10
+
sdodata
->
size
)
{
if
(
slave
->
sii_rx_mailbox_size
<
6
+
10
+
sdodata
->
size
)
{
EC_ERR
(
"Sdo fragmenting not supported yet!
\n
"
);
EC_ERR
(
"Sdo fragmenting not supported yet!
\n
"
);
fsm
->
state
=
ec_fsm_coe_error
;
fsm
->
state
=
ec_fsm_coe_error
;
...
@@ -1170,6 +1182,12 @@ void ec_fsm_coe_up_start(ec_fsm_coe_t *fsm /**< finite state machine */)
...
@@ -1170,6 +1182,12 @@ void ec_fsm_coe_up_start(ec_fsm_coe_t *fsm /**< finite state machine */)
EC_DBG
(
"Uploading Sdo 0x%04X:%i from slave %i.
\n
"
,
EC_DBG
(
"Uploading Sdo 0x%04X:%i from slave %i.
\n
"
,
entry
->
sdo
->
index
,
entry
->
subindex
,
slave
->
ring_position
);
entry
->
sdo
->
index
,
entry
->
subindex
,
slave
->
ring_position
);
if
(
!
(
slave
->
sii_mailbox_protocols
&
EC_MBOX_COE
))
{
EC_ERR
(
"Slave %u does not support CoE!
\n
"
,
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_error
;
return
;
}
if
(
!
(
data
=
ec_slave_mbox_prepare_send
(
slave
,
datagram
,
0x03
,
10
)))
{
if
(
!
(
data
=
ec_slave_mbox_prepare_send
(
slave
,
datagram
,
0x03
,
10
)))
{
fsm
->
state
=
ec_fsm_coe_error
;
fsm
->
state
=
ec_fsm_coe_error
;
return
;
return
;
...
...
This diff is collapsed.
Click to expand it.
master/fsm_coe.h
+
3
−
6
View file @
2001a788
...
@@ -51,12 +51,9 @@
...
@@ -51,12 +51,9 @@
typedef
struct
ec_fsm_coe
ec_fsm_coe_t
;
/**< \see ec_fsm_coe */
typedef
struct
ec_fsm_coe
ec_fsm_coe_t
;
/**< \see ec_fsm_coe */
/**
/** Finite state machines for the CANopen-over-EtherCAT protocol.
Finite state machine of an EtherCAT master.
*/
*/
struct
ec_fsm_coe
{
struct
ec_fsm_coe
{
ec_slave_t
*
slave
;
/**< slave the FSM runs on */
ec_slave_t
*
slave
;
/**< slave the FSM runs on */
ec_datagram_t
*
datagram
;
/**< datagram used in the state machine */
ec_datagram_t
*
datagram
;
/**< datagram used in the state machine */
unsigned
int
retries
;
/**< retries upon datagram timeout */
unsigned
int
retries
;
/**< retries upon datagram timeout */
...
...
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