Monitoring

class ingeniamotion.monitoring.MonitoringSoCType(value)

Monitoring start of condition type

TRIGGER_EVENT_NONE = 0

No trigger

TRIGGER_EVENT_FORCED = 1

Forced trigger

TRIGGER_CYCLIC_RISING_EDGE = 2

Rising edge trigger

TRIGGER_CYCLIC_FALLING_EDGE = 4

Falling edge trigger

class ingeniamotion.monitoring.MonitoringProcessStage(value)

Monitoring process stage

INIT_STAGE = 0

Init stage

FILLING_DELAY_DATA = 2

Filling delay data

WAITING_FOR_TRIGGER = 4

Waiting for trigger

DATA_ACQUISITION = 6

Data acquisition

class ingeniamotion.monitoring.Monitoring(mc, servo='default')

Class to configure a monitoring in a servo.

Parameters
  • mc (MotionController) – MotionController instance.

  • servo (str) – servo alias to reference it. default by default.

class MonitoringVersion(value)

Monitoring version

set_frequency(prescaler)

Function to define monitoring frequency with a prescaler. Frequency will be Position & velocity loop rate frequency / prescaler, see ingeniamotion.configuration.Configuration.get_position_and_velocity_loop_rate() to know about this frequency. Monitoring must be disabled.

Parameters

prescaler (int) – determines monitoring frequency. It must be 1 or higher.

Raises

ValueError – If prescaler is less than 1.

map_registers(registers)

Map registers to monitoring. Monitoring must be disabled.

Parameters

registers (list of dict) –

List of registers to map. Each register must be a dict with two keys:

{
    "name": "CL_POS_FBK_VALUE",  # Register name.
    "axis": 1  # Register axis. If it has no axis field, by default axis 1.
}

Raises
set_trigger(trigger_mode, trigger_signal=None, trigger_value=None, trigger_repetitions=1)

Configure monitoring trigger. Monitoring must be disabled.

Parameters
  • trigger_mode (MonitoringSoCType) – monitoring start of condition type.

  • trigger_signal (dict) – dict with name and axis of trigger signal for rising or falling edge trigger.

  • trigger_value (int or float) – value for rising or falling edge trigger.

  • trigger_repetitions (int) – number of time trigger will be pull.

Raises
  • TypeError – If trigger_mode is rising or falling edge trigger and trigger_signal or trigger_value are None.

  • MonitoringError – If trigger signal is not mapped.

configure_number_samples(total_num_samples, trigger_delay_samples)

Configure monitoring number of samples. Monitoring must be disabled.

Parameters
  • total_num_samples (int) – monitoring total number of samples.

  • trigger_delay_samples (int) – monitoring number of samples before trigger. It should be less than total_num_samples. Minimum 1.

Raises
  • ValueError – If trigger_delay_samples is less than 1 or higher than total_num_samples.

  • MonitoringError – If buffer size is not enough for all the samples.

configure_sample_time(total_time, trigger_delay)

Configure monitoring number of samples defines by sample and trigger delay time. Monitoring must be disabled.

Parameters
  • total_time (float) – monitoring sample total time, in seconds.

  • trigger_delay (float) – trigger delay in seconds. Value should be between -total_time/2 and total_time/2.

Raises
  • ValueError – If trigger_delay is not between -total_time/2 and total_time/2.

  • MonitoringError – If buffer size is not enough for all the samples.

enable_monitoring()

Enable monitoring

Raises

MonitoringError – If monitoring can’t be enabled.

disable_monitoring()

Disable monitoring

read_monitoring_data(progress_callback=None)

Blocking function that read the monitoring data.

Returns

data of monitoring. Each element of the list is a different register data.

Return type

list of list

get_monitoring_disturbance_status()

Get Monitoring/Disturbance Status.

Returns

Monitoring/Disturbance Status.

Return type

int

is_monitoring_enabled()

Check if monitoring is enabled.

Returns

True if monitoring is enabled, else False.

Return type

bool

get_monitoring_process_stage()

Return monitoring process stage.

Returns

Current monitoring process stage.

Return type

MonitoringProcessStage

is_frame_available()

Check if monitoring has an available frame.

Returns

True if monitoring has an available frame, else False.

Return type

bool

stop_reading_data()

Stops read_monitoring_data function.

reset_trigger_repetitions(trigger_repetitions=1)

Reset trigger repetitions to target value.

Parameters

trigger_repetitions (int) – number of time trigger will be pull.

get_max_sample_size()

Return monitoring max size, in bytes.

Returns

Max buffer size in bytes.

Return type

int

exception ingeniamotion.monitoring.MonitoringError