.

Memory Out

Overview

Overview

The Memory Out block is used to output a MechaWare block’s output to an internal memory location, other than those provided by the standard blocks. Any internal variable on the controller can be written to by the MemoryOut block.

The Memory Address defines the internal variable memory location that will be written to by this block. The data type of the internal variable that is written to can be float (32 bits), double (64 bits), integer (32 bits) or a Long integer (64 bits).

Example

In the following example, the Velocity Erroris 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 the difference must be accounted for in units.

The Memory Out is configured to write to the UserBuffer[0] location directly, by referencing memory location 0xECE54 (in this example, MPI 03.04.14 was used to get this location).  After the subtraction operation, multiply the value by the sample rate to obtain Counts of Error/Second.


The configuration values for this block are as follows:

 
Memory Address

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

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

output_sim1

The Memory Address of the MemoryOut block specifies which memory location the block is writing to. The address is in hexadecimal format. Addresses for output variables can be obtained using VM3.

Data Type defines the type data type of the internal variable being written to by the block.

0 = float (32 bits)
1 = double (64 bits)
2 = short integer (16 bits)
3 = integer (32 bits)
4 = long integer (64 bits)

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:

output_sim2

 

 

C++ API

MEMOUTBlock

Declaration

Public Method

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

Description

The MEMOUT block is used to output to memory locations other than those provided by the standard output blocks. Any internal variable on the controller can be written to using the MEMOUT block. See the Overview for details.

Parameters

 
long Address

Memory Address of the internal variable being written to.

long DataType

Data type of the internal variable being written to.

Methods

Block Methods

See Also

Memory
Torque Output
Noise Generator MemoryOut
Actual Position Memory Out User Buffer
Command Position Scope
Position Error Feedback
Memory User Buffer Reset Status
Command Acceleration Test In
Command Velocity Test Out

 

 

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