# Configuring Analog Expansion Units for CP1 series PLC

Updated July 26, 2022

# Introduction

This article covers how to set up the analog expansion modules for the CP series PLCs.

## Step 2

Determine the range codes required for your application. See the below example for determining your range codes. Appendix F contains the full reference of range codes.

Decision Tree

### Range Code Example

• Analog Output Module
• Analogue Input/Output Module

We will use 3 analogue inputs for the example
• Input 1 = -10V to 10V
• Input 2 = 0 to 10V
• Input 3 = 4 to 20mA
• Input 4 = Not in use

The below graphic shows how the range codes are structured • Input 1 set data = Input Use(Yes, 1), Averaging (No, 0), Range Code (-10 to 10V, 00)
• Input 2 set data = Input Use(Yes, 1), Averaging (No, 0), Range Code (0 to 10V, 01)
• Input 3 set data = Input Use(Yes, 1), Averaging (No, 0), Range Code (4 to 20mA, 10)
• Input 4 set data = Input Use(No, 0), Averaging (No, 0), Range Code (N/A, 00)

Therefore the n+1 and n+2 are:

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 n+1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 n+2 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0

## CP1W-DA041 Range Code Example

In this example we will use CP1W-DA042 which has 4 outputs. CP1W-
DA021 only has 2 outputs, so only word n+1 can be used.
We will use 3 analogue inputs for the example
• Output 1 = -10V to 10V
• Output 2 = 0 to 10V
• Output 3 = 4 to 20mA
• Output 4 = Not in use

The below graphic shows how the range codes are structured  • Output 1 set data = Output Use(Yes, 1), Range Code (-10 to 10V, 000)
• Output 2 set data = Output Use(Yes, 1), Range Code (0 to 10V, 001)
• Output 3 set data = Output Use(Yes, 1), Range Code (4 to 20mA, 100)
• Output 4 set data = Output Use(No, 0), Range Code (N/A, 000)

Therefore the n+1 and n+2 are:

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 n+1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 n+2 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
Select desired expansion module

We will use 2 analogue inputs and 1 analogue output for the example.
• Input 1 = -10V to 10V
• Input 2 = 4 to 20mA
• Output 1 = 4 to 20mA

The below graphic shows how the range codes are structured  • Input 1 set data = Range Code (-10 to 10V, 000)
• Input 2 set data = Range Code (0 to 10V, 010)
• Output 1 set data = Range Code (4 to 20mA, 100)

Therefore the n+1 is:

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 n+1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0

We will use 3 analogue inputs  and 3 analogue outputs for the example
• Input 1 = -10V to 10V
• Input 2 = 0 to 10V
• Input 3 = 4 to 20mA
• Input 4 = Not in use
• Output 1 = -10V to 10V
• Output 2 = 0 to 10V
• Output 3 = 4 to 20mA
• Output 4 = Not in use

The below graphic shows how the range codes are structured for CP1W-MAD44   • Input 1 set data = Input Use(Yes, 1), Average(No, 0), Range Code (-10 to 10V, 00)
• Input 2 set data = Input Use(Yes, 1), Average(No, 0), Range Code (0 to 10V, 01)
• Input 3 set data = Input Use(Yes, 1), Average(No, 0), Range Code (4 to 20mA, 10)
• Input 4 set data = Input Use(No, 0), Average(No, 0), Range Code (N/A, 000)
• Output 1 set data = Output Use(Yes, 1), Range Code (-10 to 10V, 000)
• Output 2 set data = Output Use(Yes, 1), Range Code (0 to 10V, 001)
• Output 3 set data = Output Use(Yes, 1), Range Code (4 to 20mA, 100)
• Output 4 set data = Output Use(No, 0), Range Code (N/A, 000)

Therefore the n+1 to n+4 are:

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 n+1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 n+2 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 n+3 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 n+4 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0

