{"id":45914724,"url":"https://github.com/simatic-ax/simple-control-modules","last_synced_at":"2026-02-28T07:32:02.888Z","repository":{"id":116554853,"uuid":"440540022","full_name":"simatic-ax/simple-control-modules","owner":"simatic-ax","description":"Collection of common control modules","archived":false,"fork":false,"pushed_at":"2025-11-10T08:50:05.000Z","size":101,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-11-10T10:22:31.167Z","etag":null,"topics":["iec-st","library","siemens","simatic-ax"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simatic-ax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-21T14:13:16.000Z","updated_at":"2025-11-10T08:50:08.000Z","dependencies_parsed_at":"2023-10-04T17:19:35.005Z","dependency_job_id":"b21e99b2-3769-4b33-8179-2af3011bbfb0","html_url":"https://github.com/simatic-ax/simple-control-modules","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/simatic-ax/simple-control-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Fsimple-control-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Fsimple-control-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Fsimple-control-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Fsimple-control-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simatic-ax","download_url":"https://codeload.github.com/simatic-ax/simple-control-modules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Fsimple-control-modules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29927573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iec-st","library","siemens","simatic-ax"],"created_at":"2026-02-28T07:32:02.013Z","updated_at":"2026-02-28T07:32:02.866Z","avatar_url":"https://github.com/simatic-ax.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple control modules\n\n## Description\n\n## Install this package\n\nEnter:\n\n```cli\napax add @simatic-ax/simple-control-modules\n```\n\n\u003e to install this package you need to login into the GitHub registry. You'll find more information [here](https://github.com/simatic-ax/.github/blob/main/docs/personalaccesstoken.md)\n\n## Namespace\n\n```sh\nSimatic.Ax.SimpleControlModules\n```\n\n## Encoder\n\n### Encoder A\n\nThe EncoderA counts the rising and falling edges of a binary signal.\n\n### EncoderAB\n\nThe EncoderAB is similar to EnocderA but it counts the rising and falling edges of two 90 dregree phase shifted binary signals (SignalA and SignalB). So the counting direction is evaluated automatically.\n\n### Methods of EncoderA and EncoderAB\n\n|||\n|-|-|\n| Evaluate() | Evaluate the SignalA for rising and falling edges and counts them\n| GetValue() : DINT   | Returns the actual counter value |\n| RelativeCount() | Retunrs the relative counter value |\n| Reset | Reset the counter value to 0\n| ResetRelative() | Reset the relative counter value to 0 |\n| SetDirection(mode : CountMode) | Set the counting direction FORWARD or REVERSE\n| SetValue(value : DINT) | Set the actual counter value to value |\n\nConfiguration:\n\n```iec-st\nUSING Siemens.Ax.IO.Input;\nUSING Simatic.Ax.SimpleControlModules;\n\nVAR_GLOBAL\n    sigA : BinSignal;\n    enc : EncoderAB(SignalA := sigA);\nEND_VAR\n```\n\nConfiguration:\n\n```iec-st\nUSING Siemens.Ax.IO.Input;\nUSING Simatic.Ax.SimpleControlModules;\n\nVAR_GLOBAL\n    sigA : BinSignal;\n    sigB : BinSignal;\n    enc : EncoderAB(SignalA := sigA, SignalB := sigB);\nEND_VAR\n```\n\n### Example\n\n```iec-st\nUSING Siemens.Ax.Io.Input;\nUSING Simatic.Ax.SimpleControlModules;\n\nCONFIGURATION PLC_1\n\n    TASK Main(Priority := 1);\n\n    PROGRAM P1 WITH Main : SampleProgram;\n\n    VAR_GLOBAL\n        aIn AT %I0.0 : BOOL ;\n        bIn AT %I0.0 : BOOL ;\n        sigA : BinSignal;\n        sigB : BinSignal;\n        actPos : DINT;\n        enc : EncoderAB := (SignalA := sigA, SignalB := sigB);\n    END_VAR\n    \nEND_CONFIGURATION\n\nPROGRAM SampleProgram\n    VAR_EXTERNAL\n        aIn : BOOL ;\n        bIn : BOOL ;\n        sigA : BinSignal;\n        sigB : BinSignal;\n        actPos : DINT;\n        enc : EncoderAB;\n    END_VAR\n\n    sigA.ReadCyclic(signal := aIn);\n    sigB.ReadCyclic(signal := bIn);\n    enc.Evaluate();\n    actPos := enc.GetValue();\nEND_PROGRAM\n```\n\n## Counter\n\nThe Counter counts with the methods CountForward(increment : DINT) or CountReverse(decrement : DINT). The parameter `increment` or `decrement` is 1 by default.\n\nMethods:\n|||\n|-|-|\n| Config(ll : DINT ul : DINT) | set the upper and lower limit |\n| SetCounterValue(value : DINT) | Set the counterf value to value (default 0) |\n| CounterValue() : DINT | Retunrs the actual counter value\n| CountForward(increment : DINT) | Count forward by increment (default 1) |\n| CountReverse(decrement : DINT) | Count reverse by decrement (default 1) |\n| UpperLimitReached() : BOOL | Returns TRUE when the counter value \u003e= upper limit |\n| LowerLimitReached() : BOOL | Returns TRUE when the counter value \u003c= lower limit |\n\n### Markdownlint-cli\n\nThis workspace will be checked by the [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) (there is also documented ho to install the tool) tool in the CI workflow automatically.  \nTo avoid, that the CI workflow fails because of the markdown linter, you can check all markdown files locally by running the markdownlint with:\n\n```sh\nmarkdownlint **/*.md --fix\n```\n\n## Contribution\n\nThanks for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section or, even better, is free to propose any changes to this repository using Merge Requests.\n\n## License and Legal information\n\nPlease read the [Legal information](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatic-ax%2Fsimple-control-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimatic-ax%2Fsimple-control-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatic-ax%2Fsimple-control-modules/lists"}