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
ee657b42
"require-ess/src/expr.c" did not exist on "4e30b97c994548e53b69b049d95f34bbbef739dc"
Commit
ee657b42
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes to minimal example.
parent
4a9d9faa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/mini/mini.c
+11
-12
11 additions, 12 deletions
examples/mini/mini.c
with
11 additions
and
12 deletions
examples/mini/mini.c
+
11
−
12
View file @
ee657b42
...
...
@@ -50,6 +50,9 @@
#define PFX "ec_mini: "
#define AnaInPos 0, 5
#define DigOutPos 0, 3
/*****************************************************************************/
// EtherCAT
...
...
@@ -80,8 +83,8 @@ static unsigned int blink = 0;
#define Beckhoff_EL3162 0x00000002, 0x0C5A3052
const
static
ec_pdo_entry_reg_t
domain1_regs
[]
=
{
{
0
,
1
,
Beckhoff_EL3162
,
0x3101
,
2
,
&
off_ana_in
},
{
0
,
3
,
Beckhoff_EL2004
,
0x3001
,
1
,
&
off_dig_out
},
{
AnaInPos
,
Beckhoff_EL3162
,
0x3101
,
2
,
&
off_ana_in
},
{
DigOutPos
,
Beckhoff_EL2004
,
0x3001
,
1
,
&
off_dig_out
},
{}
};
...
...
@@ -116,6 +119,7 @@ static ec_pdo_info_t el2004_pdos[] = {
{
EC_DIR_OUTPUT
,
0x1601
,
1
,
&
el2004_channels
[
1
]},
{
EC_DIR_OUTPUT
,
0x1602
,
1
,
&
el2004_channels
[
2
]},
{
EC_DIR_OUTPUT
,
0x1603
,
1
,
&
el2004_channels
[
3
]},
{
EC_END
}
};
#endif
...
...
@@ -191,7 +195,6 @@ void read_sdo(void)
{
switch
(
ecrt_sdo_request_state
(
sdo
))
{
case
EC_SDO_REQUEST_UNUSED
:
// request was not used yet
ecrt_sdo_request_timeout
(
sdo
,
500
);
// ms
ecrt_sdo_request_read
(
sdo
);
// trigger first read
break
;
case
EC_SDO_REQUEST_BUSY
:
...
...
@@ -299,7 +302,7 @@ int __init init_mini_module(void)
}
if
(
!
(
sc_ana_in
=
ecrt_master_slave_config
(
master
,
0
,
1
,
Beckhoff_EL3162
)))
{
master
,
AnaInPos
,
Beckhoff_EL3162
)))
{
printk
(
KERN_ERR
PFX
"Failed to get slave configuration.
\n
"
);
goto
out_release_master
;
}
...
...
@@ -311,12 +314,12 @@ int __init init_mini_module(void)
goto
out_release_master
;
}
if
(
!
(
sc
=
ecrt_master_slave_config
(
master
,
0
,
3
,
Beckhoff_EL2004
)))
{
if
(
!
(
sc
=
ecrt_master_slave_config
(
master
,
DigOutPos
,
Beckhoff_EL2004
)))
{
printk
(
KERN_ERR
PFX
"Failed to get slave configuration.
\n
"
);
goto
out_release_master
;
}
if
(
ecrt_slave_config_pdos
(
sc
,
4
,
el2004_pdos
))
{
if
(
ecrt_slave_config_pdos
(
sc
,
EC_END
,
el2004_pdos
))
{
printk
(
KERN_ERR
PFX
"Failed to configure Pdos.
\n
"
);
goto
out_release_master
;
}
...
...
@@ -324,15 +327,11 @@ int __init init_mini_module(void)
#ifdef SDO_ACCESS
printk
(
KERN_INFO
PFX
"Creating Sdo requests...
\n
"
);
if
(
!
(
sc
=
ecrt_master_slave_config
(
master
,
0
,
1
,
Beckhoff_EL3162
)))
{
printk
(
KERN_ERR
PFX
"Failed to get slave configuration.
\n
"
);
goto
out_release_master
;
}
if
(
!
(
sdo
=
ecrt_slave_config_create_sdo_request
(
sc
,
0x3102
,
2
,
2
)))
{
if
(
!
(
sdo
=
ecrt_slave_config_create_sdo_request
(
sc_ana_in
,
0x3102
,
2
,
2
)))
{
printk
(
KERN_ERR
PFX
"Failed to create Sdo request.
\n
"
);
goto
out_release_master
;
}
ecrt_sdo_request_timeout
(
sdo
,
500
);
// ms
#endif
printk
(
KERN_INFO
PFX
"Registering Pdo entries...
\n
"
);
...
...
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