.

Latch

Overview

Overview

Description

The Latch block holds its Output value at the latest Input value depending on the value of the Latch input. If the Polarity configuration parameter is zero, the Output is held when the Latch input is zero and the output follows the Input if the Latch value is non-zero. If the Polarity parameter is non-zero the Output is held when Latch is non-zero and follows the Input when Latch is zero. The Latch is only updated 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),and the Digital Bit triggers a Latch which is sent to a pulse generator. The Pulse triggers the Clear Position command. The UserBuffer[0] is used to monitor the state of the Latch Output.

Latch saves the input state when the input Latch goes high. The output of the Latch block is the last saved state of the previous Latch. In this example, the Latch triggers any time the Node IO block goes high, or the Bit Input. However, the state that the latch triggers is always the state of the Bit Input.


The configuration values for this block are as follows:

 
Polarity Determines if latching occurs for zero (Polarity = 0) or non-zero (Polarity not equal to 0) values at the Latch input.

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). 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 Latch block holds its Output value at the latest Input value depending on the value of the Latch input. If the Polarity configuration parameter is zero, the Output is held when the Latch input is zero and the Output follows the Input if the Latch value is non-zero. If the Polarity parameter is non-zero, the Output is held when Latch is non-zero and follows the Input when Latch is zero.

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

LATCHBlock

Declaration

Public Method

 
class LATCHBlock: public virtual Block
{
public:
	// User accessible coefficients
	long Polarity;
}; 
 

Required Header: mechaware.h

Description

The Latch block holds its Output value at the latest Input value depending on the value of the Latch input.

long

POLARITY Determines if latching occurs for zero (Polarity = 0) or non-zero (Polarity not equal to 0) values at the Latch input.

Methods

Block Methods

 

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