2. SODA Keywords Guide

2.1. Table of contents

2.2. Basic Concepts

This guide describes a custom keyword library designed for writing test scenarios using Robot Framework. These scenarios are specifically tailored for testing automotive features and are executed within the test environment provided by the SODA Software-Defined Rig (SDR). The guide offers comprehensive information on using specialized keywords to create efficient and effective test cases for automotive systems, leveraging the capabilities of both Robot Framework and SODA’s testing infrastructure.

This guide is founded on the following key definitions:

  • Object: An entity represented within the test environment configured on the SDR. These objects can be accessed, and their parameters can be set or read using keywords from the SODA Keywords library. Objects are often interconnected within the test environment, and actions on one object may lead to changes in the parameters of another.

  • Keyword: An operator recognized by Robot Framework when executing a test scenario. This guide specifically focuses on the keywords that comprise the SODA Keywords library.

These foundational concepts form the basis for understanding and effectively utilizing the SODA Keywords in automotive testing scenarios.

2.3. Interacting with CAN Messages and Signals

This section describes the keywords and objects used to interact with real CAN messages and their signals as presented in the test environment.

2.3.1. CAN Message Object

CAN Message Object physically manifests as a message within one of the CAN networks of the configured test environment. Using specific keywords, you can create the CAN Message Object, initiate its transmission over the network, receive it from the network, modify its contents, and either resend or halt its transmission. This object has the following set of parameters:

  • dbc_name - The relative path to DBC-file on SDR where the message is defined.

  • message_name - The unique name of the message in the scope of the DBC-file.

  • network_name - The unique name of the network in which the message is transmitted.

  • cycle_time - It refers to the period or frequency at which the message is repeatedly transmitted over the network. It is measured in milliseconds.

  • timeout - It refers to the period of time after which the message is considered undeliverable.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted message).

Also, all signals within the message are transformed into the parameters of the object. For example, if a message contains two signals AmbientTemperature and InnerTemperature, the object ${msg} will contain two parameters ${msg}['AmbientTemperature'] and ${msg}['InnerTemperature'].

2.3.2. Create Message Keyword

Create Message Keyword creates a CAN Message Object in the context of a test scenario. All parameters of this object are obtained from the DBC file, which is specified as the invocation parameter of this keyword. This keyword doesn’t start real CAN message transmission immediately; it only creates the message as an object within the context of the test scenario. It fails if either the given path to the DBC file doesn’t exist or the given message name is not found within the test environment.

Also, a created CAN Message Object cannot exist without the context of a specific CAN network, so the third parameter of this keyword is network_name, and the message can only exist within this network. You can’t change this parameter of the object after creation. The fourth mandatory parameter is source_address. This parameter is part of the CAN ID, so it is also used to identify the CAN message when it is received.

The set of arguments and their order when calling Create Message Keyword is:

  • dbc_name - The relative path to the DBC-file on SDR where the message is defined.

  • message_name - The unique name of the message in the scope of the DBC-file.

  • network_name - The unique name of the network in which the message is transmitted.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted message). This parameter is optional, and if omitted, the message will be broadcasted to all nodes within the specified network.

Example usage of Create Message Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can create broadcasted message
    ${msg} =  Create Message  IOCC_ECU.dbc   MeasuredTemp   LftReZone  ${0x01}
    Should Be Equal   ${msg}[dbc_name]              IOCC_ECU.dbc
    Should Be Equal   ${msg}[message_name]          MeasuredTemp
    Should Be Equal   ${msg}[network_name]          LftReZone
    Should Be Equal   ${msg}[source_address]        ${0x01}
    Should Be Equal   ${msg}[destination_address]   ${0xFF}

User can create unicasted message
    ${msg} =  Create Message  IOCC_ECU.dbc   MeasuredTemp   LftReZone  ${0x01}   ${0x0A}
    Should Be Equal   ${msg}[destination_address]   ${0x0A}

User can't create message because DBC-file doesn't exist
  TRY
    ${msg} =  Create Message  ${Empty}  MeasuredTemp   LftReZone   ${0x01}
  EXCEPT  The DBC-file '' doesn't exist within the XIL Server.
    Should Be True  ${True}
  END

User can't create message because message name doesn't exist
  TRY
    ${msg} =  Create Message  IOCC_ECU.dbc    ${Empty}    LftReZone   ${0x01}
  EXCEPT  The message '' doesn't exist within the specified DBC-file 'IOCC_ECU.dbc'.
    Should Be True  ${True}
  END

User can't create message because network doesn't exist
  TRY
    ${msg} =  Create Message  IOCC_ECU.dbc    MeasuredTemp    ${Empty}   ${0x01}
  EXCEPT  The network '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't create message because source address doesn't exist
  TRY
    ${msg} =  Create Message  IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${Empty}
  EXCEPT  The network identifier of the transmitter '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

The following exceptions may occur when Create Message Keyword is calling:

  • The specified DBC-file {dbc_name} doesn’t exist within the XIL Server.

  • The specifed message {message_name} doesn’t exist within specified DBC-file {dbc_name}.

  • The specified network {network_name} doesn’t exist within current XIL Test Environment.

  • The network identifier of the transmitter {source_address} doesn’t exist within current XIL Test Environment.

2.3.3. Create E2E Message Keyword

