.

Binary Relation

Overview

Overview

Description

The Binary Relation block performs the specified logical (bitwise) operation on two inputs. The logical operations are AND, OR, NOT-AND (NAND), Negative OR (NOR), and Exclusive OR (XOR).

Example

The following example shows how to do simple math on two data values located in UserBuffer[0] and UserBuffer[1], then 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.

Note the Binary Relation block is performing a Binary AND (&) operation and outputting Input0 && Input1.


The configuration values  for this block are as follows:

 
Operation

Options: AND, OR, NAND, NOR, or XOR.

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.
Priority For an explanation of how the Priority field is used by the MechaWare Model Downloader, 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 calculated by casting the inputs to 32-bit unsigned integers and performaing the specified logical operation

The op parameter determines the operation:

0 AND
1 OR
2 NAND
3 NOR
4 XOR

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:

bin_img2

 

 

C++ API

BROLBlock

Declaration

Public Method

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

The Binary Relation block performs the specified logical (bitwise) operation on two inputs. The logical operations are AND, OR, Negative AND (NAND), Negative OR (NOR), and Exclusive OR (XOR)

 
long Op

Operation Code: 0 = AND, 1 = OR, 2 = NAND, 3 = NOR, 4 = XOR.

See Also

Compare | Relation

 

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