.

Bit Input

Overview

Overview

Description

The Bit Input block is used for discrete bit inputs from internal firmware variables. Any internal variable on the controller can be used as a MechaWare bit input using the Bit Input block.

The Memory Address defines the input internal variable location. The data type of the internal variable can be float (32 bits), double (64 bits), short integer (16 bits), integer (32 bits), and long integer (64 bits).

The Bit Number defines which bit should be used for the input. Bit 0 is always the LSB for the input. The MSB depends on the word type: 15 for short integer, 31 for float and integer, and 63 for double and long integer.

Note: The Output is a double-precision floating point value, represented strictly as either 0.0 or 1.0 (effectively right justifying the extracted bit).

The input is written at the update rate specified by the Evaluate Block.

Example

The following example uses the Bit Input block to read in a specific Digital IO ( Node 1, Bit 2), the Digital Bit triggers a Latch which is fed to a pulse generator. The Pulse triggers the Clear Position command. The UserBuffer[0] is used to monitor the state of the Latch Output.

The Bit Input is used to input Motor IO, however it can be used to pull any bit from any controller memory address.

The configuration values for this block are as follows:

 

Memory Address

Bit Input Address. Defines location of the internal input variable. Format is Hexadecimal.

Bit Number

Bit to be used as input. 0 is always the LSB. The MSB depends on the input type (15, 31, or 63. see Data Type).

Data Type

Defines the data type of the internal variable memory being written to:

Float (32 bits)
Double (64 bits)
Short integer (16 bits)
Integer (32 bits)
Long integer (64 bits)

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

The Memory Address of the Bit Input specifies which memory location is read to obtain the input. The address is in hexadecimal format. Addresses for input variables is obtained by using VM3.

The Bit Number defines which bit should be used for the input. Bit 0 is always the LSB for the input. The MSB depends on the word type: 15 for short integer, 31 for float and integer, and 63 for double and long integer.

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

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

BIT_INPUTBlock

Declaration

Public Method

 
class BIT_INPUTBlock: public virtual Block
{
public:

	// User accessible coefficients
	long				BitNumber;
};
 

Required Header: mechaware.h

Description

The BIT_INPUT block is used for inputs other than those provided by the standard input blocks. Any internal variable on the controller can be used as a MechaWare input using the Bit Input block. See Overview for more information

Parameters

 
long BitNumber Bit Number of the input.

Methods

Block Methods

See Also

Bit Output | IO Input

 

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