Create E2E Message Keyword creates a CAN message with additional E2E protection parameters (data_id and profile) in the context of a test scenario. This keyword is similar to Create Message Keyword, but it also includes additional parameters required for E2E protection.

The set of arguments and their order when calling Create E2E Message Keyword is:

  • dbc_name - The relative path to the DBC-file on SDR where the message is defined.

  • message_name - The unique name of the message in the scope of the DBC-file.

  • network_name - The unique name of the network in which the message is transmitted.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted message). This parameter is optional, and if omitted, the message will be broadcasted to all nodes within the specified network.

  • data_id - The identifier for the data to be protected by E2E.

  • profile - The E2E profile to be used for protection.

Example usage of Create E2E Message Keyword:

robotframework

Copy code

`*** Settings *** Library lib/SodaKeywordsLibrary.py

*** Test Cases *** User can create an E2E protected message ${msg} = Create E2E Message IOCC_ECU.dbc MeasuredTemp LftReZone ${0x01} ${0x0A} ${0x001} ${0x1A} Should Be Equal ${msg}[dbc_name] IOCC_ECU.dbc Should Be Equal ${msg}[message_name] MeasuredTemp Should Be Equal ${msg}[network_name] LftReZone Should Be Equal ${msg}[source_address] ${0x01} Should Be Equal ${msg}[destination_address] ${0x0A} Should Be Equal ${msg}[data_id] ${0x001} Should Be Equal ${msg}[profile] ${0x1A}

User can’t create E2E message because DBC-file doesn’t exist TRY ${msg} = Create E2E Message ${Empty} MeasuredTemp LftReZone ${0x01} ${0x0A} ${0x001} ${0x1A} EXCEPT The DBC-file ‘’ doesn’t exist within the XIL Server. Should Be True ${True} END

User can’t create E2E message because message name doesn’t exist TRY ${msg} = Create E2E Message IOCC_ECU.dbc ${Empty} LftReZone ${0x01} ${0x0A} ${0x001} ${0x1A} EXCEPT The message ‘’ doesn’t exist within the specified DBC-file ‘IOCC_ECU.dbc’. Should Be True ${True} END

User can’t create E2E message because network doesn’t exist TRY ${msg} = Create E2E Message IOCC_ECU.dbc MeasuredTemp ${Empty} ${0x01} ${0x0A} ${0x001} ${0x1A} EXCEPT The network ‘’ doesn’t exist within the XIL Test Environment. Should Be True ${True} END

User can’t create E2E message because source address doesn’t exist TRY ${msg} = Create E2E Message IOCC_ECU.dbc MeasuredTemp LftReZone ${Empty} ${0x0A} ${0x001} ${0x1A} EXCEPT The network identifier of the transmitter ‘’ doesn’t exist within the XIL Test Environment. Should Be True ${True} END`

The following exceptions may occur when calling Create E2E Message Keyword:

  • The specified DBC-file {dbc_name} doesn’t exist within the XIL Server.

  • The specified message {message_name} doesn’t exist within the specified DBC-file {dbc_name}.

  • The specified network {network_name} doesn’t exist within the current XIL Test Environment.

  • The network identifier of the transmitter {source_address} doesn’t exist within the current XIL Test Environment.

2.3.4. Apply Message Keyword

Apply Message Keyword applies changes of a CAN Message Object to the test environment. All changes will be applied atomically, so the receivers will never get a partial update; only the whole consistent CAN message will be sent.

The set of argruments and and their order when calling Apply Message Keyword is next:

  • message - The CAN Message Object in the context of test scenario which corresponds to CAN message in the test environment.

The example of using Apply Message Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can modify message and apply these changes on XIL Server
  ${msg} =  Create Message    IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${0x01}

  Should Be Equal   ${msg}[cycle_time]          ${100}
  Should Be Equal   ${msg}[InnerTemperature]    ${5}
  Should Be Equal   ${msg}[AmbientTemprature]   ${25}
  Should Be Equal   ${msg}[FanSpeedMode]        NORMAL

  ${msg}[cycle_time] =          Set Variable  ${200}
  ${msg}[InnerTemperature] =    Set Variable  ${20}
  ${msg}[AmbientTemprature] =   Set Variable  ${10}
  ${msg}[FanSpeedMode] =        Set Variable  LOW

  ${msg_modified} =  Apply message   ${msg}

  Should Be Equal   ${msg_modified}[cycle_time]          ${200}
  Should Be Equal   ${msg_modified}[InnerTemperature]    ${20}
  Should Be Equal   ${msg_modified}[AmbientTemprature]   ${10}
  Should Be Equal   ${msg_modified}[FanSpeedMode]        LOW

User can't modify message because the signal doesn't exist
  ${msg} =  Create Message    IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${0x01}
  ${msg}[CargoTemprature] =     Set Variable  ${10}
  TRY
    ${msg_modified} =  Apply Message  ${msg}
  EXCEPT  The signal 'CargoTemprature' doesn't exist within the specified message 'MeasuredTemp'.
    Should Be True  ${True}
  END

The following exceptions may occur when Apply Message Keyword is calling:

  • The signal {signal_name} doesn’t exist within the specified message {message_name}.

2.3.5. Set Signal Value Keyword

Set Signal Value Keyword is used to modify one signal within a transmitted CAN message. Behind the scenes, the keyword gets the CAN message, modifies one signal within this message, and then applies the modified message to the test environment.

