{"id":48923462,"url":"https://github.com/simatic-ax/lcalcmc","last_synced_at":"2026-04-17T05:35:01.363Z","repository":{"id":351000274,"uuid":"1027545068","full_name":"simatic-ax/lcalcmc","owner":"simatic-ax","description":"Library of functions to get detailed information about motion profiles","archived":false,"fork":false,"pushed_at":"2026-04-13T05:49:32.000Z","size":928,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T07:26:08.996Z","etag":null,"topics":["iec-st","library","motioncontrol-apc-applications","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":"2025-07-28T07:08:17.000Z","updated_at":"2026-04-13T05:44:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/simatic-ax/lcalcmc","commit_stats":null,"previous_names":["simatic-ax/lcalcmc"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/simatic-ax/lcalcmc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Flcalcmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Flcalcmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Flcalcmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Flcalcmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simatic-ax","download_url":"https://codeload.github.com/simatic-ax/lcalcmc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simatic-ax%2Flcalcmc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31917099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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","motioncontrol-apc-applications","siemens","simatic-ax"],"created_at":"2026-04-17T05:35:00.648Z","updated_at":"2026-04-17T05:35:01.337Z","avatar_url":"https://github.com/simatic-ax.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCalcMC Library for SIMATIC AX\n\n## Overview\n\nThe LCalcMC library provides functions to get detailed information about motion profiles.\n\nWhen moving axes in production machines, the following questions are of particular interest:\n\n- How much time will a positioning take?\n- How long does it take to reach the target velocity?\n- How much distance is traveled when a velocity change is commanded?\n- What acceleration is needed to complete a positioning in a certain time?\n- When must a movement be stopped at the latest to avoid a crash (collision monitoring)?\n- How can maximum required power be reduced?\n- How can the jerk be limited to achieve minimal wear on the machine?\n\nThe library LCalcMC for SIMATIC provides easy-to-use calculation functions that help the user to find solutions to the above questions.\nThe function results can be used for programming the motion profiles with respect to the dynamics (velocity, acceleration, deceleration, jerk).\n\nThe library is a direct conversion of the functionally identical library [LCalcMC](https://support.industry.siemens.com/cs/ww/en/view/109475569) for use inside the TIA Portal\n\n## Mode of Operation\n\n### Blocks for change of velocity\n\nA change of velocity or a stop at an axis (`MC_MoveVelocity`, `MC_MoveJog` or `MC_Halt`) can be calculated with the `LCalcMC.MoveVelocity*` blocks. Therefore, dynamics (velocity and acceleration) that are effective at the start of the movement are taken into account at the inputs _startVelocity_ and _startAcceleration_. With the dynamic values provided at the inputs _acceleration_, _deceleration_ and _jerk_ and a target velocity at the input velocity the movement can be calculated in time or distance. In addition, the blocks can also calculate the required dynamic values with a known time or distance.\n\n#### Overview of functions for velocity change from start dynamics to constant velocity\n\n| Function name | Start Velocity | Start Accel | Target Velocity | Accel | Decel | Jerk | Time | Distance |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| `MoveVelocityTime` | IN | IN | IN | IN | IN | IN | **OUT** | - |\n| `MoveVelocityDistance` | IN | IN | IN | IN | IN | IN | - | **OUT** |\n| `MoveVelocityDetails`¹ | IN | IN | IN | IN | IN | IN | **OUT** | **OUT** |\n| `MoveVelocityAccelByTime` | IN | IN | IN | **OUT** | **OUT** | IN | IN | - |\n| `MoveVelocityAccelByDistance` | IN | IN | IN | **OUT** | **OUT** | IN | - | IN |\n| `MoveVelocityJerkByTime` | IN | IN | IN | IN | IN | **OUT** | IN | - |\n| `MoveVelocityJerkByDistance` | IN | IN | IN | IN | IN | **OUT** | - | IN |\n\n¹ partial times and distances including the corresponding velocities and accelerations are output\n\n### Blocks for positioning\n\nThe calculation of positioning motion (`MC_MoveAbsolute`, `MC_MoveRelative` or `MC_MoveSuperimposed`) is done by the `LCalcMC.Positioning*` blocks. The input parameter _distance_ represents the distance between start and end position of the movement. The blocks can calculate the time for the movement from standstill to standstill of the axis. For this the dynamic values (velocity, acceleration, deceleration and jerk) are taken into account. In addition, the blocks can also calculate the required dynamic values with a known time.\n\n#### Overview of functions for positioning from standstill to standstill\n\n| Function name | Velocity | Acceleration | Deceleration | Jerk | Time | Distance |\n| ------------- | -------- | ------------ | ------------ | ---- | ---- | -------- |\n| `PositioningTime` | IN | IN | IN | IN | OUT | IN |\n| `PositioningDetails`² | IN | IN | IN | IN | OUT | IN |\n| `PositioningAccel` | IN | OUT | OUT | IN | IN | IN |\n| `PositioningJerk` | IN | IN | IN | OUT | IN | IN |\n\n² partial times and distances including the corresponding velocities and accelerations are output\n\n## Requirements\n\n- SIMATIC AX\n- S7-1500 CPU with firmware version 2.9 or higher\n\n## Installation\n\nInstall with Apax:\n\n```cli\napax add @simatic-ax/lcalcmc\n```\n\n## Namespace\n\n```cli\nSimatic.Ax.LCalcMC;\n```\n\n## Documentation\n\nComprehensive documentation is available in the [docs](./docs) directory:\n\n## Operation\n\n**_NOTE:_** To get the best results at calculation when using technology objects, the setpoint values like _\\\u003caxis\u003e.velocity_ and _\\\u003caxis\u003e.acceleration_ have to be used as start values for the blocks.\n\n## Error handling\n\nErrors of LCalcMC functions are signalized at the return value of the different functions. A value WORD#16#8xxx (with x for hexadecimal 0 to F) at the return value signalizes an error.\n\nThe error codes are defined in [`LCalcMC.Status`](./docs/constants/LCalcMC_ErrorIDs.md).\n\nThere are different kinds of errors:\n\n**Errors at input values (16#82xx)**:\n\nThe values at the inputs are not correct.\nThe following questions can help to find the problem:\n\n- Are the correct variables connected to the inputs?\n- Are the values of the inputs in the same value range as the corresponding technology object value (typically 0.0 to 1.0e12)?\n\n**Errors at calculation caused by input values (16#84xx)**:\n\nWith the provided input values a solution cannot be found in the calculation block.\nThe following questions can help to find the problem:\n\n- Are the correct variables connected to the inputs?\n- Can the input values be changed (e.g. increase time)?\n\n**_NOTE:_** If the input values are too big, the block is not able to calculate.\n\n## Additional Information\n\n### Difference between calculated and executed motion profile\n\nIt may happen that there is a difference between the calculated motion and the motion that is executed by the PLC.\nAn axis has different monitoring functionalities, like positioning monitoring.\nThese functionalities delay the flags at the motion control commands that signalize the successful execution of the motion control command like the outputs _inVelocity_ and _done_.\n\nFor example, if a positioning command is used, the _done_ signal will be delayed at least according to the settings in positioning monitoring.\n\n![DwellTime](./docs/assets/images/dwell_time.png)\n\n![PosWindow](./docs/assets/images/timing_diagram_motion_profiles.png)\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\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%2Flcalcmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimatic-ax%2Flcalcmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatic-ax%2Flcalcmc/lists"}