Robot Framework API Library Documentation
Dynamic Loader plugin
- module
loader
- synopsis
implementation of existing magic import mechanism from ITF for Robot framework usage.
- class pykiso.lib.robot_framework.loader.RobotLoader(config_file)[source]
Robot framework plugin for ITF magic import mechanism.
Initialize attributes.
:param config_file : yaml configuration file path
Auxiliary interface
- module
aux_interface
- synopsis
Simply stored common methods for auxiliary’s when ITF is used with Robot framework.
- class pykiso.lib.robot_framework.aux_interface.RobotAuxInterface(aux_type)[source]
Common interface for all Robot auxiliary.
Initialize attributes.
- Parameters
aux_type (
AuxiliaryInterface
) – auxiliary’s class
Communication auxiliary plugin
- module
communication_auxiliary
- synopsis
implementation of existing CommunicationAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.communication_auxiliary.CommunicationAuxiliary[source]
Robot framework plugin for CommunicationAuxiliary.
Initialize attributes.
- receive_message(aux_alias, blocking=True, timeout_in_s=None)[source]
Return a raw received message from the queue.
- Parameters
aux_alias (
str
) – auxiliary’s aliasblocking (
bool
) – wait for message till timeout elapses?timeout_in_s (
Optional
[float
]) – maximum time in second to wait for a response
- Return type
Union
[list
,Tuple
[list
,int
]]- Returns
raw message and source (return type could be different depending on the associated channel)
- send_message(raw_msg, aux_alias)[source]
Send a raw message via the communication channel.
- Parameters
aux_alias (
str
) – auxiliary’s aliasraw_msg (
bytes
) – message to send
- Return type
bool
- Returns
state representing the send message command completion
Testapp binding
- module
dut_auxiliary
- synopsis
implementation of existing DUTAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.dut_auxiliary.DUTAuxiliary[source]
Robot library to control the TestApp on the DUT
Initialize attributes.
- test_app_run(command_type, test_suite_id, test_case_id, aux_list)[source]
Execute the corresponding test fixture using Test App communication protocol.
- Parameters
command_type (
str
) – message command sub-typetest_suite_id (
int
) – select test suite id on duttest_case_id (
int
) – select test case id on dutaux_list (
List
[str
]) – List of selected auxiliary
- Raises
TypeError – if the given command type doesn’t exist
Assertion – if an aknowledgment is not received or the report status is failed.
- Return type
None
Proxy auxiliary plugin
- module
proxy_auxiliary
- synopsis
implementation of existing ProxyAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.proxy_auxiliary.MpProxyAuxiliary[source]
Robot framework plugin for MpProxyAuxiliary.
Initialize attributes.
Instrument control auxiliary plugin
- module
instrument_control_auxiliary
- synopsis
implementation of existing InstrumentControlAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.instrument_control_auxiliary.InstrumentControlAuxiliary[source]
Robot framework plugin for InstrumentControlAuxiliary.
Initialize attributes.
- disable_output(aux_alias)[source]
Disable output on the currently selected output channel of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the writing operation’s status code
- enable_output(aux_alias)[source]
Enable output on the currently selected output channel of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the writing operation’s status code
- get_all_errors(aux_alias)[source]
Get all errors of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias
return: list of off errors
- Return type
str
- get_current_limit_high(aux_alias)[source]
Returns the current upper limit (in V) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- get_current_limit_low(aux_alias)[source]
Returns the current lower limit (in V) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- get_identification(aux_alias)[source]
Get the identification information of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the instrument’s identification information
- get_nominal_current(aux_alias)[source]
Query the nominal current of an instrument on the selected channel (in A)
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the nominal current
- get_nominal_power(aux_alias)[source]
Query the nominal power of an instrument on the selected channel (in W).
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the nominal power
- get_nominal_voltage(aux_alias)[source]
Query the nominal voltage of an instrument on the selected channel (in V).
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the nominal voltage
- get_output_channel(aux_alias)[source]
Get the currently selected output channel of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the currently selected output channel
- get_output_state(aux_alias)[source]
Get the output status (ON or OFF, enabled or disabled) of the currently selected channel of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the output state (ON or OFF)
- get_power_limit_high(aux_alias)[source]
Returns the power upper limit (in W) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- get_remote_control_state(aux_alias)[source]
Get the remote control mode (ON or OFF) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the remote control state
- get_status_byte(aux_alias)[source]
Get the status byte of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the intrument’s status byte
- get_target_current(aux_alias)[source]
Get the desired output current (in A) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the target current
- get_target_power(aux_alias)[source]
Get the desired output power (in W) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the target power
- get_target_voltage(aux_alias)[source]
Get the desired output voltage (in V) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the target voltage
- get_voltage_limit_high(aux_alias)[source]
Returns the voltage upper limit (in V) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- get_voltage_limit_low(aux_alias)[source]
Returns the voltage lower limit (in V) of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- measure_current(aux_alias)[source]
Return the measured output current of an instrument (in A).
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the measured current
- measure_power(aux_alias)[source]
Return the measured output power of an instrument (in W).
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the measured power
- measure_voltage(aux_alias)[source]
Return the measured output voltage of an instrument (in V).
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the measured voltage
- query(query_command, aux_alias)[source]
Send a query request to the instrument.
- Parameters
query_command (
str
) – query command to sendaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
Response message, None if the request expired with a timeout.
- read(aux_alias)[source]
Send a read request to the instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
Response message, None if the request expired with a timeout.
- reset(aux_alias)[source]
Reset an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
NO_VALIDATION status code
- self_test(aux_alias)[source]
Performs a self-test of an instrument.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the query’s response message
- set_current_limit_high(limit_value, aux_alias)[source]
Set the current upper limit (in A) of an instrument.
- Parameters
limit_value (
float
) – limit value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_current_limit_low(limit_value, aux_alias)[source]
Set the current lower limit (in A) of an instrument.
- Parameters
limit_value (
float
) – limit value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_output_channel(channel, aux_alias)[source]
Set the output channel of an instrument.
- Parameters
channel (
int
) – the output channel to select on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_power_limit_high(limit_value, aux_alias)[source]
Set the power upper limit (in W) of an instrument.
- Parameters
limit_value (
float
) – limit value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_remote_control_off(aux_alias)[source]
Disable the remote control of an instrument. The instrument will respond to query and read commands only.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the writing operation’s status code
- set_remote_control_on(aux_alias)[source]
Enables the remote control of an instrument. The instrument will respond to all SCPI commands.
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
str
- Returns
the writing operation’s status code
- set_target_current(value, aux_alias)[source]
Set the desired output current (in A) of an instrument.
- Parameters
value (
float
) – value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_target_power(value, aux_alias)[source]
Set the desired output power (in W) of an instrument.
- Parameters
value (
float
) – value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_target_voltage(value, aux_alias)[source]
Set the desired output voltage (in V) of an instrument.
- Parameters
value (
float
) – value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_voltage_limit_high(limit_value, aux_alias)[source]
Set the voltage upper limit (in V) of an instrument.
- Parameters
limit_value (
float
) – limit value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- set_voltage_limit_low(limit_value, aux_alias)[source]
Set the voltage lower limit (in V) of an instrument.
- Parameters
limit_value (
float
) – limit value to be set on the instrumentaux_alias (
str
) – auxiliary’s alias
- Return type
str
- Returns
the writing operation’s status code
- write(write_command, aux_alias, validation=None)[source]
Send a write request to the instrument and then returns if the value was successfully written. A query is sent immediately after the writing and the answer is compared to the expected one.
- Parameters
write_command (
str
) – write command to sendaux_alias (
str
) – auxiliary’s aliasvalidation (
Optional
[tuple
]) – tuple of the form (validation command (str), expected output (str))
- Return type
str
- Returns
status message depending on the command validation: SUCCESS, FAILURE or NO_VALIDATION
acroname auxiliary plugin
- module
acroname_auxiliary
- synopsis
implementation of existing AcronameAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.acroname_auxiliary.AcronameAuxiliary[source]
Robot framework plugin for AcronameAuxiliary.
Initialize attributes.
- get_port_current(aux_alias, port, unit='A')[source]
Get the current through the power line for selected usb port.
- Parameters
aux_alias (
str
) – auxiliary’s aliasport (
int
) – the USB port numberunit (
str
) – unit of the result in “uA”, “mA” or “A”. Default “A”
- Return type
Optional
[float
]- Returns
port current for given unit. None if unit is not supported.
- get_port_current_limit(aux_alias, port, unit='A')[source]
Get the current limit for the port.
- Parameters
aux_alias (
str
) – auxiliary’s aliasport (
int
) – the USB port numberunit (
str
) – unit of the result in “uA”, “mA” or “A”. Default “A”
- Return type
Optional
[float
]- Returns
port current limit for given unit. None if unit is not supported.
- get_port_voltage(aux_alias, port, unit='V')[source]
Get the voltage of the selected usb port.
- Parameters
aux_alias (
str
) – auxiliary’s aliasport (
int
) – the USB port numberunit (
str
) – unit of the result in “uV”, “mV” or “V”. Default “V”
- Return type
Optional
[float
]- Returns
port voltage for given unit. None if unit is not supported.
- set_port_current_limit(aux_alias, port, amps, unit='A')[source]
Set the current limit for the port. If the set limit is not achievable, devices will round down to the nearest available current limit setting.
- Parameters
aux_alias (
str
) – auxiliary’s aliasport (
int
) – the USB port numberamps (
float
) – value for port current to set in “uA”, “mA” or “A”. Default “A”unit (
str
) – unit for the value to set. Default Ampere
- Return type
None
UDS Auxiliary plugin
- module
uds_auxiliary
- synopsis
implementation of existing UdsAuxiliary for Robot framework usage.
- class pykiso.lib.robot_framework.uds_auxiliary.UdsAuxiliary[source]
Robot framework plugin for UdsAuxiliary.
Initialize attributes.
- check_raw_response_negative(resp, aux_alias)[source]
Check if the response is negative, raise an error if not
- Parameters
resp (
UdsResponse
) – raw response of uds request- Raises
UnexpectedResponseError – raised when the answer is not the expected one
- Return type
Optional
[bool
]- Returns
True if response is negative
- check_raw_response_positive(resp, aux_alias)[source]
Check if the response is positive, raise an error if not
- Parameters
resp (
UdsResponse
) – raw response of uds request- Raises
UnexpectedResponseError – raised when the answer is not the expected one
- Return type
Optional
[bool
]- Returns
True if response is positive
- force_ecu_reset(aux_alias)[source]
Allow power reset of the component
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
List
[int
]
- static get_service_id(service_name)[source]
Return the uds service id.
- Parameters
service_name (
str
) – service’s name (EcuReset, ReadDataByIdentifier …)- Return type
int
- Returns
corresponding service identification number
- hard_reset(aux_alias)[source]
Allow power reset of the component
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
Union
[dict
,List
[int
]]
- read_data(parameter, aux_alias)[source]
UDS config command that allow data reading
- Parameters
parameter (
str
) – data to be readaux_alias (
str
) – auxiliary’s alias
- Return type
Union
[dict
,bool
]- Returns
a dict with uds config response
- send_uds_config(msg_to_send, aux_alias, timeout_in_s=6)[source]
Send UDS config to the target ECU.
- Parameters
msg_to_send (
dict
) – uds config to be sentaux_alias (
str
) – auxiliary’s aliastimeout_in_s (
float
) – maximum time used to wait for a response
- Return type
Union
[dict
,bool
]- Returns
a dict containing the uds response, or True if a response is not expected and the command is properly sent otherwise False
- send_uds_raw(msg_to_send, aux_alias, timeout_in_s=6, response_required=True)[source]
Send a UDS diagnostic request to the target ECU.
- Parameters
msg_to_send (
bytes
) – can uds raw bytes to be sentaux_alias (
str
) – auxiliary’s aliastimeout_in_s (
float
) – maximum time used to wait for a response.response_required (
bool
) – Wait for a response if True
- Return type
Union
[list
,bool
]- Returns
the raw uds response’s, or True if a response is not expected and the command is properly sent otherwise False
- soft_reset(aux_alias)[source]
Perform soft reset of the component, equivalent to a restart of application
- Parameters
aux_alias (
str
) – auxiliary’s alias- Return type
Union
[dict
,List
[int
]]
- start_tester_present_sender(aux_alias, period=4)[source]
Start to continuously sends tester present messages via UDS
- Parameters
period (
int
) – period in seconds to use for the cyclic sending of tester presentaux_alias – auxiliary’s alias
- Return type
None
- stop_tester_present_sender(aux_alias)[source]
Stop to continuously sends tester present messages via UDS
- Return type
None
- write_data(parameter, value, aux_alias)[source]
UDS config command that allow data reading
- Parameters
parameter (
str
) – data to be readvalue (
Union
[List
[bytes
],bytes
]) – new content of the dataaux_alias (
str
) – auxiliary’s alias
- Return type
Union
[dict
,bool
]- Returns
a dict with uds config response