The set of argruments and and their order when calling Set Signal Value Keyword is next:

  • message_name - The unique name of the message that is currently being transmitted on the specified CAN network.

  • network_name - The unique name of the CAN network within the test environment in which the message is transmitted.

  • signal_name - The unique name of the signal in scope of the specified message.

  • signal_value - The new value of the signal which will start transmitted immediately after execution of the keyword.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted Message). This parameter is optional, in case when this parameter is omitted, the message will be broadcasted to all nodes within the specified network.

The example of using Set Signal Value Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can modify signal within the transmitted message on XIL Server
  ${msg} =  Set Signal Value    MeasuredTemp    LftReZone   AmbientTemprature   ${30}   ${0x01}
  Should Be Equal   ${msg}[AmbientTemprature]   ${30}

User can't modify signal because the message isn't transmitted
  TRY
    ${msg} =  Set Signal Value    ''    LftReZone   AmbientTemprature   ${30}   ${0x01}
  EXCEPT  The message '' isn't transmitted within the specified network 'LftReZone'
    Should Be True  ${True}
  END

User can't modify signal because the network doesn't exist
  TRY
    ${msg} =  Set Signal Value    MeasuredTemp    ''   AmbientTemprature   ${30}   ${0x01}
  EXCEPT  The network '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't modify siganl becuase it doesn't exist
  TRY
    ${msg} =  Set Signal Value    MeasuredTemp    LftReZone   CargoTemprature   ${30}   ${0x01}
  EXCEPT  The signal 'CargoTemprature' doesn't exist within the specified message 'MeasuredTemp'.
    Should Be True  ${True}
  END

The following exceptions may occur when Set Signal Value Keyword is calling:

  • The message {message_name} isn’t transmitted within the specified network {network_name}.

  • The network {network_name} doesn’t exist within the XIL Test Environment.

  • The network identifier of the transmitter {source_address} doesn’t exist within the XIL Test Environment.

  • The signal {signal_name} doesn’t exist within the specified message {message_name}.

2.3.6. Get Signal Value Keyword

Get Signal Value Keyword retrieves a signal from a CAN message which is transmitted within a specific CAN network as a variable in the context of the test scenario.

The set of argruments and their order when calling Get Signal Value Keyword is next:

  • message_name - The unique name of the message that is currently being transmitted on the specified CAN network.

  • network_name - The unique name of the CAN network within the test environment in which the message is transmitted.

  • signal_name - The unique name of the signal in scope of the specified message.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted Message). This parameter is optional, in case when this parameter is omitted, the message will be broadcasted to all nodes within the specified network.

The example of using Get Signal Value Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can retrieve signal within the transmitted message on XIL Server
  ${ambientT} =  Get Signal Value    MeasuredTemp    BodyNet   AmbientTemprature   ${0x01}
  Should Be Equal   ${ambientT}   ${30}

User can't retrieve signal because the message isn't transmitted
  TRY
    ${ambientT} =  Get Signal Value    ''    LftReZone   AmbientTemprature   ${0x01}
  EXCEPT  The message '' isn't transmitted within the specified network 'LftReZone'
    Should Be True  ${True}
  END

User can't retrieve signal because the network doesn't exist
  TRY
    ${ambientT} =  Get Signal Value    MeasuredTemp    ''   AmbientTemprature   ${0x01}
  EXCEPT  The network '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't retrieve signal becuase it doesn't exist
  TRY
    ${ambientT} =  Get Signal Value    MeasuredTemp    LftReZone   CargoTemprature   ${0x01}
  EXCEPT  The signal 'CargoTemprature' doesn't exist within the specified message 'MeasuredTemp'.
    Should Be True  ${True}
  END

The following exceptions may occur when Get Signal Value Keyword is calling:

  • The message {message_name} isn’t transmitted within the specified network {network_name}.

  • The network {network_name} doesn’t exist within the XIL Test Environment.

  • The network identifier of the transmitter {source_address} doesn’t exist within the XIL Test Environment.

  • The signal {signal_name} doesn’t exist within the specified message {message_name}.

2.3.7. Get Message Keyword

Get Message Keyword retrieves a CAN message that is being transmitted at the current moment within a specific CAN network as a CAN Message Object in the context of the test scenario. In other words, you can only get a CAN message that exists right now in the CAN network within the current test environment. The keyword returns an empty object if the specified CAN message is not being transmitted in the CAN network at the time of the request.

The set of argruments and and their order when calling Get Message Keyword is next:

  • message_name - The unique name of the message that is currently being transmitted on the specified CAN network.

  • network_name - The unique name of the CAN network within the test environment in which the message is transmitted.

  • source_address - The network identifier of the message’s transmitter.

  • destination_address - The network identifier of the message’s receiver (destination point of the transmitted Message). This parameter is optional, in case when this parameter is omitted, the message will be broadcasted to all nodes within the specified network.

The example of using Get Message Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get message which is currently transmtted
  ${msg} =  Create Message    IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${0x01}
  Start Message   ${msg}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Not Be Empty   ${msg}
  Stop Message    ${msg}

User can't get message becuase the message isn't transmitted
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Be Empty   ${msg}

User can't get message because the network doesn't exist
  TRY
    ${msg} =  Get Message    MeasuredTemp    ${Empty}   ${0x01}
  EXCEPT  The network '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get message because source address doesn't exist
  TRY
    ${msg} =  Get Message    MeasuredTemp    LftReZone   ${Empty}
  EXCEPT  The network identifier of the transmitter '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

