Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ecmccfg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Anders Sandström_1
ecmccfg
Commits
6b9f1dfb
Commit
6b9f1dfb
authored
5 years ago
by
Anders Sandström
Browse files
Options
Downloads
Patches
Plain Diff
Add plc: Workaround for no switch example (not nice and not tested)..
parent
21f0b8e1
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/test/plc/noLimit.plc
+29
-0
29 additions, 0 deletions
examples/test/plc/noLimit.plc
with
29 additions
and
0 deletions
examples/test/plc/noLimit.plc
0 → 100644
+
29
−
0
View file @
6b9f1dfb
###############################################################################################
# For help on syntax, variables and functions, please read the file: "plcSyntaxHelp.plc"
#
# Workaround for NO limit switches.
#
# Code Description:
# Low limit is connected to ec0.s1.INPIN_1
# High limit is connected to ec0.s1.INPIN_2
# ec0.s1.ONE.0 shall be used as low limit in axis cfg file
# ec0.s1.ONE.1 shall be used as high limit in axis cfg file
# This workaround is needed since limits only can be linked to ethercat entries and NC switches (for safety reason)..
# Use this or similar code in an axis plc or in a normal plc..
#
#Low limit: Use ec0.s1.ONE bit 0
if(not(ec0.s1.INPIN_1)) {
ec0.s1.ONE:=ec_set_bit(ec0.s1.ONE,0);
}
else{
ec0.s1.ONE:=ec_clr_bit(ec0.s1.ONE,0);
};
#Low limit: Use ec0.s1.ONE bit 1
if(not(ec0.s1.INPIN_2)) {
ec0.s1.ONE:=ec_set_bit(ec0.s1.ONE,1);
}
else{
ec0.s1.ONE:=ec_clr_bit(ec0.s1.ONE,1);
};
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