Programmable Controllers

Programmable Logic Controllers

Pico Controllers

PicoGFX Memory Functions

Data Block Comparator for Pico GFX

Data Block Comparator for Pico GFX
Symbol in the function
block diagram

The devices provide 32 data block comparators (Block Compare BC01...BC32 for comparing values of two contiguous marker ranges. The comparison is carried out bytewise. The following marker types can be compared:

The reference data block starts at the source address specified at the I1 input. This is compared with a data block that starts at the destination address specified at I2. You can carry out a comparison with or without an offset. The NO input is used to specify the size of the data block (number of elements) in bytes. A constant value at the inputs I1 or I2 is taken as the offset to the marker byte MB01.

Example: A value 0 at input I1 means that the reference data block for the comparison starts at MB01. A value “10” at I2 means that the destination data block for the comparison starts at MB11.

Comparison without offset

If you enter marker operands (MB.., MW.., MD.., 1MB..#, 1MW..#, 1MD..#) as parameters at the inputs I1 or I2, their absolute address is used. Entering I1=MB10, I2=MB90 and NO=4 will compare the content of marker bytes MB10 to MB14 with the marker bytes in the range from MB90 to MB94. In this way it is also possible to compare a data block of the local marker range (MBxx) with a data block in the remote marker range (1MBxx#).

# Only with a Pico GFX device with an active COM connection.

When using constant values at the inputs I1 or I2, only the data blocks within the local marker ranges are compared.

Comparison with offset

If you use one of the operands listed below, such as a constant, a QV function block output or one of the analog inputs at inputs I1 or I2, its value is processed as an offset to marker byte MB01.

If the comparison of two data blocks finds that there is no difference between them, the Boolean output EQ will be set to 1.

Parameter errors

Incorrect parameters are indicated whilst the program is running via the E1 - E3 error outputs. Parameter errors of this kind occur, for example, if the number of elements exceed the source or destination range, or when, due to an offset error, the source and destination range are outside of the available marker range.

Compare marker data blocks

I1MB 23
I2MB30
NONU 4

The Function Block and its Parameters

  Description Note
Function block inputs (DWord)    
I1 Source range; Value range: 32-bit  
I2 Target range; Value range: 32-bit  
NO Number of elements to be compared:
max. 192 bytes
 
Function block output    
-- -- --
Contact (bit output)    
E1 Error output

Status 1 if the number of elements exceeds the source or destination range.
The range limits are checked regardless of the edge change at the EN Boolean input.
E2 Error output

Status 1 if the source and destination range overlap.
The range limits are checked regardless of the edge change at the EN Boolean input.
E3 Error output

Status 1 if source and destination range are outside of the available marker range (offset error).
The range limits are checked regardless of the edge change at the EN Boolean input.
EQ Status 1 if the data ranges are identical.

Status 0 if the data ranges are not identical.
 
Coil function (bit output)    
EN Activates the function block on status 1.  
Parameter set    
Call enabled Function block parameters can be viewed on the device.  
Simulation    
Possible    

Memory Requirement

The Block Compare function block requires 48 bytes of memory plus 4 bytes for each function block input that is configured with an NU constant.