{"id":13712202,"url":"https://github.com/worldwidemv/SimulinkBlock_RehaMove3","last_synced_at":"2025-05-06T21:33:26.631Z","repository":{"id":201819257,"uuid":"112226140","full_name":"worldwidemv/SimulinkBlock_RehaMove3","owner":"worldwidemv","description":"The RehaMove3 block for the Soft-Realtime Simulink toolbox found at https://github.com/worldwidemv/SimulinkToolchain.","archived":false,"fork":false,"pushed_at":"2020-08-05T17:55:41.000Z","size":1629,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T22:35:32.540Z","etag":null,"topics":["hasomed","rehamove3","simulink","soft-realtime"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worldwidemv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-27T17:22:52.000Z","updated_at":"2021-07-20T09:42:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"e03eabc8-a013-4322-b8b5-16547e9741ed","html_url":"https://github.com/worldwidemv/SimulinkBlock_RehaMove3","commit_stats":null,"previous_names":["worldwidemv/simulinkblock_rehamove3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldwidemv%2FSimulinkBlock_RehaMove3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldwidemv%2FSimulinkBlock_RehaMove3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldwidemv%2FSimulinkBlock_RehaMove3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldwidemv%2FSimulinkBlock_RehaMove3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worldwidemv","download_url":"https://codeload.github.com/worldwidemv/SimulinkBlock_RehaMove3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772442,"owners_count":21801925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hasomed","rehamove3","simulink","soft-realtime"],"created_at":"2024-08-02T23:01:15.908Z","updated_at":"2025-05-06T21:33:26.305Z","avatar_url":"https://github.com/worldwidemv.png","language":"C++","funding_links":[],"categories":["ScienceMode3"],"sub_categories":[],"readme":"# SimulinkBlock_RehaMove3\n\nThis repository contains a Simulink block for the [HASOMED RehaMove3](https://www.rehamove.com/what-is-rehamove/science-mode.html) FES stimulator, and the underling C++ interface class.\n\nThe Simulink block itself *requires*:\n\n   * [Simulink](https://www.mathworks.com/products/simulink.html) + Legacy Code Toolbox,\n   * [Simulink Coder](https://www.mathworks.com/products/simulink-coder.html),\n   * [Embedded Coder](https://www.mathworks.com/products/embedded-coder.html), and\n   * the [Soft-Realtime Simulink Toolbox](https://github.com/worldwidemv/SimulinkToolchain), which must be installed first\n\n\n\n## Installation\n\nPlease install the [Soft-Realtime Simulink Toolbox](https://github.com/worldwidemv/SimulinkToolchain) first.  \nWe assume you have installed Soft-Realtime Simulink Toolbox (SRT) into the directory `SimulinkToolchain` from now one.\n\n### Get the Code\nGo to the library directory and clone this repository:\n```shell\ncd SimulinkToolchain/SimulinkLib_linux64/\ngit clone https://github.com/worldwidemv/SimulinkBlock_RehaMove3.git\n```\n\n### Get the Library\nNext, you have to download the ScienceMode library from Hasomed. \nThis library provides a low-level API and is a build requirement for your Simulink models.  \nThe library must be downloaded from the Hasomed website: [https://www.rehamove.com/what-is-rehamove/science-mode.html](https://www.rehamove.com/what-is-rehamove/science-mode.html).   \nThe last tested library version is [smpt_rm3_V3.2.4a](https://www.rehamove.com/fileadmin/user_upload/RehaMove/ScienceMode/smpt_rm3_V3.2.4a.zip).\n\nDownload and unzip the library in any folder, you will be asked for the folder later on and the relevant files will be copied from there.\n\n### Run the Install Scripts\n\nNow, you have to run the SRT install script and build the block functions.  \nThis is all done by the SRT script `srt_InstallSRT.m`.\n\nPlease run this script in Matlab. The script should:\n\n* guide you through the installation,\n* build your blocks,\n* create/update the Simulink Library Pallet, and\n* update and save the Matlab path.\n\n### Test your Installation\n\nYou can test if every works with one of the examples provided with the block.\nIn Matlab, go to `SimulinkToolchain/SimulinkLib_linux64/SimulinkBlock_RehaMove3/examples/block_RehaMove3/` and open e.g. the file test_`RehaMove3_block__LowLevel1_simple.slx`\n\nBuild the diagram by clicking the \"_Build Model_\" button.  \n![Example_LowLevel1_Simple.png](https://github.com/worldwidemv/SimulinkBlock_RehaMove3/raw/master/html/block_RehaMove3/Example_LowLevel1_Simple.png \"Simple_LowLevel1_Example\")\n\nThis should compile without errors!  \nDetails are shown in the Diagnostic Viewer, available (once you hit \"_Build Model_\") at the bottom of the window.\n\nIf the compilation was successful, you will find an executable called like the model, e.g. `test_RehaMove3_block__LowLevel1_simple` inside the current Matlab working directory, e.g. `SimulinkToolchain/SimulinkLib_linux64/SimulinkBlock_RehaMove3/examples/block_RehaMove3/`.\n\nThis executable must now be started as root, because the Linux low latency scheduler needs root privileges.\n```shell\ncd SimulinkToolchain/SimulinkLib_linux64/SimulinkBlock_RehaMove3/examples/block_RehaMove3/\nsudo ./test_RehaMove3_block__LowLevel1_simple\n```\n\nThis should run the generated Simulink Model, and you should see a similar output than below.  \n**To stop** the executable, you can press CTL-ALT-C or go to Simulink, click on \"_Connect to Target_\" (External Mode) and the click on \"_Stop_\". \n\n```shell\n$ sudo ./test_RehaMove3_block__LowLevel1_simple\n\n** starting the model **\nSTIM1: Initialising /dev/ttyUSB0 was successful!\nSTIM1: Status Report\n     -\u003e Interface: /dev/ttyUSB0\n     -\u003e Device ID: 160550007\n     -\u003e Battery Voltage: 100% (8.22V)\n     -\u003e Last updated: 0.001 seconds ago\n     -\u003e Init Threat running: yes\n     -\u003e Receiver Threat running: yes\n     -\u003e LowLevel:\n        -\u003e Initialised: yes\n        -\u003e Current/Last High Voltage: 90V\n        -\u003e Use Denervation: no\n        -\u003e Abort after 2 stimulation errors\n        -\u003e Resume the stimulation after 100 sequences\n\n\nSTIM1 Puls Info: time=0.208\n  Puls 1 -\u003e Channel=1; Shape=0; PW=300; I=10.0\n     PointConfig  1: Duration= 300µs; Current= +10.00mA; (Mode=0; IM=0)\n     PointConfig  2: Duration= 100µs; Current=  +0.00mA; (Mode=0; IM=0)\n     PointConfig  3: Duration= 300µs; Current= -10.00mA; (Mode=0; IM=0)\n\n\n......\n...... a lot more output ...\n......\n\n\n\nSTIM1 Puls Info: time=4.258\n  Puls 1 -\u003e Channel=1; Shape=0; PW=300; I=10.0\n     PointConfig  1: Duration= 300µs; Current= +10.00mA; (Mode=0; IM=0)\n     PointConfig  2: Duration= 100µs; Current=  +0.00mA; (Mode=0; IM=0)\n     PointConfig  3: Duration= 300µs; Current= -10.00mA; (Mode=0; IM=0)\n\n^CSimulation aborted by pressing CTRL+C\nSTIM1: DeInitialising the device /dev/ttyUSB0 was successful!\nSTIM1: Status Report\n     -\u003e Interface: /dev/ttyUSB0\n     -\u003e Device ID: 160550007\n     -\u003e Battery Voltage: 100% (8.17V)\n     -\u003e Last updated: 0.001 seconds ago\n     -\u003e Init Threat running: no\n     -\u003e Receiver Threat running: yes\n     -\u003e LowLevel:\n        -\u003e Initialised: no\n        -\u003e Current/Last High Voltage: 90V\n        -\u003e Use Denervation: no\n        -\u003e Abort after 2 stimulation errors\n        -\u003e Resume the stimulation after 100 sequences\n\nSTIM1: Statistic Report LowLevel:\n     -\u003e Pulse SEQUENCES send: 82 (82 pulses send; 0 pulses NOT send)\n        -\u003e Successful: 82 (82 pulses)\n        -\u003e Unsuccessful: 0 (0 pulses)\n           -\u003e Stimulation Error: 0\n        -\u003e Missing: 0\n     -\u003e Input Corrections:\n        -\u003e Invalid Input: 0 pulses\n        -\u003e Current correction (to high): 0 pulses\n        -\u003e Current correction (to low):  0 pulses\n        -\u003e Pulsewidth correction (to high): 0 pulses\n        -\u003e Pulsewidth correction (to low):  0 pulses\n```\n\n## Usage / Documentation\n\nPlease find the documentation in the [Wiki](https://github.com/worldwidemv/SimulinkBlock_RehaMove3/wiki).\n\n\n## License\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\nSee the GNU General Public License for more details.\nA copy is provided in the the LICENSE file or can be at [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldwidemv%2FSimulinkBlock_RehaMove3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldwidemv%2FSimulinkBlock_RehaMove3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldwidemv%2FSimulinkBlock_RehaMove3/lists"}