The following exceptions may occur when Get Message Keyword is calling:

  • The network {network_name} doesn’t exist within the XIL Test Environment.

  • The network identifier of the transmitter {source_address} doesn’t exist within the XIL Test Environment.

2.3.8. Start Message Keyword

Start Message Keyword starts transmission of a specified CAN message within a specified CAN network in the test envaironment. After the CAN message was started, you can using Get Message Keyword returns CAN Message Object which contains all needed information about previously started CAN message within the network.

Start Message Keyword initiates the transmission of a specified CAN message within a specified CAN network in the test environment. After the CAN message has been started, you can use the Get Message Keyword to retrieve a CAN Message Object which contains all necessary information about the previously started CAN message within the network.

The set of argruments and and their order when calling Start Message Keyword is next:

  • message - The CAN Message Object in the context of test scenario which corresponds to CAN message in the test environment.

The example of using Start Message Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can start message
  Create Message    IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${0x01}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Be Empty   ${msg}
  Start Message   ${msg}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Not Be Empty   ${msg}

2.3.9. Stop Message Keyword

Stop Message Keyword stops transmission of a specified CAN message within a specified Network. After the message was stopped, Get Message Keyword returns empty object.

The set of argruments and and their order when calling Stop Message Keyword is next:

  • message - The CAN Message Object in the context of test scenario which corresponds to CAN message in the test environment.

The example of using Stop Message Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can stop message
  ${msg} =  Create Message    IOCC_ECU.dbc    MeasuredTemp    LftReZone   ${0x01}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Be Empty         ${msg}
  Start Message           ${msg}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Not Be Empty     ${msg}
  Stop Message            ${msg}
  ${msg} =  Get Message   MeasuredTemp    LftReZone   ${0x01}
  Should Be Empty         ${msg}

2.4. Interacting with ECU Pins

This section describes the keywords used to interact with ECU pins as presented in the test environment.

2.4.1. Get Pin Voltage Keyword

Get Pin Voltage Keyword returns a scalar value in Volts which corresponds to the voltage on a specified ECU pin. The possible range of voltage is 0-27V. It fails if either the given ECU or its pin name does not exist within the current test environment.

The set of argruments and and their order when calling Get Pin Voltage Keyword is next:

  • ecu_name - The unique name of the ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of the pin in the format {identifier of electrical connector}.{number of pin in specified connector} in the scope of the specified ECU. For example, it could be X1.11, which means the electrical connector is X1, and the number of the pin is 11.

  • voltage - The value of voltage in Volts which will be compared on the specified ECU pin. If the measured voltage isn’t equal to the specified value, a Failure is raised. The available range of voltage is 0-27V. This parameter is optional; if omitted, the keyword returns the current value.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 3.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the voltage to reach the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Get Pin Voltage Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get voltage of the pin
  ${pin_voltage} =  Get Pin Voltage   LRIO    X1.11
  Should Be Equal   ${pin_voltage}    ${5}

User can't get voltage because the ECU doesn't exist
  TRY
    Get Pin Voltage    ${Empty}    X1.11
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get voltage because the pin doesn't exist
  TRY
    Get Pin Voltage    LRIO    ${Empty}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can validate the voltage of the pin
  ${pin_voltage} =  Get Pin Voltage   LRIO    X1.11 ${TestVoltageV}  ${Precision}  ${Timeout_s}  &{PrecisionMode}

The following exceptions may occur when Get Pin Voltage Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.4.2. Set Pin Voltage Keyword

Set Pin Voltage Keyword sets the voltage of a specified ECU pin to a new value. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Set Pin Voltage Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • voltage - The value of voltage in Volts which will be set on the specified ECU pin. The available range of voltage is 0-27V.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 5.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the voltage to be set to the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Set Pin Voltage Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set voltage on the pin
  ${pin} =  Set Pin Voltage   LRIO    X1.12   ${5}
  Should Be Equal   ${pin}[voltage]    ${5}

User can't set voltage because the voltage is more than max
  TRY
    Set Pin Voltage   LRIO    X1.12   ${35}
  EXCEPT  The requested voltage value '35' is out of the range '0-27V'.
    Should Be True  ${True}
  END

User can't set voltage because the voltage is less than min
  TRY
    Set Pin Voltage   LRIO    X1.12   ${-5}
  EXCEPT  The requested voltage value '-5' is out of the range '0-27V'.
    Should Be True  ${True}
  END

User can't set voltage because the ECU doesn't exist
  TRY
    Set Pin Voltage   ${Empty}  X1.12  ${5}
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't set voltage because the pin doesn't exist
  TRY
    Set Pin Voltage   LRIO  ${Empty}  ${5}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can set and validate the voltage of the pin
  ${pin_voltage} =  Get Pin Voltage   LRIO    X1.11 ${TestVoltageV}  ${Precision}  ${Timeout_s}  &{PrecisionMode}

The following exceptions may occur when Set Pin Voltage Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

  • The requested voltage value {voltage} is out of the range 0-27V.

2.4.3. Get Pin Current Loop Keyword

