Class MotionMasterClient

Hierarchy

  • MotionMasterClient

Constructors

Properties

onceReady$: Observable<true> = ...

This observable will emit only once when both req/res and pub/sub sockets are opened. NOTE: This observable might never emit and it doesn't timeout.

ready$: Observable<true> = ...

Client is ready when both req/res and pub/sub sockets are opened. This observable will emit whenever the sockets opened property changes to true.

socketsOpened$: Observable<boolean> = ...

This observable will emit true when both req/res and pub/sub sockets are opened. If any socket gets closed, this observable will emit false. This is a hot observable that will on subscription emit the last value of sockets opened.

systemEventSubscription?: Subscription

Methods

  • Executes the homing procedure to locate the home position value (0x2005:01).

    You can optionally provide a configuration object that specifies acceleration, method, and speeds; if not provided, the parameter values already set on the device will be used.

    The function will first emit a "running" status, followed by either "succeeded" or "failed". After completion, the device will remain in the Operation Enabled state.

    No CiA402 state transitions will occur for the "Homing on current position" methods (35 and 37). Additionally, the halt bit will remain unchanged for these methods, in contrast to other methods where the halt bit is cleared.

    Returns

    An Observable that emits the status of the homing procedure.

    Parameters

    • deviceRef: DeviceRef

      Reference to the device being homed.

    • Optional config: HomingProcedureConfig

      Optional configuration for the homing procedure.

    • monitoringInterval: number = 50000

      Interval for monitoring the homing procedure status in microseconds (default: 50,000 μs).

    • requestTimeout: number = 300000

      Timeout for the homing request in milliseconds (default: 300,000 ms).

    Returns Observable<HomingProcedureStatus>

  • Executes a position profile on the specified device based on the provided configuration.

    Prior to modifying the Modes of Operation and transitioning to the Operation Enabled state in CiA402, this function updates the device parameters with the given values.

    If no target reached timeout is specified, the device will remain in the Operation Enabled state. If a timeout is provided, the function will optionally send a quick stop once the target is reached and the holding duration has elapsed.

    Throws

    Error if the target is not reached within the specified targetReachTimeout.

    Parameters

    Returns Promise<void>

  • Executes a torque profile on the specified device based on the provided configuration.

    Prior to modifying the Modes of Operation and transitioning to the Operation Enabled state in CiA402, this function updates the device parameters with the given values.

    If no target reached timeout is specified, the device will remain in the Operation Enabled state. If a timeout is provided, the function will optionally send a quick stop once the target is reached and the holding duration has elapsed.

    Throws

    Error if the target is not reached within the specified targetReachTimeout.

    Parameters

    Returns Promise<void>

  • Executes a velocity profile on the specified device based on the provided configuration.

    Prior to modifying the Modes of Operation and transitioning to the Operation Enabled state in CiA402, this function updates the device parameters with the given values.

    If no target reached timeout is specified, the device will remain in the Operation Enabled state. If a timeout is provided, the function will optionally send a quick stop once the target is reached and the holding duration has elapsed.

    Throws

    Error if the target is not reached within the specified targetReachTimeout.

    Parameters

    Returns Promise<void>

  • Start monitoring.

    Note that the returned observable will never complete on its own.

    If you unsubscribe from it, the teardown code will send a request to the master to stop the monitoring. That means you will end up with an observable that is not complete, but it won't emit any values. This is fine when you want to use the monitoring observable directly in the template with async pipe, which will unsubscribe automatically and stop the monitoring when you leave the component.

    If you need to complete the observable so that, for example, the toArray() operator works as expected, then use the DataMonitoring class, which has a stop method. It can optionally buffer data for exporting as CSV or performing statistics on it.

    Returns

    An observable of an array of parameter values.

    Parameters

    • ids: DeviceParameterIds

      Device parameter IDs to monitor.

    • monitoringInterval: number

      At what interval should the master application send values.

    • Optional config: MonitoringConfig

      Configure the topic, buffer size, distinct.

    • requestTimeout: number = 5000

      How long will the client wait for the master to confirm that monitoring has started.

    Returns Observable<ParameterValueType[]>

  • TODO: return device parameters instead of just parameters get parameters from ESI uprfront, and then when parameters are received from motion master just concatenate (spread operator) props from ESI and props from parameter assign device parameter id like 0x1018:00.12345 when assembling device parameter, get parameter from device in ESI based on product code, see ESI service this should probably done for other get parameters functions, get ESI file from device or prepared, get data from it

    Parameters

    Returns Observable<DeviceParameter[]>

  • Parameters

    • id: string | [DeviceRef, number, number]
    • value: number
    • window: number = 0
    • monitoringInterval: number = 50000
    • requestTimeout: number = 5000

    Returns Observable<true>

  • Parameters

    • id: string | [DeviceRef, number, number]
    • value: number
    • window: number = 0
    • monitoringInterval: number = 20000
    • requestTimeout: number = 5000

    Returns Promise<true>

  • Client is ready when both req/res and pub/sub sockets are opened. If both sockets are already opened, this function will immediately resolve to true. Otherwise, it will wait up to requestTimeout for both sockets to open, or throw an error.

    Parameters

    • requestTimeout: number = 5000

    Returns Promise<true>

Generated using TypeDoc