Simulating a Truth Table
When the model is simulated and active breakpoints are inserted into the truth table, a read-only matrix of the truth table is started. From this table you can view the execution of each element in the table. When a step or microstep is started, depending on the truth table implementation, the “fired” row in the truth table is highlighted for one step.
Input and output logic from a truth table is included in the simulation when the model includes a truth table in its scope. Truth table inputs and outputs are Rational Statemate elements, therefore input values can be set and output values examined using Simulation debugging tools such as Monitors, the Examine command and the DoAction command.
The following sections describe how to insert a breakpoint into a truth table and simulate it.
Note: For additional information on Truth Tables, refer to the Rational Statemate User Guide.For the purpose of this discussion, we use the Statechart shown below as an example.This Statechart operates as follows:
●
●
●The actual logic that implements this functionality is contained in the truth table which implements the function
CALC1
.The elements for this Statechart need to be defined in the Data Dictionary as follows:
1.
2. DefineCALC1
as a subroutine
3. DefineE1
as an event
4.After defining the elements in the Data Dictionary for the sample Statechart, execute the Data Dictionary page for
CALC1
.You can see in the Data Dictionary page above for the function CALC1, how the parameter table is filled. Note that the order of the parameters in the Statechart matches those in the parameter list. When these actual model parameters match with the formal parameters in the parameter list,
VAL_IN
is passed toX_DATA
,VAL_OUT
is passed toY_DATA
and the conditionC2
is passed to multiply-by-two,C5
is passed to multiply-by-5, etc.Note: The Select Implementation is set to Truth TableTo complete this exercise, construct the Truth Table shown above. For additional information on Truth Tables, refer to the Rational Statemate User Guide.