Get Pin Current Loop Keyword returns a scalar value in mA which corresponds to the current loop of a specified ECU pin. The possible range of current is 0-20mA. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Get Pin Current Loop Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • current_loop - The value of current loop in mA which will be compared on the specified ECU pin. If the measured current isn’t equal to the specified value, a Failure is raised. The available range of current is 0-20mA. This parameter is optional; if omitted, the keyword returns the current value.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 3.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the current to reach the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Get Pin Current Loop Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get current loop of the pin
  ${pin_current_loop} =  Get Pin Current Loop   LRIO    X1.11
  Should Be Equal   ${pin_current_loop}    ${10}

User can't get current loop because the ECU doesn't exist
  TRY
    Get Pin Current Loop    ${Empty}    X1.11
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get current loop because the pin doesn't exist
  TRY
    Get Pin Current Loop    LRIO    ${Empty}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can validate the current loop of the pin
  ${pin_current_loop} =  Get Pin Current Loop   LRIO    X1.11 ${TestCurrentLoop_mA}  ${Precision}  ${Timeout_s}  &{PrecisionMode}

The following exceptions may occur when Get Pin Current Loop Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.4.4. Set Pin Current Loop Keyword

Set Pin Current Loop Keyword sets the current loop of a specified ECU pin to a new value. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Set Pin Current Loop Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • current_loop - The value of current loop in mA which will be set on the specified ECU pin. The available range of current loop is 0-20mA.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 5.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the current to be set to the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Set Pin Current Loop Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set current loop on the pin
  ${pin} =  Set Pin Current Loop   LRIO    X1.12   ${10}
  Should Be Equal   ${pin}[current_loop]    ${10}

User can't set current loop because the value is more than max
  TRY
    Set Pin Current Loop   LRIO    X1.12   ${25}
  EXCEPT  The requested current loop value '25' is out of the range '0-20mA'.
    Should Be True  ${True}
  END

User can't set current loop because the value is less than min
  TRY
    Set Pin Current Loop   LRIO    X1.12   ${-5}
  EXCEPT  The requested current loop value '-5' is out of the range '0-20mA'.
    Should Be True  ${True}
  END

User can't set current loop because the ECU doesn't exist
  TRY
    Set Pin Current Loop   ${Empty}  X1.12  ${5}
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't set current loop because the pin doesn't exist
  TRY
    Set Pin Current Loop   LRIO  ${Empty}  ${5}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can set current loop with precision and timeout
  ${pin} =  Set Pin Current Loop   LRIO    X1.12   ${10}  ${5}  ${1.0}  RELRANGE
  Should Be Equal   ${pin}[current_loop]    ${10}

The following exceptions may occur when Set Pin Current Loop Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

  • The requested current loop value {current_loop} is out of the range 0-20mA.

2.4.5. Get Pin PWM Keyword

Get Pin PWM Keyword returns a dictionary object into the context of the test scenario, which corresponds to the PWM settings on a specified ECU pin. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Get Pin PWM Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • duty - The duty cycle value in percentage which will be compared on the specified ECU pin. If the measured duty cycle isn’t equal to the specified value, a Failure is raised. This parameter is optional; if omitted, the keyword returns the current value.

  • frequency - The frequency value in Hz which will be compared on the specified ECU pin. If the measured frequency isn’t equal to the specified value, a Failure is raised. This parameter is optional; if omitted, the keyword returns the current value.

  • precision_duty - The precision value in percentage for the duty cycle. Default is 3.0. This parameter is optional.

  • precision_frequency - The precision value in percentage for the frequency. Default is 1.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the PWM to reach the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Get Pin PWM Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get PWM of the pin
  ${pin_pwm} =  Get Pin PWM   LRIO    X1.11
  Should Be Equal   ${pin_pwm}[duty]        ${100}
  Should Be Equal   ${pin_pwm}[frequency]   ${30}
  Should Be Equal   ${pin_pwm}[level]       ${15}

User can't get PWM because the ECU doesn't exist
  TRY
    Get Pin PWM    ${Empty}    X1.11
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get PWM because the pin doesn't exist
  TRY
    Get Pin PWM    LRIO    ${Empty}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can get PWM with precision and timeout
  ${pin_pwm} =  Get Pin PWM   LRIO    X1.11  ${50}  ${1000}  ${1.0}  ${0.5}  ${0.1}  RELRANGE
  Should Be Equal   ${pin_pwm}[duty]        ${50}
  Should Be Equal   ${pin_pwm}[frequency]   ${1000}

The following exceptions may occur when Get Pin PWM Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.4.6. Set Pin PWM Keyword

Set Pin PWM Keyword sets PWM for a specified ECU pin to a new settings. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Set Pin PWM Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • duty - The settings of Pulse Width Modulation on the specified ECU pin. It allows control of the power supplied to electrical devices by varying the duty cycle of a digital (on/off) pulse train. The available range of PWM duty is [0-100%].

  • frequency - The settings of Pulse Width Modulation on the specified ECU pin. It allows control of the power supplied to electrical devices by varying the duty cycle of a digital (on/off) pulse train. The available range of PWM frequency is [0-50KHz].

  • level - The settings of Pulse Width Modulation on the specified ECU pin. It allows control of the power supplied to electrical devices by varying the duty cycle of a digital (on/off) pulse train. The available range of PWM level is [0-27V].

  • precision_duty - The precision value in percentage for the duty cycle. Default is 3.0. This parameter is optional.

  • precision_frequency - The precision value in percentage for the frequency. Default is 1.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the PWM to reach the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Set Pin PWM Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set PWM of the pin
  ${pin} =  Set Pin PWM   LRIO    X1.12     ${100}      ${30}   ${15}
  Should Be Equal   ${pin}[duty]       ${100}
  Should Be Equal   ${pin}[frequency]  ${30}
  Should Be Equal   ${pin}[level]      ${15}

