### Task Start Usage Examples Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1task Examples demonstrating how to start tasks with different scheduling policies, cycle times, and CPU affinities. ```cpp // Start control task with cycle-time 1000 microseconds, // realtime scheduling policy on CPU 0 with priority 80. control_task.start(1000, container::TaskSched::REALTIME , {0}, 80); // Start publisher task with cycle-time 1000 microseconds, // non-realtime scheduling policy on CPU 1, 2. comm_task.start(1000, container::TaskSched::NORMAL, {1, 2}); // Start logic task with cycle-time 5000 microseconds, // non-realtime scheduling policy on any non-isolated CPU. logic_task.start(5000, container::TaskSched::NORMAL); ``` -------------------------------- ### Compile and install the library Source: https://docs.motorcortex.io/docs/developing-client-applications/cpp/install Build the project and install the binaries to the system. ```bash make sudo make install sudo ldconfig ``` -------------------------------- ### Full config.json Example Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-io/project-packages/config_package/config_json A comprehensive example of a complete configuration file. ```json { "Mode": "Simulation", "Drive": "cia402", "LogLevel": "Info", "Path": { "Fieldbus": "io/master.xml", "Control": "control/control.xml", "UserParameters": "user/parameters.json", "Linking": "linking/base.link.json", "Mechanism": "mech/mech-parameter.xml", "License": "license.lic", "Log": "/var/www/motorcortex/log", "Persistence": "control/persistence.bin" }, "AxisControl": { "Enable": true, "NumberOfAxes": 6 }, "ManipulatorControl": { "Enable": true, "Amount": 1 }, "Server": { "Default": { "URL": "wss://*:5568:5567", "Direction": "listen", "Login": "enable", "Accounts": "accounts.conf", "Certificate": "/etc/ssl/certs/motorcortex.pem" } }, "Realtime": { "Isolate": [ 0, 1 ], "Allocate": 16 }, "Task": { "Control_task": { "Sched": "Realtime", "Cpu": [ 0 ], "Prio": 80, "Dt": 1000 }, "Fieldbus_task": { "Sched": "Realtime", "Cpu": [ 1 ], "Prio": 80, "Dt": 1000 }, "Simulator_task": { "Sched": "Realtime", "Dt": 1000 }, "Logic_task": { "Sched": "Realtime", "Dt": 10000 }, "Logger_task": { "Sched": "Normal", "Dt": 1000 }, "IO_task": { "Sched": "Realtime", "Dt": 1000 }, "Comm_task": { "Sched": "Normal", "Dt": 1000 } } } ``` -------------------------------- ### Install QEMU and Dependencies Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/virtual-machine Install the necessary QEMU, KVM, and UEFI firmware packages on Ubuntu. ```bash # Update package list sudo apt update # Install QEMU, KVM, and OVMF (UEFI firmware) sudo apt install -y qemu-system-x86 qemu-kvm ovmf bridge-utils net-tools ``` -------------------------------- ### Make Start Script Executable Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/virtual-machine Grant execution permissions to the QEMU start script. ```bash chmod +x start-qemu-mcx-image.sh ``` -------------------------------- ### Execute Motorcortex SDK Installer Source: https://docs.motorcortex.io/docs/developing-control-applications/environment-setup Run the SDK installer script to begin the installation process. ```bash ./mcx-rtos-glibc-x86_64-mcx-image-dev-corei7-64-mcx-intel-toolchain-2025.03-0-g0e9d0e9.sh ``` -------------------------------- ### Parameter Tree Output Example Source: https://docs.motorcortex.io/docs/developing-client-applications/python/usage/fundamentals Example of the structure printed to the console after a successful connection. ```text ... permissions: 432 param_type: INPUT group_id: ADMINISTRATOR unit: unit_undefined path: "root/logger/logMarkerIn" , id: 55 data_type: 514 data_size: 1 number_of_elements: 256 flags: 0 permissions: 432 param_type: OUTPUT group_id: ADMINISTRATOR unit: unit_undefined path: "root/logger/logOut" ] ``` -------------------------------- ### Example accounts.conf Configuration Source: https://docs.motorcortex.io/docs/software-maintenance/user-access Example of defining default accounts with their respective group IDs and password hashes. ```text administrator:3 $6$pP7yN5SHfloRh3SO$SGzcD1HPd9bvba2mwe.x7qPNOATDtsyp9aFhsbWswQ72Hy8TuIYVpVpNixsIKqkx8O6TI.RdL7nmNJVATvhLs/ operator:7 $6$QVzv7xLJcX.Q09Xc$6MiqIvMbpOZ3EQmmxLyYEauKf1Q5dL7JTHHNYKpllkhADjaCV1TyryXZsUMjTXXfPa6axnb8n3HMpvGvf2B9b0 monitor:15 $6$tGM1ioTsUaBzv.LI$t1WQmXmCJPA5UepNsBg.40x87U.fKqscSSDmw/eAIM3r8ehGPObdIYhM5en7fbVr1l8gsjTVVH/pZwdXKVzVY/ ``` -------------------------------- ### start Method Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classcontainer_1_1taskdeadline Starts the task with specified cycle time, scheduling policy, CPU affinity, and priority. ```cpp void start( unsigned long cycle_time_micro_s, utils::SchedType policy =utils::SchedType::OTHER, std::initializer_list< int > cpu_affinity_list ={-1}, int priority =0 ) ``` -------------------------------- ### start Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1comm_1_1requestreply Starts the communication service using the provided connection data. ```APIDOC ## bool start(const ConnectionData & conn_data) ### Description Initializes and starts the communication listener or dialer based on the provided connection data. ### Parameters - **conn_data** (const ConnectionData &) - The connection configuration data. ``` -------------------------------- ### Initializing and starting the DataLogger Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Configures the DataLogger with server address, paths, divider, and certificate, then starts the logging process. ```python # Create a DataLogger object and set the options logger = DataLogger('192.168.2.100', paths = ['root/AxesControl/axesPositionsActual'], divider=10, certificate='mcx.cert.crt') # Start the logger logger.start() ``` -------------------------------- ### Install pip and Motorcortex-Python Source: https://docs.motorcortex.io/docs/developing-client-applications/python/install Install the pip package manager and then use it to install the motorcortex-python library system-wide. ```bash sudo apt install python3-pip ``` ```bash sudo -H pip3 install motorcortex-python ``` -------------------------------- ### Build and Install MbedTLS Source: https://docs.motorcortex.io/docs/developing-client-applications/cpp/install Compile and install MbedTLS with shared library support enabled. ```bash mkdir build cd build cmake .. -DUSE_SHARED_MBEDTLS_LIBRARY=1 make sudo make install sudo ldconfig ``` -------------------------------- ### Manage SSH service on host Source: https://docs.motorcortex.io/docs/software-maintenance/date-time Commands for installing, starting, checking status, and stopping the SSH server on a host machine. ```bash sudo apt install openssh-server sudo service ssh start sudo service ssh status sudo service ssh stop ``` -------------------------------- ### Start Master Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1ecat_1_1ethercatbase Starts the EtherCAT master operation. ```cpp virtual bool startMaster() ``` -------------------------------- ### Install motorcortex-robot-control-python Source: https://docs.motorcortex.io/docs/developing-client-applications/python/usage/robot_control Use pip to install the robot control package. ```bash pip install motorcortex-robot-control-python ``` -------------------------------- ### Build and Install NNG Source: https://docs.motorcortex.io/docs/developing-client-applications/cpp/install Compile and install NNG with shared library and TLS support enabled. ```bash mkdir build cd build cmake .. -DBUILD_SHARED_LIBS=1 -DNNG_ENABLE_TLS=1 make sudo make install sudo ldconfig ``` -------------------------------- ### Module Create Usage Example Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1module Demonstrates how to initialize a control loop module. ```cpp control::MainControlLoop main_loop; main_loop.create("Control", ¶m_server, 1000); ``` -------------------------------- ### Install Network Tools Source: https://docs.motorcortex.io/docs/getting-started/connect-your-pc/connection-troubleshooting Install the net-tools package to enable network diagnostic utilities like ifconfig. ```bash sudo apt install net-tools ``` -------------------------------- ### Start Communication Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1comm_1_1requestreply Starts the communication service using the provided connection data. ```cpp bool start( const ConnectionData & conn_data ) ``` -------------------------------- ### Display Image Version Example Source: https://docs.motorcortex.io/docs/software-maintenance/determine-software-version Example output showing the Motorcortex-RTOS version string as displayed in the Cockpit interface. ```text Motorcortex-RTOS 2025.03-0-g0e9d0e9 (kirkstone) ``` -------------------------------- ### Install Python Reporting Libraries Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/automated-reporting Install the necessary dependencies for report generation on a Linux desktop environment. ```bash pip install jinja2 weasyprint motorcortex-python motorcortex-python-tools ``` -------------------------------- ### start(uint64_t cycle_time_micro_s, TaskSched task_sched, const std::vector< uint32_t > & cpu_affinity_list, uint32_t priority) Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1task Starts the operation phase of the task with specified scheduling parameters. ```APIDOC ## start(uint64_t cycle_time_micro_s, TaskSched task_sched, const std::vector< uint32_t > & cpu_affinity_list, uint32_t priority) ### Description Starts the operation phase of the task, defining its cycle time, scheduling policy, CPU affinity, and priority. ### Parameters - **cycle_time_micro_s** (uint64_t) - Required - Cycle time of the event loop in microseconds. - **task_sched** (TaskSched) - Required - Scheduler policy (REALTIME or NORMAL). - **cpu_affinity_list** (std::vector) - Optional - List of CPUs to bind the task to. - **priority** (uint32_t) - Optional - Static priority (1-99 for REALTIME, 0 for NORMAL). ``` -------------------------------- ### CoE Startup Parameter Configuration Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/device-configuration-panel Example XML configuration for CoE startup parameters. ```xml PS 0 1 63488 01 0000 ``` -------------------------------- ### Install build dependencies on Linux Source: https://docs.motorcortex.io/docs/developing-client-applications/cpp/install Install essential build tools required for compiling the library. ```bash sudo apt-get update sudo apt-get install build-essential cmake git ``` -------------------------------- ### EtherCAT ESI File Configuration Example Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/troubleshoot-ecat Example of an OpMode configuration block from an ESI file for an EL5101-0011 device. ```xml DC1 DC Oversampling 1 #x730 0 # factor "n" = n * etherCAT task time 0 0 # factor "-n" = etherCAT task time / n 0 #x1600 #x1a00 #x1a01 #x1a10 ``` -------------------------------- ### SoE Startup Parameter Configuration Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/device-configuration-panel Example XML configuration for SoE startup parameters. ```xml PS 0 3 0 15 64 0 0700 ``` -------------------------------- ### EoE Startup Parameter Configuration Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/device-configuration-panel Example XML configuration for EoE startup parameters. ```xml IP PS 0 020000000f0000000201051003e97b02000a00ffffff0102000a000000000000000000000000000000000000000000000000000000000000000000000000 ``` -------------------------------- ### Start Timing Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/structmcx_1_1utils_1_1measure Initializes the internal timer. ```cpp static inline void start( void ) ``` -------------------------------- ### Initiate System Backup Source: https://docs.motorcortex.io/docs/software-maintenance/backup-and-restore Starts the interactive backup procedure for the controller's storage. ```bash sudo mcx-backup ``` -------------------------------- ### Install Motorcortex-Python via pip Source: https://docs.motorcortex.io/docs/developing-client-applications/python/install Use this command in a Command Prompt to install the core library for the current user. ```bash python -m pip install Motorcortex-python ``` -------------------------------- ### Install Python 3 on Ubuntu Source: https://docs.motorcortex.io/docs/developing-client-applications/python/install Use the system package manager to install Python 3 if it is not already present. ```bash sudo apt install python3 ``` -------------------------------- ### Start Motorcortex Application Source: https://docs.motorcortex.io/docs/software-maintenance/start-stop-restart Initiates the Motorcortex application using sudo privileges. ```bash sudo motorcortex start ``` -------------------------------- ### Install Motorcortex-Python in Virtual Environment Source: https://docs.motorcortex.io/docs/developing-client-applications/python/install Install the library specifically within an active virtual environment using pip. ```bash pip3 install motorcortex-python ``` -------------------------------- ### Get Version Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1cmd__line_1_1config Retrieves the version string of the configuration. ```cpp std::string version() const ``` -------------------------------- ### mcx::utils::measure::start Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/structmcx_1_1utils_1_1measure Starts the measurement timer. ```APIDOC ## start() ### Description Initializes the measurement by capturing the current system time into the start_time_ attribute. ``` -------------------------------- ### Subscription Usage Examples Source: https://docs.motorcortex.io/docs/developing-client-applications/python/api Demonstrates subscribing to parameters, using promise-like callbacks, and setting up an observer for real-time updates. ```python # Make sure you have a valid connection subscription = sub.subscribe(paths, "group1", 100) result = subscription.get() if result is not None and result.status == motorcortex.OK: print(f"Subscription successful, layout: {subscription.layout()}") else: print(f"Subscription failed. Check parameter paths: {paths}") sub.close() exit() # Use promise-like interface subscription.then(lambda res: print("Subscribed:", res)).catch(lambda: print("Failed")) # Use observer for real-time updates def on_update(parameters): for param in parameters: timestamp = param.timestamp.sec + param.timestamp.nsec * 1e-9 print(f"Update: {timestamp:.6f}, {param.value}") subscription.notify(on_update) print("Waiting for parameter updates...") import time while True: time.sleep(1) ``` -------------------------------- ### Example motorcortex.conf content Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-io/project-packages/config_package/motorcortex_conf Configuration settings defining the executable path, name, and command-line options. ```bash EXECUTABLE_PATH="/usr/local/bin/" # path of the executable EXECUTABLE=my_motorcortex_app # executable name OPTIONS="-c /etc/motorcortex/config/config.json" # command line options ``` -------------------------------- ### Backup System Image Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/usb Starts the backup procedure to create a standard image of the current system. ```bash mci backup ``` -------------------------------- ### Start MCXOS with QEMU Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/virtual-machine Execute the provided shell script to launch the MCXOS image in a QEMU virtual machine. ```bash ./start-qemu-mcx-image.sh ``` -------------------------------- ### Start time Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/structmcx_1_1signal__monitor_1_1signalmonitor_1_1signal__data The start time of the signal monitoring in seconds. ```cpp double start_time_s; ``` -------------------------------- ### Manage Service Lifecycle Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Commands to start, stop, or restart the service. ```bash sudo systemctl start mcx-datalogger.service sudo systemctl stop mcx-datalogger.service sudo systemctl restart mcx-datalogger.service ``` -------------------------------- ### Install motorcortex-python-tools Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Install the package via pip to access the mcx-datalogger tool. ```bash pip install motorcortex-python-tools ``` -------------------------------- ### open Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1watchdog_1_1watchdogbasic Initializes the watchdog device. ```APIDOC ## bool open(const char * device) ### Description Opens the specified watchdog device for operation. ### Parameters - **device** (const char *) - Required - The path or identifier of the watchdog device to open. ### Returns - **bool** - Returns true if the device was opened successfully, false otherwise. ``` -------------------------------- ### Start StateCallbackHandler Source: https://docs.motorcortex.io/docs/developing-client-applications/python/api Starts the background thread using the provided update function. ```python def start(state_update_handler: Callable[..., Any]) -> None ``` -------------------------------- ### Initialize a new project Source: https://docs.motorcortex.io/docs/developing-client-applications/javascript/install Run this command in your project directory to create a new package.json file. ```bash npm init ``` -------------------------------- ### Combined CoE and EoE Startup Configuration Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/device-configuration-panel Example XML configuration combining both CoE and EoE startup parameters. ```xml PS 0 1 63488 01 0000 IP PS 0 020000000f0000000201051003e97b02000a00ffffff0102000a000000000000000000000000000000000000000000000000000000000000000000000000 ``` -------------------------------- ### Get License Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1cmd__line_1_1config Retrieves the license information associated with the configuration. ```cpp license::License license() const ``` -------------------------------- ### Get Module Information Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1ecat_1_1module Retrieves information about the module instance. ```cpp virtual std::string getInfo() const ``` -------------------------------- ### Navigate to home directory Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Change to the home directory before creating configuration files. ```bash cd ~ ``` -------------------------------- ### Example output of correct OP state Source: https://docs.motorcortex.io/docs/frequently-asked-questions/ethercat/faq-ecat1 A sample output showing devices successfully configured and running in the OP state. ```text 0 0:0 OP + EK1914, 2 Ch. Safety Input/Output 24V, TwinSAFE 1 0:1 OP + EL6910, TwinSAFE PLC 2 0:2 PREOP + EK1110 EtherCAT-Verlngerung 3 0:3 OP + SOMANET CiA402 Drive 4 0:4 OP + SOMANET CiA402 Drive 5 0:5 OP + SOMANET CiA402 Drive 6 0:6 OP + SOMANET CiA402 Drive 7 0:7 OP + SOMANET CiA402 Drive 8 0:8 OP + SOMANET CiA402 Drive ``` -------------------------------- ### Service File Configuration Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Example content for the mcx-datalogger systemd service file. ```ini [Unit] Description=Motorcortex Data Logger Service After=ethercat.target StartLimitIntervalSec=0 [Service] Type=simple ExecStartPre=/bin/sleep 5 ExecStart=mcx-datalogger.py -p parameters.json -F /home/admin/logs -C WorkingDirectory=/home/admin User=admin Restart=always RestartSec=1 [Install] WantedBy=motorcortex.service ``` -------------------------------- ### Basic mech-parameters.xml Configuration Source: https://docs.motorcortex.io/docs/applications/configure_application/manipulator_control/mechanism/segments Example of a basic XML configuration file for defining robot segments and their properties. ```xml rot_z rot_y rot_y rot_y rot_z rot_y ``` -------------------------------- ### Initialize License Object Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1license_1_1license Constructs a new License instance using the specified file and key. ```cpp License( const std::string & filename, const std::string & key, bool verbose =false ) ``` -------------------------------- ### Start Time Attribute Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/structmcx_1_1utils_1_1measure Static attribute storing the system clock time point when start was called. ```cpp static std::chrono::system_clock::time_point start_time_; ``` -------------------------------- ### Initialize Module Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1log_1_1module Constructor for the Module class, requiring a folder path and an optional output stream. ```cpp Module( const std::string & folder, FILE * stream =stdout ) ``` -------------------------------- ### Disable Administrator Access Example Source: https://docs.motorcortex.io/docs/software-maintenance/user-access Example showing how to disable the administrator account while keeping others active. ```text administrator:3 $6$pP7yN5SHfloRh3SO$SGzcD1HPd9bvba2mwe.x7qPNOATDtsyp9aFhsbWswQ72Hy8TuIYVpVpNixsIKqkx8O6TI.RdL7nmNJVATvhLs/ operator:7 $6$QVzv7xLJcX.Q09Xc$6MiqIvMbpOZ3EQmmxLyYEauKf1Q5dL7JTHHNYKpllkhADjaCV1TyryXZsUMjTXXfPa6axnb8n3HMpvGvf2B9b0 monitor:15 $6$tGM1ioTsUaBzv.LI$t1WQmXmCJPA5UepNsBg.40x87U.fKqscSSDmw/eAIM3r8ehGPObdIYhM5en7fbVr1l8gsjTVVH/pZwdXKVzVY/ administrator disable ``` -------------------------------- ### Expected Backup Output Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/usb Example of the console output displayed during the backup process. ```text Choose Source Device: 1) sda /dev/sda ... Choose Target Image Directory: 1) /mnt/usb/2026-01-06_15-44-42_mci-fsa-image (new directory) ... [progress output] Done ``` -------------------------------- ### create Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1module Initializes the module with a name, parameter server, cycle time, owner group, and permissions. ```APIDOC ## void create(const char * name, parameter_server::Parameter * parameter_server, uint64_t dt_micro_s, parameter_server::UserGroup owner_group, uint32_t permissions) ### Description Creates and configures the module branch with specific access permissions. ### Parameters - **name** (const char *) - Unique name of the module. - **parameter_server** (parameter_server::Parameter *) - Pointer to the root parameter server. - **dt_micro_s** (uint64_t) - Cycle time in microseconds. - **owner_group** (parameter_server::UserGroup) - Owner group of the module's branch. - **permissions** (uint32_t) - POSIX-like permissions for parameter access. ``` -------------------------------- ### Example output of PREOP state Source: https://docs.motorcortex.io/docs/frequently-asked-questions/ethercat/faq-ecat1 A sample output showing all connected EtherCAT devices currently in the PREOP state. ```text 0 0:0 PREOP + EK1914, 2 Ch. Safety Input/Output 24V, TwinSAFE 1 0:1 PREOP + EL6910, TwinSAFE PLC 2 0:2 PREOP + EK1110 EtherCAT-Verlngerung 3 0:3 PREOP + SOMANET CiA402 Drive 4 0:4 PREOP + SOMANET CiA402 Drive 5 0:5 PREOP + SOMANET CiA402 Drive 6 0:6 PREOP + SOMANET CiA402 Drive 7 0:7 PREOP + SOMANET CiA402 Drive 8 0:8 PREOP + SOMANET CiA402 Drive ``` -------------------------------- ### initLogin Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1comm_1_1authorization Initializes the login system using a configuration file. ```APIDOC ## bool initLogin(const char * filename) ### Description Initializes the authorization login system by loading credentials or settings from the specified file. ### Parameters - **filename** (const char *) - The path to the configuration file used for login initialization. ### Returns - **bool** - Returns true if initialization was successful, false otherwise. ``` -------------------------------- ### Create a new Rust project Source: https://docs.motorcortex.io/docs/developing-client-applications/rust/install Use Cargo to initialize a new project directory and navigate into it. ```bash cargo new my_motorcortex_app cd my_motorcortex_app ``` -------------------------------- ### Start Real-Time Mode Source: https://docs.motorcortex.io/docs/developing-control-applications/api/modules/group__utils Activates Real-time mode and isolates CPUs using various configuration methods. ```cpp bool startRealTime( size_t size_mb ) ``` ```cpp bool startRealTime( const std::vector< uint32_t > & cpu_list, size_t size_mb =256 ) ``` ```cpp bool startRealTime( cmd_line::Realtime opt ) ``` ```cpp bool startRealTime() ``` -------------------------------- ### enter() Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1drive_1_1readyforpoweron Enters the ReadyForPowerOn state. ```APIDOC ### Method `virtual void enter() override` Transitions the state machine into the ReadyForPowerOn state. This method overrides the base State::enter implementation. ``` -------------------------------- ### WatchdogSim::open Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1watchdog_1_1watchdogsim Initializes the watchdog simulation with the specified device. ```APIDOC ## bool open(const char * device) ### Description Opens the watchdog simulation device. ### Parameters - **device** (const char *) - The identifier for the watchdog device to open. ### Returns - **bool** - Returns true if the device was opened successfully, false otherwise. ``` -------------------------------- ### Module Create Method Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1module Initializes the module with a name, parameter server, and cycle time. ```cpp void create( const char * name, parameter_server::Parameter * parameter_server, uint64_t dt_micro_s =0 ) ``` -------------------------------- ### Retrieve Reply Value with get Source: https://docs.motorcortex.io/docs/developing-client-applications/python/api Use the get method to perform a blocking wait for a reply and return the associated protobuf message. ```python param_tree_reply = req.getParameterTree() value = param_tree_reply.get() ``` -------------------------------- ### Module Constructor with Filename Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1user__parameters_1_1module Initializes a new Module instance using the specified configuration filename. ```cpp explicit Module( const std::string & filename ) ``` -------------------------------- ### Check Virtualization Support Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/virtual-machine Verify that the host CPU supports virtualization and that KVM is available. ```bash # Check if virtualization is enabled egrep -c '(vmx|svm)' /proc/cpuinfo # If output is greater than 0, virtualization is supported # Also check: kvm-ok # Expected output: "INFO: /dev/kvm exists" ``` -------------------------------- ### bool start(std::time_t sec, int exit_code = 255) Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1license_1_1timer Starts a timer that will execute an exit with the specified code after the given number of seconds. ```APIDOC ## bool start(std::time_t sec, int exit_code = 255) ### Description Starts a timer that triggers an exit with the provided exit code after the specified duration in seconds. ### Parameters - **sec** (std::time_t) - Required - The duration in seconds before the timer triggers. - **exit_code** (int) - Optional - The exit code to return when the timer expires. Defaults to 255. ### Returns - **bool** - Returns true if the timer was successfully started, false otherwise. ``` -------------------------------- ### Connect Method Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1comm_1_1grouprawpublisher Establishes a connection using the provided ConnectionData. ```cpp virtual bool connect( const ConnectionData & conn_data ) override ``` -------------------------------- ### Initialize Login Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1comm_1_1authorization Initializes the login process using the specified filename. ```cpp virtual bool initLogin( const char * filename ) override ``` -------------------------------- ### Start Timer Function Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1license_1_1timer Initializes the timer with a duration in seconds and an optional exit code. ```cpp bool start( std::time_t sec, int exit_code =255 ) ``` -------------------------------- ### startMaster Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1ecat_1_1ethercatbase Starts the EtherCAT master operation. ```APIDOC ## bool startMaster() ### Description Initiates the EtherCAT master state machine to begin communication. ``` -------------------------------- ### Get Info Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1signal__monitor_1_1signalid Retrieves the info value. ```cpp uint32_t getInfo() const ``` -------------------------------- ### Create build directory Source: https://docs.motorcortex.io/docs/developing-client-applications/cpp/install Prepare a dedicated directory for the build process. ```bash mkdir build cd build ``` -------------------------------- ### Get Subsystem Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1signal__monitor_1_1signalid Retrieves the subsystem identifier. ```cpp uint32_t getSubsystem() const ``` -------------------------------- ### Get Code Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1signal__monitor_1_1signalid Retrieves the signal code. ```cpp uint32_t getCode() const ``` -------------------------------- ### Constructor for ReadyForPowerOn Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1drive_1_1readyforpoweron Initializes the state with the provided Sercos finite state machine data. ```cpp explicit ReadyForPowerOn( SercosFsmData & data ) ``` -------------------------------- ### Restart Motorcortex Source: https://docs.motorcortex.io/docs/developing-client-applications/python/tools/mcx-datalogger Applies changes and starts the service. ```bash sudo motorcortex restart ``` -------------------------------- ### Get SpmcBuffer Size Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1utils_1_1spmcbuffer Returns the size of the buffer. ```cpp inline constexpr uint32_t size() ``` -------------------------------- ### Module Initialization Phases Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1module Methods for executing the multi-phase initialization process of the parameter tree. ```cpp bool initPhase1() ``` ```cpp bool initPhase2() ``` -------------------------------- ### add Method Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classcontainer_1_1taskdeadline Adds a module to the task deadline with an optional autostart command. ```cpp void add( Module * module, Command cmd =AUTOSTART ) ``` -------------------------------- ### Get Parameter Handle Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1parameter__server_1_1grouphandle Retrieves a ParamHandle by its name. ```cpp ParamHandle & getHandle( const std::string & name ) ``` -------------------------------- ### Configure License Path Source: https://docs.motorcortex.io/docs/software-maintenance/install-license Update the config.json file to point to the installed license file location. ```json "License": "/etc/motorcortex/license.lic" ``` -------------------------------- ### Get ID Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1ecat_1_1ethercatbase Returns the unique identifier of the master. ```cpp unsigned int getId() const ``` -------------------------------- ### Get Drive Type Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1drive_1_1drivecia402 Retrieves the type of the drive. ```cpp inline virtual DriveType getType() const override ``` -------------------------------- ### WatchdogGpio::open Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1watchdog_1_1watchdoggpio Initializes the GPIO watchdog device. ```APIDOC ## bool open(const char * device) ### Description Opens the specified GPIO device for watchdog operations. ### Parameters - **device** (const char *) - Required - The path or identifier of the GPIO device. ``` -------------------------------- ### EtherCAT Mailbox Startup File Source: https://docs.motorcortex.io/docs/motorcortex-io-tools/motorcortex-ecat/ethercat-slaves-configuration-manual/ethercat-slaves-configuration-manual Configuration file for CoE devices defining initialization commands for specific SDO indices. ```xml PS 0 1 32781 17 0200 --> --> --> --> --> --> PS 0 1 32797 17 --> --> --> --> 1300 --> PS 0 1 32813 17 0200 --> --> --> --> --> --> PS 0 1 32829 17 0200 --> --> --> --> --> --> ``` -------------------------------- ### startOp Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1container_1_1module Performs final initialization before entering Operation mode. ```APIDOC ## bool startOp() ### Description Prepares the module for Operation mode. Can be called multiple times to reset state variables or counters. ### Return - **bool** - Returns true on success. ``` -------------------------------- ### Get Delta Time Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1state__machine_1_1statemachine Retrieves the delta time in seconds. ```cpp inline double getDtSec() const ``` -------------------------------- ### Get Module Status Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1user__parameters_1_1module Retrieves the current status of the module. ```cpp Status getStatus() const ``` -------------------------------- ### Get Error Publisher Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1state__machine_1_1errorhandle Retrieves the error publisher instance. ```cpp inline const ErrorPublisher & getErrorPublisher() const ``` -------------------------------- ### Example output of mixed state Source: https://docs.motorcortex.io/docs/frequently-asked-questions/ethercat/faq-ecat1 A sample output showing some devices in OP state while others remain in PREOP. ```text 0 0:0 OP + EK1914, 2 Ch. Safety Input/Output 24V, TwinSAFE 1 0:1 OP + EL6910, TwinSAFE PLC 2 0:2 PREOP + EK1110 EtherCAT-Verlngerung 3 0:3 SOMANET CiA402 Drive 4 0:4 SOMANET CiA402 Drive 5 0:5 SOMANET CiA402 Drive 6 0:6 SOMANET CiA402 Drive 7 0:7 SOMANET CiA402 Drive 8 0:8 SOMANET CiA402 Drive ``` -------------------------------- ### Get MpmcQueue Size Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1utils_1_1mpmcqueue Returns the current size of the queue. ```cpp inline uint32_t size() const ``` -------------------------------- ### Get MpmcQueue Position Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1utils_1_1mpmcqueue Returns the current position in the queue. ```cpp inline uint32_t pos() const ``` -------------------------------- ### gotoEngage() Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1drive_1_1switchon Transitions the drive state to Engage. ```APIDOC ### Method `virtual state_machine::EventStatus gotoEngage() override` Transitions the state machine to the Engage state. Reimplements `mcx::drive::Cia402FsmBase::gotoEngage`. ``` -------------------------------- ### create Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1log_1_1module Executes the 'Create' phase of module initialization. ```APIDOC ## void create(const char * name, parameter_server::Parameter * parameter_server, uint64_t dt_micro_s = 0) ### Description Executes the 'Create' phase of initialization for the module. ### Parameters - **name** (const char *) - Required - The name of the module. - **parameter_server** (parameter_server::Parameter *) - Required - Pointer to the parameter server. - **dt_micro_s** (uint64_t) - Optional - Cycle time in microseconds. ``` -------------------------------- ### Get Event Function Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1state__machine_1_1eventbase Retrieves the associated event pointer. ```cpp inline Event< STATE > * getEvent() const ``` -------------------------------- ### Run QEMU with Custom Parameters Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/virtual-machine Manually invoke the QEMU system emulator with specific hardware configurations, including KVM acceleration and VirtIO networking. ```bash sudo qemu-system-x86_64 -drive file=mcx-image-mcx-intel.rootfs-2026.05.1-0-g34c0e28-20260508091432.wic,format=raw,if=virtio \ -m 4090 -bios /usr/share/ovmf/OVMF.fd \ -cpu Skylake-Client \ -smp cores=4 \ -enable-kvm \ -netdev tap,id=net0,ifname=tap0,script=network-up.sh,downscript=network-down.sh \ -device virtio-net-pci,netdev=net0 ``` -------------------------------- ### Get Name Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1state__machine_1_1errorpublisher Retrieves the identifier name of the error publisher. ```cpp inline const std::string & getName() const ``` -------------------------------- ### Get Active Error Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1state__machine_1_1errorpublisher Retrieves the primary active error. ```cpp MotorcortexError getActiveError() const ``` -------------------------------- ### Get Info Pointer Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1signal__monitor_1_1signalid Retrieves a pointer to the info data. ```cpp const uint32_t * getInfoPtr() const ``` -------------------------------- ### Create Modules Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1fbus_1_1manager Instantiates modules based on the provided system mode, parameter server, and path. ```cpp std::vector< container::Module * > create( cmd_line::SystemMode system_mode, parameter_server::Parameter * param_server, const std::string & path ) ``` -------------------------------- ### Get Key Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1signal__monitor_1_1signalid Retrieves the unique key associated with the signal. ```cpp uint64_t getKey() const ``` -------------------------------- ### Get Parameter Timestamp Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1parameter__server_1_1reqhandle Retrieves the timestamp associated with the parameter. ```cpp const struct timespec & getTime() const ``` -------------------------------- ### Create Disk Image Source: https://docs.motorcortex.io/docs/getting-started/install-mcxos/install/usb Create a 6GB empty image file named temp.img. ```bash truncate -s 6G temp.img ls -lart ``` ```text -rw-r--r-- 1 root root 6442450944 Jan 6 12:01 temp.img ``` -------------------------------- ### Get parameter info Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1parameter__server_1_1parameterbase Returns the metadata information for the parameter. ```cpp virtual const ParameterInfo & getInfo() const =0 ``` -------------------------------- ### startRealTime Source: https://docs.motorcortex.io/docs/developing-control-applications/api/modules/group__utils Activates real-time mode and isolates specified CPUs. ```APIDOC ## bool startRealTime(...) ### Description Activates Real-time mode and isolates CPUs. Multiple overloads are available to specify memory size, CPU lists, or configuration options. ### Parameters - **size_mb** (size_t) - Optional - Size of RAM to reserve in Megabytes. - **cpu_list** (std::vector) - Optional - List of the CPUs to isolate. - **opt** (cmd_line::Realtime) - Optional - Struct with realtime options. ### Return - **bool** - true on success. ``` -------------------------------- ### Get Parameter Size Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1parameter__server_1_1paramhandle Returns the size of the parameter data. ```cpp size_t size() const ``` -------------------------------- ### Module Constructor Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1watchdog_1_1module Initializes a new Module instance with the specified system mode, watchdog type, and device identifier. ```cpp Module( utils::SystemMode system_mode, WatchdogType type, const char * device ) ``` -------------------------------- ### Get reply ID Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1parameter__server_1_1parameterbase Retrieves the identifier for the last reply. ```cpp virtual uint32_t getReplyId() =0 ``` -------------------------------- ### create Source: https://docs.motorcortex.io/docs/developing-control-applications/api/classes/classmcx_1_1fbus_1_1manager Creates and returns a collection of modules based on the provided system configuration. ```APIDOC ## std::vector< container::Module * > create(cmd_line::SystemMode system_mode, parameter_server::Parameter * param_server, const std::string & path) ### Description Instantiates modules based on the provided system mode, parameter server, and configuration path. ### Parameters - **system_mode** (cmd_line::SystemMode) - Required - The operating mode of the system. - **param_server** (parameter_server::Parameter*) - Required - Pointer to the parameter server instance. - **path** (const std::string&) - Required - The file system path or configuration path for the modules. ### Returns - **std::vector< container::Module * >** - A vector containing pointers to the created modules. ```