Configuration

The server is configured with a YAML file (passed to the ifw::slm::Application constructor, e.g. config/<prefix>slm/config.yaml). It uses the SlmServer type defined in slm/framework/resource/config/ifw/slm/definitions/server.yaml.

Server parameters

server: !cfg.type:SlmServer
    version: '1.0.0'
    req_endpoint: "zpb.rr://127.0.0.1:12091/"   # command (request/reply) endpoint
    pub_endpoint: "zpb.ps://127.0.0.1:12092/"   # status publish endpoint
    sm_scxml: "config/ifw/slm/sm.xml"
    oldb_uri_prefix: "cii.oldb:/elt/<prefix>/"
    sl:
        loop:
            - ...                                # one entry per loop
  • req_endpoint — where the SecondaryLoopManagerCmds and StdCmds services are bound. It is logged at start-up.

  • pub_endpoint — the base for the std/status topic consumed by the Supervisor and the GUI.

  • oldb_uri_prefix — base OLDB URI; per-loop keys are written below it.

Loop parameters

Each entry under sl.loop configures one loop:

Field

Meaning

event_name

logical name of the loop

enable

true to activate the loop

period_sec

cycle period in seconds (timer interval)

max_errors

consecutive failures before the loop auto-opens (default 3)

params

free-form per-loop parameters (see below)

Loops are matched to their code by index (1-based), in declaration order.

Note

params is a list of "name=value" strings (!cfg.type:vector_string), not a YAML mapping. The framework injects each entry as server/sl/loop[i]/params/<name>, which the loop code reads with GetLoopParam<T>("params/<name>"). All parameters arrive as strings; convert numeric ones in code.

Example

sl:
    loop:
        -   # Loop 1: motor control, 30 s cycle
            event_name: "Loop1Event"
            enable: true
            max_errors: 3
            period_sec: 30
            params:
                - "motor_name=motor1"
                - "motor_speed=20.0"
                - "cycle_delay_sec=5"
                - "target_positions=30.0,50.0,20.0,10.0"
                - "motor_devmgr_endpoint=zpb.rr://127.0.0.1:25376/AppCmds"

        -   # Loop 2: counting, 12 s cycle
            event_name: "Loop2Event"
            enable: true
            max_errors: 3
            period_sec: 12
            params:
                - "max_count=10"
                - "step_delay_ms=1000"