User can't set PWM because the ECU doesn't exist
  TRY
    Set Pin PWM   ${Empty}    X1.12     ${100}      ${30}   ${15}
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't set PWM because the pin doesn't exist
  TRY
    Set Pin PWM   LRIO    ${Empty}     ${100}      ${30}   ${15}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can't set PWM duty because the value is more than max
  TRY
    Set Pin PWM   LRIO    X1.12     ${150}      ${30}   ${15}
  EXCEPT  The requested PWM duty value '150' is out of the range '0-100%'.
    Should Be True  ${True}
  END

User can't set PWM duty because the value is less than min
  TRY
    Set Pin PWM   LRIO    X1.12     ${-50}      ${30}   ${15}
  EXCEPT  The requested PWM duty value '-50' is out of the range '0-100%'.
    Should Be True  ${True}
  END

User can't set PWM frequency because the value is more than max
  TRY
    Set Pin PWM   LRIO    X1.12     ${100}      ${60}   ${15}
  EXCEPT  The requested PWM frequency value '60' is out of the range '0-50KHz'.
    Should Be True  ${True}
  END

User can't set PWM frequency because the value is less than min
  TRY
    Set Pin PWM   LRIO    X1.12     ${100}      ${-30}  ${15}
  EXCEPT  The requested PWM frequency value '-30' is out of the range '0-50KHz'.
    Should Be True  ${True}
  END

User can't set PWM level because the value is more than max
  TRY
    Set Pin PWM   LRIO    X1.12     ${100}      ${30}   ${45}
  EXCEPT  The requested PWM level value '45' is out of the range '0-27V'.
    Should Be True  ${True}
  END

User can't set PWM level because the value is less than min
  TRY
    Set Pin PWM   LRIO    X1.12     ${100}      ${30}   ${-5}
  EXCEPT  The requested PWM level value '-5' is out of the range '0-27V'.
    Should Be True  ${True}
  END

User can set PWM with precision and timeout
  ${pin} =  Set Pin PWM   LRIO    X1.12     ${100}      ${30}   ${15}  ${3.0}  ${1.0}  ${1.0}  RELRANGE
  Should Be Equal   ${pin}[duty]       ${100}
  Should Be Equal   ${pin}[frequency]  ${30}
  Should Be Equal   ${pin}[level]      ${15}

The following exceptions may occur when Set Pin PWM Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

  • The value of specified PWM is out of predefined range [duty: 0-100, frequency: 0-50KHz, level: 0-27V].

2.4.7. Get Pin Current Keyword

Get Pin Current Keyword returns a scalar value in A which corresponds to the current on a specified ECU pin. The possible range of current is 0-11A. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Get Pin Current Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • current - The value of current in A which will be compared on the specified ECU pin. If the measured current isn’t equal to the specified value, a Failure is raised. The available range of current is 0-11A. This parameter is optional; if omitted, the keyword returns the current value.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 3.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the current to reach the specified value. Default is 1.0 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Get Pin Current Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get current of the pin
  ${pin_current} =  Get Pin Current   LRIO    X1.11
  Should Be Equal   ${pin_current}    ${5}

User can't get current because the ECU doesn't exist
  TRY
    Get Pin Current    ${Empty}    X1.11
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get current because the pin doesn't exist
  TRY
    Get Pin Current    LRIO    ${Empty}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can validate the current of the pin
  ${pin_current} =  Get Pin Current   LRIO    X1.11  ${TestCurrentA}  ${PrecisionPercent}  ${Timeout_s}

The following exceptions may occur when Get Pin Current Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.4.8. Set Pin Current Keyword

Set Pin Current Keyword sets the current of a specified ECU pin to a new value. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Set Pin Current Keyword is next:

  • ecu_name - The unique name of ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of Pin in format {identifier of electrical connector}.{number of pin in specified connector} in scope of specified ECU. For example, it could be X1.11 this means the electrical connector is X1 and the number of Pin is 11.

  • current - The value of current in A which will be set on the specified ECU pin. The available range of current is 0-11A.

  • precision - The precision value in percentage or absolute value depending on the precision mode. Default is 3.0. This parameter is optional.

  • timeout_s - The timeout in seconds to wait for the current to reach the specified value. Default is 0.01 seconds. This parameter is optional.

  • precision_mode - The mode of precision comparison. It can be one of the following:

    • RELRANGE - Relative range precision.

    • RELVALUE - Relative value precision.

    • ABSVALUE - Absolute value precision. Default is RELRANGE. This parameter is optional.

The example of using Set Pin Current Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set current on the pin
  ${pin} =  Set Pin Current   LRIO    X1.12   ${5}
  Should Be Equal   ${pin}[current]    ${5}

User can't set current because the value is more than max
  TRY
    Set Pin Current   LRIO    X1.12   ${25}
  EXCEPT  The requested current value '25' is out of the range '0-11A'.
    Should Be True  ${True}
  END

User can't set current because the value is less than min
  TRY
    Set Pin Current   LRIO    X1.12   ${-5}
  EXCEPT  The requested current value '-5' is out of the range '0-11A'.
    Should Be True  ${True}
  END

