Monitoring¶
-
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.
-
configure_number_samples
(total_num_samples, trigger_delay_samples)¶ Configure monitoring number of samples. Monitoring must be disabled.
- Parameters
- Raises
ValueError – If trigger_delay_samples is less than
1
or higher than total_num_samples.IMMonitoringError – 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
- Raises
ValueError – If trigger_delay is not between
-total_time/2
andtotal_time/2
.IMMonitoringError – If buffer size is not enough for all the samples.
-
get_max_sample_size
()¶ Return monitoring max size, in bytes.
- Returns
Max buffer size in bytes.
- Return type
-
get_monitoring_process_stage
()¶ (Deprecated) Return monitoring process stage.
- Returns
Current monitoring process stage.
- Return type
-
get_trigger_type
()¶ Get monitoring trigger type.
- Returns
trigger type
- Return type
-
is_frame_available
()¶ (Deprecated) Check if monitoring has an available frame.
- Returns
True if monitoring has an available frame, else False.
- Return type
-
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
IMMonitoringError – If register maps fails in the servo.
IMMonitoringError – If buffer size is not enough for all the registers.
-
raise_forced_trigger
(blocking=False, timeout=5)¶ Raise trigger for Forced Trigger type.
-
read_monitoring_data
(timeout=None, progress_callback=None)¶ Blocking function that read the monitoring data.
- Parameters
timeout (float) – maximum time trigger is waited, in seconds.
None
by default.- Returns
data of monitoring. Each element of the list is a different register data.
- Return type
list of list
-
read_monitoring_data_forced_trigger
(trigger_timeout=5)¶ Trigger and read Forced Trigger monitoring.
- Parameters
trigger_timeout (float) – maximum time function wait to raise the trigger, in seconds.
5
by default.- Returns
data of monitoring. Each element of the list is a different register data.
- Return type
list of list
-
reset_trigger_repetitions
()¶ Reset trigger repetitions to target value.
-
set_frequency
(prescaler)¶ Function to define monitoring frequency with a prescaler. Frequency will be
Position & velocity loop rate frequency / prescaler
, seeingeniamotion.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
.
-
set_trigger
(trigger_mode, trigger_signal=None, trigger_value=None)¶ 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.
- Raises
TypeError – If trigger_mode is rising or falling edge trigger and trigger_signal or trigger_value are None.
IMMonitoringError – If trigger signal is not mapped.
-
stop_reading_data
()¶ Stops read_monitoring_data function.
-
class
ingeniamotion.monitoring.
MonitoringSoCType
(value)¶ Monitoring start of condition type