--- a/Beremiz_cli.py Mon Nov 07 17:32:56 2022 +0800
+++ b/Beremiz_cli.py Thu Oct 20 19:30:23 2022 +0800
@@ -92,6 +92,15 @@
return session.controller.run_project()
return processor
+@cli.command()
+@pass_session
+@ensure_controller
+def stop(session):
+ """Stop program running in PLC. """
+ def processor():
+ return session.controller.stop_project()
+ return processor
+
@cli.result_callback()
@pass_session
--- a/CLIController.py Mon Nov 07 17:32:56 2022 +0800
+++ b/CLIController.py Thu Oct 20 19:30:23 2022 +0800
@@ -172,6 +172,12 @@
return 0 if self._Run() else 1
+ @with_project_loaded
+ @connected
+ def stop_project(self):
+
+ return 0 if self._Stop() else 1
+
def finish(self):