User can't set current because the ECU doesn't exist
  TRY
    Set Pin Current   ${Empty}  X1.12  ${5}
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't set current because the pin doesn't exist
  TRY
    Set Pin Current   LRIO  ${Empty}  ${5}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

User can set current with precision and timeout
  ${pin} =  Set Pin Current   LRIO    X1.12   ${5}  ${3.0}  ${1.0}  RELRANGE
  Should Be Equal   ${pin}[current]    ${5}

The following exceptions may occur when Set Pin Current Keyword is calling:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

  • The requested current value {current} is out of the range 0-11A.

2.4.9. Get Pin Din Keyword

Get Pin Din Keyword returns the digital input state of a specified ECU pin. The possible states are 1 or 0. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Get Pin Din Keyword is:

  • ecu_name - The unique name of the ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of the Pin in the format {identifier of electrical connector}.{number of pin in specified connector} in the scope of the specified ECU. For example, it could be X1.11, meaning the electrical connector is X1 and the number of the pin is 11.

Example usage of Get Pin Din Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get digital input state of the pin
  ${pin_din} =  Get Pin Din   LRIO    X1.11
  Should Be Equal   ${pin_din}    1

User can't get digital input state because the ECU doesn't exist
  TRY
    Get Pin Din    ${Empty}    X1.11
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't get digital input state because the pin doesn't exist
  TRY
    Get Pin Din    LRIO    ${Empty}
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

Exceptions that may occur when calling Get Pin Din Keyword:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.4.10. Set Pin Dout Keyword

Set Pin Dout Keyword sets the digital output state of a specified ECU pin to a new value. The possible states are 1 or 0. It fails if either the given ECU or pin name does not exist within the current test environment.

The set of arguments and their order when calling Set Pin Dout Keyword is:

  • ecu_name - The unique name of the ECU within the test environment. For example, it could be LftReEcu or LRIO.

  • pin_name - The unique name of the Pin in the format {identifier of electrical connector}.{number of pin in specified connector} in the scope of the specified ECU. For example, it could be X1.11, meaning the electrical connector is X1 and the number of the pin is 11.

  • state - The digital output state to set on the specified ECU pin. The possible states are 1 or 0.

Example usage of Set Pin Dout Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set digital output state on the pin
  ${pin} =  Set Pin Dout   LRIO    X1.12   1
  Should Be Equal   ${pin}    1

User can't set digital output state because the ECU doesn't exist
  TRY
    Set Pin Dout   ${Empty}    X1.12     1
  EXCEPT  The ECU '' doesn't exist within the XIL Test Environment.
    Should Be True  ${True}
  END

User can't set digital output state because the pin doesn't exist
  TRY
    Set Pin Dout   LRIO    ${Empty}     1
  EXCEPT  The pin '' of the specified ECU 'LRIO' doesn't exist.
    Should Be True  ${True}
  END

Exceptions that may occur when calling Set Pin Dout Keyword:

  • The ECU {ecu_name} doesn’t exist within the XIL Test Environment.

  • The pin {pin_name} of the specified ECU {ecu_name} doesn’t exist.

2.5. Interacting with Simulation Models

2.5.1. Simulation Model Object

Simulation Model Object in the scope of a test scenario is a representation of an simulation model software component that is deployed and running within the configured test environment. This software component imitates an edge device that is sensed or actuated by control software running on ECUs. Using specific keywords, you can retrieve Simulation Model Object, change its parameters, and apply these changes back to the test environment. This object then allows you to interact with and manipulate the actual simulation model software component running in the test environment. This object has the following set of parameters:

  • simulation_model_name - The unique name of an simulation model software component within the test environment. The name consists of two parts - the simulation model template name which is specified in its specification file and the identifier of the simulation model instance which is defined when the simulation model is instantiated within a specific test environment. The following rules are used in simulation model name composition:

    • When the simulation model template has multiple_instances = 'yes', you must specify both identifiers in the simulation model’s name. For example, if the identifier of the simulation model template is CrashSensImt and there are two instances of this simulation model within the test environment - RearSensor and FrontSensor, the full names of these instances will be CrashSensImt/RearSensor and CrashSensImt/FrontSensor respectively.

    • When the Simulation Model template has multiple_instances = 'no', you can specify only the identifier of the template to identify the simulation model instance within the Test Environment. For example, if the identifier of the simulation model template is MbsmImt and this simulation model can be instantiated only once, you can specify only MbsmImt as the simulation model’s name to get the instance.

  • template_name - The simulation model template name which is specified in its specification file.

  • instance_name - The identifier of the simulation model instance which is defined when the simulation model is instantiated within a specific test environment.

An simulation model software component can have a set of sender/receiver ports which are used to communicate with other software components via CAN networks. All its receiver ports marked with the flag is_handle='yes' will be translated into parameters of the corresponding Simulation Model Object, and you will be able to modify them from a test scenario. All simulation model’s sender ports marked with the flag is_handle='yes' will also be translated into parameters of the corresponding Simulation Model Object, but you can’t modify these parameters from the test scenario; otherwise, you will get an error when you try to apply these changes. You can only get values of such parameters and use them within the test scenario. In cases where receiver ports marked with the flag is_handle='yes' have the payload as a CAN message, such ports will be translated into parameters of type dictionary object, where all parameters of this dictionary are based on internal signals of this message.

