.

Relation

Overview

Overview

The Relation block performs the specified comparison operation on two inputs. The relational comparision operations are >, >=, ~=, <=, and <. The output of the block is 1 (TRUE) when the comparison is true, and it is 0 (FALSE) when the comparison is false.

Example

The following example shows how to do simple math on two data values located in UserBuffer[0] and UserBuffer[1], and output the operation to UserBuffer[2]. The Manual Switch determines which calculation to output to the user buffer; either the Binary Operation, or standard math comparison.

Notice the Relation checks to see if Input0 = Input1.


The configuration values for this block are as follows:

 
Operation Options: >, >=, ~=, <=, or <.
Evaluate Block This block allows you to specify whether the block executes Every Sample, Every Other Sample (Odd or Even), or Every Fourth Sample (and specify the First, Second, Third, or Fourth) or background. This provides greater flexibility in controlling the execution of a model and to preserve performance for other areas of motion control.
User Defined Block Priority When selected, allows you to enter a Priority Code to modify Execution Ordering of this block. For more information, see Block Execution Order and User Defined Block Priority.
User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

Matlab/Simulink

Simulink Interface

bin_img1

The Output is a 1 (TRUE) when the relation comparison is true, and the output is 0 (FALSE) when the relation comparison is false.

The op parameter determines the relational comparison:

0 > (Greater than)
1 >= (Greater than or equal to)
2 == (equal to)
3 =~ (not equal to)
4 <= (less than)
5 < (less than or equal to)

The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details.

The block's update schedule is determined by the Evaluate Block. The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:

C++ API

ROLBlock

Declaration

Public Method

 
class ROLBlock: public virtual Block    
{ 
public:
	// User accessible coefficients
     long	Op;
};
  Required Header: mechaware.h

Description

The Relation block performs the specified comparison operation on two inputs. The relational comparision operations are >, >=, ==, ~=, <=, and <. The output of the block is 1 (TRUE) when the comparison is true, and it is 0 (FALSE) when the comparison is false.

 
long Op

Operation Code:

0 is >
1 is >=
2 is ==
3 is ~=
4 is <=
5 is <

Methods

Block Methods

See Also

Binary Relation
Compare

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2012 Motion Engineering