.

Memory

Overview

Overview

Description

The Memory 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 Memory 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), integer (32 bits) and Long integer (64 bits).

Example

In the following example, the Velocity Error is calculated by Subtracting Actual Velocity from Commanded Velocity. The Feedback Velocity is returned as the first difference of the feedback and is measured in Encoder Counts per Sample. The Commanded Velocity is in Encoder Counts per Second and that difference must be accounted in units.

Note: A Memory block is used to read the controller’s actual Sample Rate. This example uses Memory Location 0x000A0058. The Sample period is stored in 0.1Hz to allow for fractional Sample Rates. The Gain block multiplies by 0.1 to bring the sample rate into Hz.


The configuration values for this block are as follows:

 
Memory Address

Defines location of the internal input variable. Format is Hexidecimal.

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

mem sim1

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

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:

mem sim2

Double-click on the Memory block to open the Block Parameters window.

 

 

C++ API

MEMORYBlock

Declaration

Public Method

 
class MEMORYBlock: public virtual Block
{
public:
	// User accessible coefficients
 	long Address;
	long DataType;
}; 
Required Header: mechaware.h

Description

The MEMORY 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 Memory block. See the Overview for details.

 
long Address

Memory Address of the input internal variable.

long DataType

Data type of the input internal variable.

Methods

Block Methods

See Also

MemoryOut
Memory Out User Buffer

 

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