test bench verification -凯发k8网页登录

main content

test bench verification

the simulink® plc coder™ software simulates your model and captures the input and output signals for a subsystem. the captured input and output signal data is the test bench data. you can generate a test bench or test harness by using the test bench data. see .

you can verify that the output of the generated code is numerically and functionally equivalent to the output of the simulink model by using the generated test bench. this table shows the error tolerance for the different data types. the comparison is between the outputs of the generated code (expected values) and outputs of the model (actual values).

data typecomparisonerror tolerance
integerabsolute0
booleanabsolute0
singlerelative0.0001
doublerelative0.00001

the relative tolerance comparison for single or double data types uses this logic:

if abs(actual_value - expected_value) > (error_tolerance * expected_value) then
		testverify := false;
end_if; 

to verify the generated code by using the test bench, import the generated structured text and the test bench data into your target ide. you can import test bench code either manually or automatically. see import and verify structured text code.

simulink plc coder does not support testbench generation for models that use configuration set references. to generate a testbench create a new configuration set, change the configuration to match your requirements, and then generate code. to manage configuration sets, see .

related topics

网站地图