# US 2017/0286270 A1 · Method for testing a control program of a control device in a simulation environment on a computer

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286270 A1
- Document ID: US20170286270A1
- Status: Published application
- Kind: A1
- Application number: 15/474,060
- Filed: 2017-03-30
- Published: 2017-10-05
- Earliest claimed: 2016-03-31
- Assignees: dSPACE digital signal processing and control engineering GmbH
- Applicants: dSPACE digital signal processing and control engineering GmbH
- Inventors: Thorsten Hufnagel
- Web page: https://patentgrep.com/patent/US20170286270A1

## CPC

- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 11/261: {by simulating additional hardware, e.g. fault simulation}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 30/20: Design optimisation, verification or simulation (optimisation, verification or simulation of circuit designs G06F30/30)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Method for monitoring errors when testing a control program (10) of a control device in a simulation environment (40), the control program (10) being executed by an emulator on a computer, the emulator assigning an extended range of items (50, 60, 70) to program variables of the control program (10), a variable value (52, 62, 72) allocated to a program variable being stored in the extended range of items (50, 60, 70), the emulator marking program variables as erroneous or non-erroneous, the marking being carried out on the basis of an assignment of non-erroneous program variables to a first category (K1) and of erroneous program variables to a second category (K2), the extended range of items (60) of each program variable in the second category (K2) having a data field (64), or the marking being carried out on the basis of an error field (76) stored in the extended range of items (70), a validity value being allocated to the error field (76) of a non-erroneous program variable and an error value being allocated to the error field (76) of an erroneous program variable, the extended range of items (70) of each program variable having a data field (74).

## Claims

### Claim at position 1

1-6. (canceled)

### Claim 7

A method for monitoring errors when testing a control program of a control device in a simulation environment on a computer, the method comprising:
generating the simulation environment on the computer,
executing the control program with an emulator executed on the computer,
wherein the emulator is emulating at least one part of an emulated control device having an emulated processor and an emulated memory area, and the emulator having an interface for inputting and outputting data,
writing environmental values from the simulation environment to the emulated memory area via the interface,
the control program having one or more program variables,
allocating one or more variable values to the one or more program variables by the control program during execution of the control program,
wherein the allocated variable value is determined by accessing a memory address of the emulated memory area,
assigning an extended range of items to the one or more program variables of the control program via the emulator,
wherein the allocated variable value is stored in the extended range of items,
marking the one or more program variables as erroneous or non-erroneous via the emulator,
wherein the marking is carried out on the basis of an assignment of non-erroneous program variables to a first category and of an assignment erroneous program variables to a second category, the extended range of items of each program variable in the second category having a data field, or
the marking is carried out on the basis of an error field stored in the extended range of items, a first predetermined numerical or non-numerical validity value being allocated to the error field of a non-erroneous program variable and a first predetermined numerical or non-numerical error value being allocated to the error field of an erroneous program variable, and the extended range of items of each program variable having a data field,
wherein the marking is carried out when determining a variable value,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a first memory address which is present and has been written to in the emulated memory area or accesses a second program variable, the second program variable being assigned to the first category or having an error field with a first validity value,
the program variable is marked as non-erroneous, and
the determined variable value is stored in the extended range of items,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a second memory address which is not present or has not been written to in the emulated memory area or accesses a third program variable, the third program variable being assigned to the second category or having an error field with a first error value,
the first program variable is marked as erroneous,
a predetermined numerical or non-numerical second error value is allocated to the variable value of the first program variable and
the second memory address which is not present or has not been written to or a copy of all entries in the data field of the third program variable is written to the data field of the first program variable.

### Claim 8 (depends on 7)

The method as claimed in claim 7, wherein, when determining a variable value of a first program variable by accessing a second program variable which is assigned to the second category or has an error field with a first error value, an identifier of the second program variable is written to the data field of the first program variable.

### Claim 9 (depends on 7)

