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

install()[source]

Provide, create and import auxiliaires/connectors present within yaml configuration file.

Raises:

re-raise the caught exception (Exception level)

Return type:

None

uninstall()[source]

Uninstall all created instances of auxiliaires/connectors.

Raises:

re-raise the caught exception (Exception level)

Return type:

None

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.

clear_buffer(aux_alias)[source]

Clear buffer from old stacked objects

Return type:

None

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 alias

  • blocking (bool) – wait for message till timeout elapses?

  • timeout_in_s (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 alias

  • raw_msg (bytes) – message to send

Return type:

bool

Returns:

state representing the send message command completion

start_recording_received_messages()[source]

Start recording received com_aux messages

Return type:

None

stop_recording_received_messages()[source]

Stop recording received com_aux messages

Return type:

None

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-type

  • test_suite_id (int) – select test suite id on dut

  • test_case_id (int) – select test case id on dut

  • aux_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.ProxyAuxiliary[source]

Robot framework plugin for ProxyAuxiliary.

Initialize attributes.

resume(aux_alias)[source]

Resume given auxiliary’s run.

Parameters:

aux_alias (str) – auxiliary’s alias

Return type:

None

suspend(aux_alias)[source]

Suspend given auxiliary’s run.

Parameters:

aux_alias (str) – auxiliary’s alias

Return type:

None

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 type:

str

return: list of off errors

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 send

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 instrument

  • aux_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 send

  • aux_alias (str) – auxiliary’s alias

  • validation (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 alias

  • port (int) – the USB port number

  • unit (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 alias

  • port (int) – the USB port number

  • unit (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 alias

  • port (int) – the USB port number

  • unit (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 alias

  • port (int) – the USB port number

  • amps (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

set_port_disable(aux_alias, port)[source]

Disable power and data lines for a USB port.

Parameters:
  • aux_alias (str) – auxiliary’s alias

  • port (int) – the USB port number

Return type:

int

Returns:

brainstem error code. 0 if no error.

set_port_enable(aux_alias, port)[source]

Enable power and data lines for a USB port.

Parameters:
  • aux_alias (str) – auxiliary’s alias

  • port (int) – the USB port number

Return type:

int

Returns:

brainstem error code. 0 if no error.