Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 19 of 39

Series 90-30/20/Micro PLC CPU Instruction Set Reference Manual: Chapter 9 - Data Move Functions, pages 150 to 158

Pages 150 to 158 of 337, from Series 90-30/20/Micro PLC CPU Instruction Set Reference Manual

The original document is the PDF (4.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the GE Fanuc IC692CPU211D / IC692MDR541C, Fanuc IC692CPU211D / IC692MDR541C, GE IC692CPU211D / IC692MDR541C and GE Fanuc IC693CPU311X

Page 150

Chapter

Data Move Functions

9 Data move functions provide basic data move capabilities. This chapter describes the following data move functions:

GFK-0467M

Abbreviation

Function

Description

Page

MOVE

Move

Copy data as individual bits. The maximum length allowed is 256 words, except MOVE_BIT is 256 bits. Data can be moved into a different data type without prior conversion.

9-2

BLKMOV

Block Move

Copy a block of seven constants to a specified memory location. The constants are input as part of the function.

9-5

BLKCLR

Block Clear

Replace the content of a block of data with all zeros. This function can be used to clear an area of bit (%I, %Q, %M, %G, or %T) or word (%R, %AI, or %AQ) memory. The maximum length allowed is 256 words.

9-7

SHFR

Shift Register

Shift one or more data words into a table. The maximum length allowed is 256 words.

9-8

BITSEQ

Bit Sequencer

Perform a bit sequence shift through an array of bits. The maximum length allowed is 256 words.

9-11

COMMREQ

Communications Request

Allow the program to communicate with an intelligent module, such as a Genius Communications Module or a Programmable Coprocessor Module.

9-15

9-1

Page 151

9

MOVE (BIT, INT, WORD, REAL) Use the MOVE function to copy data (as individual bits) from one location to another. Because the data is copied in bit format, the new location does not need to be the same data type as the original location. The MOVE function has two input parameters and two output parameters. When the function is enabled, it copies data from input parameter IN to output parameter Q as bits. If data is moved from one location in discrete memory to another, (for example, from %I memory to %T memory), the transition information associated with the discrete memory elements is updated to indicate whether or not the MOVE operation caused any discrete memory elements to change state. Data at the input parameter does not change unless there is an overlap in the input and output references. For the BIT type there is another consideration. If a BIT array specified on the Q parameter does not encompass all of the bits in a byte, the transition bits associated with that byte (which are not in the array) will be cleared when the MOVE_BIT receives power flow. Input IN can be either a reference for the data to be moved or a constant. If a constant is specified, then the constant value is placed in the location specified by the output reference. For example, if a constant value of 4 is specified for IN, and the length (LEN) equals 1, then 4 is placed in the memory location specified by Q. If the length is greater than 1 and a constant is specified, then the constant is placed in the memory location specified by Q and the locations following, up to the length specified. For example, if the constant value 9 is specified for IN and the length equals 4, then 9 is placed in the memory location specified by Q and also in the three locations following. The LEN operand specifies the number of: •

Words to be moved for MOVE_INT and MOVE_WORD.

•

Bits to be moved for MOVE_BIT.

•

Real numbers to be moved for MOVE_REAL.

Note The REAL data type is only available on 35x and 36x series CPUs, Release 9 or later, and all releases of CPU352 and 37x. The function passes power to the right whenever power is received. _____ | | (enable), |MOVE_| - (ok) | | | INT | | | (value to be moved), |IN Q| - (output parameter Q) | | | LEN | |00001| |_____|

9-2

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 152

9

Parameters Parameter

Description enable

When the function is enabled, the move is performed.

IN

IN contains the value to be copied (moved). For MOVE_BIT, any discrete reference may be used; it does not need to be byte aligned. However, a 16-bit value, beginning with the reference address specified, is displayed on the Logicmaster screen.

ok

The ok output is energized whenever the function is enabled.

Q

When the move is performed, the value at IN is copied to Q. For MOVE_BIT, any discrete reference may be used; it does not need to be byte aligned. However, a 16-bit value, beginning with the reference address specified, is displayed on the Logicmaster screen.

LEN

LEN specifies the number of words or bits to be moved. For MOVE_WORD and MOVE_INT, LEN must be between 1 and 256 words. For MOVE_BIT, when IN is a constant, LEN must be between 1 and 16 bits; otherwise, LEN must be between 1 and 256.

Note On 351, 352, 36x and 37x series CPUs, the MOVE_INT and MOVE_WORD functions do not support overlapping of IN and Q parameters, where the IN reference is less than the Q reference. For example, with the following values: IN=%R0001, Q=%R0004, LEN=5 (words), the %R0007 and %R0008 contents will be indeterminate; however, using the following values: Q=%R0001, IN=%R0004, LEN=5 (words) will yield valid contents. Also, please note that only 35x and 36x series CPUs (Release 9.00 and later), and all releases of CPU35 and 37x have Floating Point capabilities and are therefore the only Series 90-30 CPUs capable of MOVE_REAL.

Valid Memory Types Parameter flow enable

•

IN ok Q

%I

%Q

%M

%T

%S

%G

%R

%AI %AQ const

•

•

•

• o

•

•

•

•

•

•

•

• o†

•

•

•

•

• none

• •

Note: For REAL data, the only valid types are %R, %AI, and %AQ. • o

†

GFK-0467M

Valid reference for BIT, INT, or WORD data, or place where power may flow through the function. For MOVE_BIT, discrete user references %I, %Q, %M, and %T need not be byte aligned. Valid reference for BIT or WORD data only; not valid for INT. %SA, %SB, %SC only; %S cannot be used.

Chapter 9 Data Move Functions

9-3

Page 153

9 Example 1 - Overlapping Addresses (only for CPUs 311-341) When enable input contact %Q0014 is ON, 48 bits are moved from memory location %M0001 to memory location %M0033. Even though the destination overlaps the source for 16 bits, the move is done correctly (except for the 35x and 35x CPUs as noted previously).

| _____ |%Q0014 | | | - - | | - - - |MOVE_| - | | | | | WORD| | | | |%M0001, |IN Q| - %M0033 | | | | | LEN | | |00003| | |_____| |

Before using the Move function: INPUT (%M0001 through %M0048) 1 %M0016

1

1

1

1

0

0

0

0

1

1

1

1

0

0

0

0

%M0032

0

0

0

0

1

1

1

1

0

0

0

0

1

1

1

1

%M0048

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

After using the Move function: OUTPUT (%M0033 through %M0080) 33 %M0048

1

1

1

1

0

0

0

0

1

1

1

1

0

0

0

0

%M0064

0

0

0

0

1

1

1

1

0

0

0

0

1

1

1

1

%M0080

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

Example 2 – for all CPUs In this example, whenever %I0003 is on, the values in the three bits %M0001, %M0002, and %M0003 are moved to %M0100, %M0101, and %M0102, respectively, and coil %Q0001 is turned on. | _____ |%I0003 | | %Q0001 | - - | | - - - |MOVE_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | | | | BIT | | | | | %M0001 - |IN Q| - %M0100 | | | | | LEN | | |00003| | |_____| |

9-4

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 154

9

BLKMOV (INT, WORD, REAL) Use the Block Move (BLKMOV) function to copy a block of seven constants to a specified location.

Note The REAL data type is only available on 35x and 36x series CPUs, Release 9 or later, and all releases of CPU352 and 37x. The BLKMOV function has eight input parameters and two output parameters. When the function receives power flow, it copies the constant values into consecutive locations, beginning at the destination specified in output Q. Output Q cannot be the input of another program function.

Note For BLKMOV_INT, the values of IN1, IN7 are displayed as signed decimals. For BLKMOV_WORD, IN1, IN7 are displayed in hexadecimal. For BLKMOV_REAL, IN1 - IN7 are displayed in Real format. The function passes power to the right whenever it is enabled. _____ | | (enable), |BLKMV| - (ok) | | | INT | | | (constant value), |IN1 Q| - (output parameter Q) | | | | (constant value), |IN2 | | | | | (constant value), |IN3 | | | | | (constant value), |IN4 | | | | | (constant value), |IN5 | | | | | (constant value), |IN6 | | | | | (constant value), |IN7 | |_____|

Parameters Parameter enable IN1 - IN7

GFK-0467M

Description When the function is enabled, the block move is performed. IN1 through IN7 contain seven constant values.

ok

The ok output is energized whenever the function is enabled.

Q

Output Q contains the first integer of the moved array. IN1 is moved to Q.

Chapter 9 Data Move Functions

9-5

Page 155

9 Valid Memory Types Parameter flow enable

•

%I

%Q

%M

%T

%S

%G

%R

%AI %AQ const

IN1, IN7 ok Q none

• •

• •

•

•

• o†

•

•

•

•

Note: For REAL data, the only valid types are %R, %AI, and %AQ. • o †

Valid reference for place where power may flow through the function. Valid reference for WORD data only; not valid for INT or REAL. %SA, %SB, %SC only; %S cannot be used.

Note Floating Point capabilities exist only on 35x and 36x series CPUs, Release 9 or later, and all releases of CPU352 and 37x. These 90-30 CPUs are the only ones capable of BLKMV_REAL.

Example In the following example, when input enable contact %M0201 is on, the BLKMOV function copies the seven input constants into memory locations %R0001 (specified at output Q) through %R0007. If the BLKMV executes successfully, it turns on its OK output, which energizes %M0202. In turn, an %M0202 contact enables the Service Request function in the next rung, which uses %R0001 through %R0007 as its parameter block. (See Chapter 12 for more information on Service Request instructions.) %M0201

%M0202 BLKMV_ WORD

CONST 0001

IN1

CONST 0000

IN2

CONST 0000

IN3

CONST 0204

IN4

CONST 0000

IN5

CONST 0000

IN6

CONST 0000

IN7

Q

%R0001 0001

Address %R0001 %R0002 %R0003 %R0004 %R0005 %R0006 %R0007

Value 0001 0000 0000 0204 0000 0000 0000

%M0202

%M0204 SVC_ REQ

9-6

CONST 0046

FNC

%R0001 0001

PARM

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 156

9

BLKCLR (WORD) Use the Block Clear (BLKCLR) function to fill a specified block of data with zeros. The BLKCLR function has two input parameters and one output parameter. When the function receives power flow, it writes zeros into the memory location beginning at the reference specified by IN. When the data to be cleared is from discrete memory (%I, %Q, %M, %G, or %T), the transition information associated with the references is also cleared. The function passes power to the right. _____ | | (enable), | BLK_| - (ok) | CLR_| | WORD| | | | | | | (word to be cleared), |IN | | LEN | |00001| |_____|

Parameters Parameter

Description enable

When the function is enabled, the array is cleared.

IN

IN contains the first word of the array to be cleared.

ok

The ok output is energized whenever the function is enabled.

LEN

LEN must be between 1 and 256 words.

Valid Memory Types Parameter flow enable

•

IN ok • †

%I

%Q

%M

%T

%S

%G

%R

•

•

•

•

•†

•

•

%AI %AQ const • none

•

•

•

Valid reference or place where power may flow through the function. %SA, %SB, %SC only; %S cannot be used.

Example In the following example, at power-up, 32 words of %Q memory (512 points) beginning at %Q0001 are filled with zeros. | _____ |FST_SCN | | | - - | | - - - | BLK_| - | | | | | CLR_| | | WORD| | | | | %Q0001 - |IN | | | LEN | | |00032| | |_____| |

GFK-0467M

Chapter 9 Data Move Functions

9-7

Page 157

9

SHFR (BIT, WORD) Use the Shift Register (SHFR) function to shift one or more data words or data bits from a reference location into a specified area of memory. For example, one word might be shifted into an area of memory with a specified length of five words. As a result of this shift, another word of data would be shifted out of the end of the memory area.

Note When assigning reference addresses, overlapping input and output reference address ranges in multi-word functions may produce unexpected results. The SHFR function has four input parameters and two output parameters. The reset input (R) takes precedence over the function enable input. When the reset is active, all references beginning at the shift register (ST) up to the length specified for LEN, are filled with zeros. If the function receives power flow and reset is not active, each bit or word of the shift register is moved to the next highest reference. The last element in the shift register is shifted into Q. If Q has a unique address, the data shifted out of Q is discarded. However, if IN and Q are given the same address, the data will re-circulate in the shift register. The highest reference of the shift register element of IN is shifted into the vacated element starting at ST. The contents of the shift register are accessible throughout the logic program because they are all contained in addressable memory. The function passes power to the right whenever power is received through the enable logic. The function will execute once each scan while it is enabled; so it may be beneficial to use a “oneshot” type enable contact from a transition coil if it is desired to just shift one time for a given contact closure. _____ | | (enable), |SHFR_| - (ok) | | | WORD| | | (reset), |R Q| - (output parameter Q) | LEN | |00001| | | | | | | (value to be shifted), |IN | | | | | | | (first bit or word), |ST | |_____|

9-8

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 158

9

Parameters Parameter

Description enable

When the enable input is on and the R input is off, the shift is performed. Note that the SHFR will execute once for each scan that it is enabled.

R

When the R input is on, the shift register located at ST is filled with zeros.

IN

IN contains the value to be shifted into the first bit or word of the shift register. For SHFR_BIT, any discrete reference may be used; it does not need to be byte aligned. However, 16 bits, starting with the reference address specified, are displayed online.

ST

ST contains the first bit or word of the shift register. For SHFR_BIT, any discrete reference may be used; it does not need to be byte aligned. However, 16 bits, starting with the reference address specified, are displayed online.

ok

The ok output is energized whenever the enable input is on and the R input is off.

Q

Output Q contains the bit or word shifted out of the shift register. For SHFR_BIT, any discrete reference may be used; it does not need to be byte aligned. However, 16 bits, starting with the reference address specified, are displayed online.

LEN

LEN determines the length of the shift register. For SHFR_WORD, LEN must be between 1 and 256 words. For SHFR_BIT, LEN must be between 1 and 256 bits.

Valid Memory Types Parameter

%I

%Q

%M

%T

IN

•

•

•

ST

•

•

•

•

•

• enable

•

R

• ok Q • †

GFK-0467M flow

%S

%G

%R

%AI

%AQ const

•

•

•

•

•

•

•

•

•†

•

•

•

•

•

•†

•

•

•

•

• none

•

Valid reference for BIT or WORD data, or place where power may flow through the function. For SHFR_BIT, discrete user references %I, %Q, %M, and %T need not be byte aligned. %SA, %SB, %SC only; %S cannot be used.

Chapter 9 Data Move Functions

9-9