The method as claimed in claim 7, wherein, if the control program allocates a predefined value to a first program variable which is assigned to the second category or has an error field with a first error value,
marking the first program variable as non-erroneous,
storing the predefined value as the variable value in the extended range of items of the program variable,
deleting the data field from the extended range of items in the case of marking on the basis of an assignment to a first category or a second category, and
deleting all entries in the data field in the case of marking on the basis of an error field.

### Claim 10 (depends on 7)

The method as claimed in claim 7, wherein, if the control program has at least two program blocks, the program blocks being alternatively executed according to a conditional branching rule of the control program on the basis of a condition and the condition depending on a first program variable which is assigned to the second category or has an error field with a first error value, all program blocks are executed.

### Claim 11 (depends on 10)

The method as claimed in claim 10, wherein each further program variable which is allocated a value during execution of the program blocks is marked as erroneous, a copy of all entries in the data field of the first program variable respectively being written to the data field of the further program variable, and the second error value respectively being allocated to the variable value of the further program variable.

### Claim 12 (depends on 10)

The method as claimed in claim 10, wherein, after executing the program blocks for each further program variable to which the control program allocates a variable value both during execution of the first program block and during execution of a further program block, the allocated variable values are compared, in which case, in the event of a difference between the allocated variable values,
marking the further program variable as erroneous,
allocating the second error value to the variable value of the further program variable, and
writing a copy of all entries in the data field of the first program variable to the data field of the further program variable.

### Claim 13 (depends on 8)

The method as claimed in claim 8, wherein, if the control program allocates a predefined value to a first program variable which is assigned to the second category or has an error field with a first error value,
marking the first program variable as non-erroneous,
storing the predefined value as the variable value in the extended range of items of the program variable,
deleting the data field from the extended range of items in the case of marking on the basis of an assignment to a first category or a second category, and
deleting all entries in the data field in the case of marking on the basis of an error field.

### Claim 14 (depends on 8)

The method as claimed in claim 8, wherein, if the control program has at least two program blocks, the program blocks being alternatively executed according to a conditional branching rule of the control program on the basis of a condition and the condition depending on a first program variable which is assigned to the second category or has an error field with a first error value, all program blocks are executed.

### Claim 15 (depends on 9)

The method as claimed in claim 9, wherein, if the control program has at least two program blocks, the program blocks being alternatively executed according to a conditional branching rule of the control program on the basis of a condition and the condition depending on a first program variable which is assigned to the second category or has an error field with a first error value, all program blocks are executed.

### Claim 16 (depends on 14)

The method as claimed in claim 14, wherein each further program variable which is allocated a value during execution of the program blocks is marked as erroneous, a copy of all entries in the data field of the first program variable respectively being written to the data field of the further program variable, and the second error value respectively being allocated to the variable value of the further program variable.

### Claim 17 (depends on 15)

The method as claimed in claim 15, wherein each further program variable which is allocated a value during execution of the program blocks is marked as erroneous, a copy of all entries in the data field of the first program variable respectively being written to the data field of the further program variable, and the second error value respectively being allocated to the variable value of the further program variable.

### Claim 18 (depends on 14)

The method as claimed in claim 14, wherein, after executing the program blocks for each further program variable to which the control program allocates a variable value both during execution of the first program block and during execution of a further program block, the allocated variable values are compared, in which case, in the event of a difference between the allocated variable values,
marking the further program variable as erroneous,
allocating the second error value to the variable value of the further program variable, and
writing a copy of all entries in the data field of the first program variable to the data field of the further program variable.

### Claim 19 (depends on 15)

The method as claimed in claim 15, wherein, after executing the program blocks for each further program variable to which the control program allocates a variable value both during execution of the first program block and during execution of a further program block, the allocated variable values are compared, in which case, in the event of a difference between the allocated variable values,
marking the further program variable as erroneous,
allocating the second error value to the variable value of the further program variable, and
writing a copy of all entries in the data field of the first program variable to the data field of the further program variable.

