6. Creating Antecedents

The first step in creating a rule is to create the antecedents of the rule. Complete the following steps to create the 'Temperature' IS 'Cold' and 'Humidity' IS 'Dry' antecedents.

  1. Add the FL Create Antecedent VI to the block diagram. This VI creates an antecedent, or IF portion, of a rule for a fuzzy system.
  2. Create constants for the variable index and membership function index inputs of the FL Create Antecedent VI and set them both to 0. These inputs specify that you want to associate the Temperature input linguistic variable with the Cold membership function.
  3. Create a constant for the condition input of the FL Create Antecedent VI.
  4. Select = from the condition constant to calculate the degree of membership of the linguistic variable within the membership function. FL Create Antecedent VI now creates the 'Temperature' IS 'Cold' antecedent.
  5. Repeat steps 1 through 4 to create the 'Humidity' IS 'Dry' antecedent. In the greenhouse fuzzy system, Dry is the first membership function of the second input linguistic variable, so use 1 as the variable index and 0 as the membership function index.
  6. Add a Build Array function to the block diagram.
  7. Resize the Build Array function to display two input elements.
  8. Wire the antecedent output of the first FL Create Antecedent VI to the first element input of the Build Array function.
  9. Wire the antecedent output of the second FL Create Antecedent VI to the second element input of the Build Array function. The section of block diagram you just created resembles the following image:

  10. Save the VI.
Previous
5. Modifying a Rule
Home
Tutorial: Modifying a Fuzzy System with the Fuzzy Logic VIs
Next
7. Creating Consequents