Monitoring¶
-
class
ingeniamotion.monitoring.base_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.
defaultby default.
-
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 be1or higher.- Raises
ValueError – If prescaler is less than
1.- Return type
-
map_registers(registers)¶ Map registers to monitoring. Monitoring must be disabled.
- Parameters
registers (
List[Dict[str,Union[str,int,REG_DTYPE]]]) –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.
TypeError – If some parameter has a wrong type.
- Return type
-
abstract
set_trigger(trigger_mode, edge_condition=None, trigger_signal=None, trigger_value=None)¶ Configure monitoring trigger. Monitoring must be disabled.
- Parameters
trigger_mode (
MonitoringSoCType) – monitoring start of condition type.edge_condition (
Optional[MonitoringSoCConfig]) – edge event type.Noneby default.trigger_signal (
Optional[Dict[str,Union[str,int]]]) – dict with name and axis of trigger signal for rising or falling edge trigger.Noneby default.trigger_value (
Union[float,int,None]) – value for rising or falling edge trigger.Noneby default.
- Raises
TypeError – If trigger_mode is trigger event edge and edge_condition, trigger_signal or trigger_value are None.
IMMonitoringError – If trigger signal is not mapped.
- Return type
-
abstract
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
0or higher than total_num_samples.IMMonitoringError – If buffer size is not enough for all the samples.
- Return type
-
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/2andtotal_time/2.IMMonitoringError – If buffer size is not enough for all the samples.
TypeError – If some parameter has a wrong type.
- Return type
-
read_monitoring_data(timeout=None, progress_callback=None)¶ Blocking function that read the monitoring data.
-
get_trigger_type()¶ Get monitoring trigger type.
- Return type
- Returns
Trigger type
- Raises
TypeError – If some read value has a wrong type.
-
raise_forced_trigger(blocking=False, timeout=5)¶ Raise trigger for Forced Trigger type.
-
read_monitoring_data_forced_trigger(trigger_timeout=5)¶ Trigger and read Forced Trigger monitoring.