### Claim 20

A method for monitoring errors when testing a control program of a control device in a simulation environment on a computer, the method comprising:
generating the simulation environment on the computer,
executing the control program with an emulator executed on the computer,
wherein the emulator is emulating at least one part of an emulated control device having an emulated processor and an emulated memory area, and the emulator having an interface for inputting and outputting data,
writing environmental values from the simulation environment to the emulated memory area via the interface,
the control program having one or more program variables,
allocating one or more variable values to the one or more program variables by the control program during execution of the control program,
wherein the allocated variable value is determined by accessing a memory address of the emulated memory area,
assigning an extended range of items to the one or more program variables of the control program via the emulator,
wherein the allocated variable value is stored in the extended range of items,
marking the one or more program variables as erroneous or non-erroneous via the emulator,
wherein the marking is carried out on the basis of assigning program variables to categories,
wherein the marking is carried out when determining a variable value,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a first memory address which is present and has been written to in the emulated memory area or accesses a second program variable, the second program variable being assigned to a first category or having an error field with a first validity value,
the program variable is marked as non-erroneous, and
the determined variable value is stored in the extended range of items,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a second memory address which is not present or has not been written to in the emulated memory area or accesses a third program variable, the third program variable being assigned to a second category or having an error field with a first error value,
the first program variable is marked as erroneous,
a predetermined numerical or non-numerical second error value is allocated to the variable value of the first program variable and
the second memory address which is not present or has not been written to or a copy of all entries in the data field of the third program variable is written to the data field of the first program variable.

### Claim 21 (depends on 20)

The method as claimed in claim 20, wherein the marking that is carried out on the basis of assigning program variables to categories comprises assigning of non-erroneous program variables to a first category and of assigning erroneous program variables to a second category, the extended range of items of each program variable in the second category having a data field.

### Claim 22

A method for monitoring errors when testing a control program of a control device in a simulation environment on a computer, the method comprising:
generating the simulation environment on the computer,
executing the control program with an emulator executed on the computer,
wherein the emulator is emulating at least one part of an emulated control device having an emulated processor and an emulated memory area, and the emulator having an interface for inputting and outputting data,
writing environmental values from the simulation environment to the emulated memory area via the interface,
the control program having one or more program variables,
allocating one or more variable values to the one or more program variables by the control program during execution of the control program,
wherein the allocated variable value is determined by accessing a memory address of the emulated memory area,
assigning an extended range of items to the one or more program variables of the control program via the emulator,
wherein the allocated variable value is stored in the extended range of items,
marking the one or more program variables as erroneous or non-erroneous via the emulator,
wherein the marking is carried out on the basis of an error field stored in the extended range of items,
wherein the marking is carried out when determining a variable value,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a first memory address which is present and has been written to in the emulated memory area or accesses a second program variable, the second program variable being assigned to a first category or having an error field with a first validity value,
the program variable is marked as non-erroneous, and
the determined variable value is stored in the extended range of items,
wherein, when determining a variable value of a first program variable when the emulated processor accesses a second memory address which is not present or has not been written to in the emulated memory area or accesses a third program variable, the third program variable being assigned to a second category or having an error field with a first error value,
the first program variable is marked as erroneous,
a predetermined numerical or non-numerical second error value is allocated to the variable value of the first program variable and
the second memory address which is not present or has not been written to or a copy of all entries in the data field of the third program variable is written to the data field of the first program variable.

### Claim 23 (depends on 22)

The method as claimed in claim 22, wherein the marking that is carried out on the basis of an error field stored in the extended range of items comprises a first predetermined numerical or non-numerical validity value being allocated to the error field of a non-erroneous program variable, a first predetermined numerical or non-numerical error value being allocated to the error field of an erroneous program variable, wherein the extended range of items of each program variable has a data field.
