beautypg.com

Vendor provided function blocks, Comparison (cmp) – Watlow LogicPro User Manual

Page 174

background image

Chapter 10: Function Blocks

LogicPro User’s Guide

158

Watlow Anafaze

Doc.# 28002-00 Rev 3.00

Vendor Provided Function Blocks

This section provides information and examples of vendor
provided function blocks.

In this section, the terms

symbol 1, symbol 2,

and

symbol

3

are used. These terms refer to the labels shown within each

of the function blocks as shown in Figure 10.39.

Figure 10.39 Vendor Provided Function Block

diagram

Vendor provided comparison and calculation functions offer
an alternate format and other options not found in standard
function blocks.

Comparison (CMP)

symbol1 = CMP

The comparison function block (CMP) is designed to test
quantitative relationships between two specified inputs, A and
B, and report the finding in the output bit (Q). See Figure
10.40 on page 159
.

symbol2 = W or L

The Variables A and B need to be declared as

INT

type or

LONG

integer type, of size specified in this symbol. Two

memory sizes are available for these integers, word-length W
(16-bit) and long-word L (32-bit). Pulse-types are not
available.

symbol3 = comparison

In the CMP function block, this symbol specifies the type of
comparison to be made and takes on one value from the set of
{ = (equal), <> (not equal), > (greater than), >= (greater or
equal), < (less than), <= (less than or equal)}. For example, the
function block would compute the comparison

A <= B

and enable the output bit Q, if B is greater or equal to A, and
disable Q if B is less than A. Similarly, the comparison A<>B
would enable Q if A does not equal B, while disable Q if A did
equal B.

Symbol 1

Symbol 2

Symbol 3