We will use 3 analogue inputs and 1 analogue output for the example
• Input 1 = -10V to 10V
• Input 2 = 0 to 10V
• Input 3 = 4 to 20mA
• Input 4 = Not in use
• Output 1 = -10V to 10V
• Output 2 = Not in use

The below graphic shows how the range codes are structured for CP1W-MAD44   • Input 1 set data = Input Use(Yes, 1), Average(No, 0), Range Code (-10 to 10V, 00)
• Input 2 set data = Input Use(Yes, 1), Average(No, 0), Range Code (0 to 10V, 01)
• Input 3 set data = Input Use(Yes, 1), Average(No, 0), Range Code (4 to 20mA, 10)
• Input 4 set data = Input Use(No, 0), Average(No, 0), Range Code (N/A, 000)
• Output 1 set data = Output Use(Yes, 1), Range Code (-10 to 10V, 000)
• Output 2 set data = Output Use(No, 0), Range Code (N/A, 0)

Therefore the n+1 and n+2 are:

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 n+1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 n+2 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0

## Step 3

Write the range codes to the IO area to initialise the analogue input/output configuration. See Appendix A for information on how to determine the memory areas your expansion module is using. The below example goes over how to write the range codes to your expansion cards.

Decision Tree

## Programming Examples

• Analogue Output Module
• Analogue Input/Output Module  ## CP1W-DA041 Programming Example  ### Expansion Module Selection Analog In/Out Range Range code Input 1 0 to 10V 001 Input 2 4 to 20mA 010 Output 1 0 to 10V 001
 Set Data 1000 000001010001 (Hex 8051)      This content will be shown (depending on) when button above is clicked

## Appendix A - Analog Memory Areas

Expansion Units and Expansion I/O Units are allocated I/O bits in the order the Units are connected starting from the CPU Unit. When the power to the CPU Unit is turned ON, the CPU Unit checks for any Expansion Units and Expansion I/O Units connected to it and automatically allocates I/O bits. See example below for how memory is allocated to analog input and output areas. In this article, input areas are referred to as "n" and output areas as "m".Delete

Delete
Decision Tree

• CP1W-DA

## Input Signal Ranges

The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analog value.        ## Output Signal Ranges

The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analogue value.      Select the desired expansion module
Select Input or Output
• Inputs
• Outputs

The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analogue value.    The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analogue value.   Select Input or Output
• Inputs
• Outputs

The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analogue value.    The vertical axis indicates the digital value in the expansion unit, and the horizontal axis indicates the true analogue value.   ## Appendix E - Wiring diagrams Delete

## Analog Output Wiring Delete
Delete
Decision Tree

## Appendix F - Analog Range Codes

• Analogue Input module
• Analogue Output module

Four input words and two output words are allocated from the next words following the last I/O words allocated to the CPU Unit or an existing Expansion Unit or Expansion I/O Unit.
Write the settings for input use, averaging use, and range codes for words
n+1 and n+2.   ## CP1W-DA41 Range Codes

Four output words (n+1 to n+4) are allocated, beginning from the first word following the last I/O word allocated to the CPU Unit or already-connected Expansion I/O Unit or Expansion Unit. For CP1W-DA021, two output words (n+1, n+2) are allocated.   ## Analogue Input/Output Module Range Codes

Two input words and one output word are allocated to the CP1W-MAD11
starting from the next word following the last word allocated to the CPU Unit
or previous Expansion Unit or Expansion I/O Unit.   Four input words and two output words are allocated to the CP1W-MAD42,
starting from the next word following the last word allocated to the CPU Unit
or previous Expansion Unit or Expansion I/O Unit.  Analogue input configuration data structure  Analogue output configuration data structure  Four input words and four output words are allocated to the CP1W-MAD44,
starting from the next word following the last word allocated to the CPU Unit
or previous Expansion Unit or Expansion I/O Unit.  Analogue input configuration data structure  Analogue output configuration data structure  This content will be shown (depending on) when button above is clicked