2.5.2. Get Simulation Model Keyword

Get Simulation Model Keyword gets a specific simulation model software component instance which is running within a test environment as Simulation Model Object to the test scenario context. It fails unless the given simulation model name exists within the test environment.

The set of argruments and and their order when calling Get Simulation Model Keyword is next:

  • simulation_model_name - The unique name of a simulation model software component within a test environment where this simulation model is deployed and running.

Let’s consider the example of Crash Sensor Simulation Model which was instantiated twice within the test environment:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get specific instance of simulation model
    ${front_crash_sens} =   Get simulation model    CrashSensImt/FrontSensor
    Should Be Equal     ${front_crash_sens}[template_name]    CrashSensImt
    Should Be Equal     ${front_crash_sens}[instance_name]    FrontSensor

Let’s consider another example with MBMS Simulation Model which was instantiated only once:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can get the imitatir by short name 
    ${mbms_simulation model} =      Get Simulation Model    MbmsImt
    Should Be Equal     ${mbms_simulation model}[template_name]    MbmsImt
    Should Be Equal     ${mbms_simulation model}[instance_name]    MbmsImt

User can't get the simulation model because it doesn't exist
    TRY
        Get Simulation Model    ${Empty}
    EXCEPT  The simulation model '' doesn't exist within the XIL Test Environment.
        Should Be True  ${True}
    END

2.5.3. Apply Simulation Model Keyword

Apply Simulation Model Keyword restarts the execution of a specified simulation model software component with new input parameters. In other words, in a test scenario, you can modify the Simulation Model Object which represents the running simulation model, and then apply these changes to the test environment. As a result, the simulation model will be reinvoked with the new input parameters.

The set of argruments and and their order when calling Apply Simulation Model Keyword is next:

  • simulation model - The Simulation Model Object in the context of test scenario which corresponds to a simulation model software component within the current test environment where this simulation model is deployed and running.

The example of using Apply Simulation Model Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can modify the simulation model and applay these changes
    ${stalks_imt1} =     Get Simulation Model    StrWhlStalksImt
    ${stalks_imt1}[HandleLftStalkAction] =       Set Variable  Wiper_Full_Push
    ${stalks_imt1}[HmiReq1][GS_Req] =            Set Variable  Park
    ${stalks_imt1}[FaultInjection][Fault_4] =    Set Variable  ${True}
    ${stalks_imt2} =    Apply Simulation Model  ${stalks_imt1}
    Should Be Equal     ${stalks_imt2}[HandleLftStalkAction]        Wiper_Full_Push
    Should Be Equal     ${stalks_imt2}[HmiReq1][GS_Req]             Park
    Should Be Equal     ${stalks_imt2}[FaultInjection][Fault_4]     ${True}

User can't modify the simulation model because wrong parameters
    ${stalks_imt3} =    Get Simulation Model    StrWhlStalksImt
    ${stalks_imt3}[CrashEvt] =  Set Variable  ${True}
    TRY
        Apply Simulation Model  ${stalks_imt3}
    EXCEPT  The simulation model 'StrWhlStalksImt' doesn't have the specified parameter 'CrashEvt'.
        Should Be True  ${True}
    END

In this scenario the simulation model will be newly invoked with two new parameters HandleLftStalkAction = 'Wiper_Full_Push', HmiReq1['GS_Req'] = 'Park' and FaultInjection['Fault_4'] = True.

2.5.4. Set Simulation Model Value Keyword

Set Simulation Model Value Keyword is used to set only one parameter of a specified simulation model to a new value and then reinvoke the simulation model with this modified parameter in the current test environment.

The set of argruments and and their order when calling Set Simulation Model Value Keyword is next:

  • simulation_model_name - The unique name of a simulation model software component within a test environment where this simulation model is deployed and running.

  • param_name - The unique name of the simulation model’s parameter

  • param_value - The new value of the parameter with which the simulation model will be invoked immediately after execution of the keyword. All other parameters will be set to default values.

The example of using Set Simulation Model Value Keyword:

*** Settings ***
Library    lib/SodaKeywordsLibrary.py

*** Test Cases ***
User can set value for simulation model's parameter 
    ${front_crash_sens} =   Set Simulation Model Value  CrashSensImt/FrontSensor    CrashEvt    ${True}
    Should Be Equal   ${front_crash_sens}[CrashEvt]   ${True}

User can't set value for simulation model's parameter because it doesn't exist
    TRY
        ${front_crash_sens} =   Set Simulation Model Value  CrashSensImt/FrontSensor    HandleLftStalkAction    Wiper_Full_Push
    EXCEPT  The simulation model 'CrashSensImt/FrontSensor' doesn't have the specified parameter 'HandleLftStalkAction'.
        Should Be True  ${True}
    END

User can't set value for simulation model's parameter because the simulation model doesn't exist
    TRY
        ${front_crash_sens} =   Set Simulation Model Value  ${Empty}    CrashEvt    ${True}
    EXCEPT  The simulation model '' doesn't exist within the XIL Test Environment.
        Should Be True  ${True}
    END

The following exceptions may occur when Set Simulation Model Value Keyword is calling:

  • The simulation model {simulation_model_name} doesn’t exist within the XIL Test Environment.

  • The simulation model doesn’t have specified parameter.