Rockwell Automation 2080-LC50 Micro800 Controllers: Getting Started with CIP Client Messaging User Manual

Page 50

Advertising
background image

44

Rockwell Automation Publication 2080-QS002A-EN-E - April 2013

Appendix C COP Function Block

Src

Input

Supported data
types

(1)

:

Boolean, SINT,
USINT, BYTE, INT,
UINT, WORD, DINT,
UDINT, DWORD,
REAL, TIME, DATE,
STRING, LWORD,
ULINT, LINT, LREAL

Initial element to copy.
If source or destination is String data, the other party needs to be String data or USINT (UCHAR and
BYTE considered as same data type). Otherwise, data type mismatch is reported. When copied to
or from a String Data, ODVA short String format shall be used for data in USINT array.
For COP instruction between any pair of data types (no String data as either Source or Destination),
copy operation is considered valid, even although the data in the destination are possibly in invalid
format. User need to handle the logic at the application level.
To copy USINT array to a String array, the data in USINT array need to be in format:
- Byte1: Length of first String,
- Byte2: First Byte Character,
- Byte3: Second Byte Character,
- Byte n: Last Byte Character,
- Byte (n+1): Length of second String,
- Byte (n+2): First Byte Character for second String, and so on.

SrcOffset

Input

UINT

Source element offset.
Element offset if source is array data type, otherwise 0 should be set.
For array data type, to copy from the first element, the offset should be set as 0.

Dest

Input

Supported data
types

(1)

:

Boolean, SINT,
USINT, BYTE, INT,
UINT, WORD, DINT,
UDINT, DWORD,
REAL, TIME, DATE,
STRING, LWORD,
ULINT, LINT, LREAL

Copy destination.

DestOffset

Input

UINT

Destination element offset.
Element offset if destination is array data type, otherwise 0 should be set.
For array data type, to copy to the first element, the offset should be set as 0.

Length

Input

UINT

Number of destination elements to copy.
When destination is String data type, it means number of strings to be copied.

Swap

Input

BOOLEAN

TRUE: Swap bytes according to Data Type.
If either source or destination is String data, there is no Swap.
If both source and destination are one-byte length data, there is no Swap.

STS

Output

UINT

0: Function block not enabled. No operation.
1: COP operation success
2: Destination has spare bytes when copying from String (considering copy is successful).
3: Source data is truncated (considering copy successful).
4: Copy Length is invalid.
5: Data type mismatch when there is String Data type as either Source, or Destination.
6: Source data size is too small for copy.
7: Destination data size is too small for copy.
8: Source Data offset is invalid.
9: Destination Data offset is invalid
10: Data is invalid in either source or destination.

(1) Src and Dest must be in the Array Format, only if one variable is required to be copied, then it has to be defined in array format (for example, variable[1..1]). Structured

variables are not supported by the COP instruction.

COP Parameters

Parameter

Parameter
Type

Data Type

Description

Advertising
This manual is related to the following products: