Process Image

class ingeniamotion.fsoe_master.process_image.ProcessImage(outputs, inputs)

Bases: object

Helper class to configure the Safety Process Image.

classmethod empty(dictionary)

Create an empty ProcessImage instance with the given dictionary.

Return type:

ProcessImage

Returns:

ProcessImage instance with empty outputs and inputs maps.

classmethod default(dictionary)

Create a default ProcessImage instance with the default dictionary.

Return type:

ProcessImage

Returns:

ProcessImage instance with the minimum required items.

copy()

Create a copy of the ProcessImage instance.

Return type:

ProcessImage

Returns:

A new ProcessImage instance with copies of the outputs and inputs maps.

property editable: bool

Indicates if the Process image can be edited.

Return type:

bool

are_inputs_valid(rules=None, raise_exceptions=False)

Check if the inputs map is valid.

Parameters:
  • rules (Optional[list[FSoEFrameRules]]) – list of specific rules to validate. If None, all rules are validated.

  • raise_exceptions (bool) – If True, raises an exception if any rule is invalid. If False, returns the validation output with exceptions. Defaults to False.

Return type:

FSoEFrameRuleValidatorOutput

Returns:

The output of the validation containing the rules and exceptions.

are_outputs_valid(rules=None, raise_exceptions=False)

Check if the outputs map is valid.

Parameters:
  • rules (Optional[list[FSoEFrameRules]]) – list of specific rules to validate. If None, all rules are validated.

  • raise_exceptions (bool) – If True, raises an exception if any rule is invalid. If False, returns the validation output with exceptions. Defaults to False.

Return type:

FSoEFrameRuleValidatorOutput

Returns:

The output of the validation containing the rules and exceptions.

validate()

Check if the map is valid.

Parameters:
  • rules – list of specific rules to validate. If None, all rules are validated.

  • raise_exceptions – If True, raises an exception if any rule is invalid. If False, returns the validation output with exceptions. Defaults to False.

Return type:

bool

Returns:

True if the maps are valid.

insert_in_best_position(element)

Insert I/O in any best position of the maps.

Finds unused space in the map and insert them there. If not unused space is found, it appends the item to the end of the map.

Parameters:

element (DictionaryItem) – element to add

Raises:

TypeError – if the element is not of a valid type.

Return type:

None

insert_safety_function(safety_function)

Insert all elements of the safety function on the maps.

Parameters:

safety_function (SafetyFunction) – Safety function

Return type:

None

insert_safety_functions_by_type(handler, function_type)

Insert the first non-mapped instance of the given safety function type on the maps.

Parameters:
  • handler (FSoEMasterHandler) – FSoE handler.

  • function_type (type[SafetyFunction]) – Safety function type.

Return type:

SafetyFunction

Returns:

The safety function that was inserted.

Raises:
  • ValueError – if no safety functions of the given type are found.

  • ValueError – if all safety functions of the given type are already mapped.

unmap_safety_function(safe_func)

Unmaps a safety function from the target map.

Parameters:

safe_func (SafetyFunction) – The safety function to unmap.

Raises:

ValueError – if the safety function is not mapped.

Return type:

None

remove_safety_functions_by_type(handler, function_type)

Remove the last instance mapped of the given safety function type on the maps.

Parameters:
  • handler (FSoEMasterHandler) – FSoE handler.

  • function_type (type[SafetyFunction]) – Safety function type.

Return type:

SafetyFunction

Returns:

The safety function that was removed.

Raises:
  • ValueError – if no safety functions of the given type are found.

  • ValueError – if no safety functions of the given type are mapped.

is_safety_function_mapped(safety_function, strict=True)

Check if the safety function is mapped in the process image.

If at least one output of the safety function is present in the process image, the function is considered mapped. If the safety function has no outputs, it is considered mapped if at least one of its inputs is present in the maps.

If strict is False, any IO mapped will return True.

Parameters:
  • safety_function (SafetyFunction) – SafetyFunction to check.

  • strict (bool) – if False, any IO mapped will return True. Defaults to True.

Return type:

bool

Returns:

True if the safety function is mapped, False otherwise.

classmethod from_rpdo_tpdo(rpdo, tpdo, dictionary)

Create a ProcessImage instance from the given RPDO and TPDO maps.

Return type:

ProcessImage

Returns:

ProcessImage instance with the RPDO and TPDO maps filled.

fill_rpdo_map(rpdo_map, servo_dictionary)

Fill the RPDOMap used for the Safety Master PDU.

Return type:

None

fill_tpdo_map(tpdo_map, servo_dictionary)

Fill the TPDOMap used for the Safety Slave PDU.

Return type:

None