Delta Tau ACC-11E User Manual

Single Source Machine Control Power // Flexibility // Ease of Use
21314 Lassen Street Chatsworth, CA 91311 // Tel. (818) 998-2095 Fax. (818) 998-7807 // www.deltatau.com
^1 USER MANUAL
^2 Accessory 11E
^3 24 Opto In/24 Opto Out
^4 3AX-603307-XUXX
^5 October 17, 2018
DELTA TAU
Data Systems, Inc.
NEW IDEAS IN MOTION …
ACC-11E User Manual
Copyright Information
© 2018 Delta Tau Data Systems, Inc. All rights reserved. This document is furnished for the customers of Delta Tau Data Systems, Inc. Other uses are unauthorized without written permission of Delta Tau Data Systems, Inc. Information contained in this manual may be updated from time-to-time due to product improvements, etc., and may not conform in every respect to former issues. To report errors or inconsistencies, call or email:
Delta Tau Data Systems, Inc. Technical Support
Phone: (818) 717-5656 Fax: (818) 998-7807 Email: support@deltatau.com Website: http://www.deltatau.com
Operating Conditions
All Delta Tau Data Systems, Inc. motion controller products, accessories, and amplifiers contain static sensitive components that can be damaged by incorrect handling. When installing or handling Delta Tau Data Systems, Inc. products, avoid contact with highly insulated materials. Only qualified personnel should be allowed to handle this equipment. In the case of industrial applications, we expect our products to be protected from hazardous or conductive materials and/or environments that could cause harm to the controller by damaging components or causing electrical shorts. When our products are used in an industrial environment, install them into an industrial electrical cabinet or industrial PC to protect them from excessive or corrosive moisture, abnormal ambient temperatures, and conductive materials. If Delta Tau Data Systems, Inc. products are directly exposed to hazardous or conductive materials and/or environments, we cannot guarantee their operation.
WARNING
A Warning identifies hazards that could result in personal injury or death. It precedes the discussion of interest.
Caution
A Caution identifies hazards that could result in equipment damage. It precedes the discussion of interest.
Note
A Note identifies information critical to the user’s understanding or use of the equipment. It follows the discussion of interest.
ACC-11E User Manual
MANUAL REVISION HISTORY
REV.
DESCRIPTION
DATE
CHG.
APPVD
1
ADDED CE DECLARATION
06/07/06
CP
SF
2
REVS. TO J1& J2, PINS 8 & 15, P. 31
05/11/07
CP
AO
3
REVS. TO ELEC. SPECS, P. 3
07/27/07
CP
BP
4
ADDED UL SEAL TO MANUAL COVER
UPDATED AGENCY APPROVAL/SAFETY SECTION
10/01/09
CP
SF
5
REFURBISHED ENTIRE MANUAL
12/17/12
GS
RN
6
ADDED KC CONFORMITY
10/17/18
SM
RN
ACC-11E User Manual
Table of Contents 4
Table of Contents
INTRODUCTION......................................................................................................................... 6
SPECIFICATIONS....................................................................................................................... 7
Environmental Specifications ......................................................................................................... 7
Electrical Specifications.................................................................................................................. 7
Physical Specifications ................................................................................................................... 7
Agency Approval and Safety .......................................................................................................... 8
ADDRESSING ACC-11E ............................................................................................................. 9
Turbo/Power UMAC and MACRO Station Jumper Settings ......................................................... 9
Legacy MACRO Station Address Jumper Settings ........................................................................ 9
Sinking or Sourcing Output Select ............................................................................................... 10
I/O Gate Data Clock Select ........................................................................................................... 10
Hardware Address Limitations ..................................................................................................... 11
USING ACC-11E WITH TURBO UMAC ............................................................................... 13
Configuring the Control Word ...................................................................................................... 13
Accessing I/O data points (M-Variables) ..................................................................................... 14
USING ACC-11E WITH POWER UMAC SCRIPT PROGRAMING ................................. 16
Configuring the Control Word ...................................................................................................... 16
Accessing I/O Data Points (Pointers) ........................................................................................... 17
Suggested M-Variables ............................................................................................................ 17
USING ACC-11E WITH POWER UMAC C PROGRAMING ............................................. 18
Setting Up Digital I/O Access....................................................................................................... 18
Function for Setting the Control Word: ACC11E_SetControlWord() ..................................... 18
Function for Reading the State of Inputs: ACC11E_GetInputState() ...................................... 19
Function for Reading the State of Outputs: ACC11E_GetOutputState()................................. 19
Function for Writing to Outputs: ACC11E_SetOutputState() ................................................. 20
Header and Source File ........................................................................................................... 22
User Written Functions ............................................................................................................ 26
Setting Up the Control Word ........................................................................................................ 28
USING ACC-11E WITH UMAC MACRO STATION ........................................................... 30
Quick Review: Nodes and Addressing ......................................................................................... 30
Setting Up The Control Word ....................................................................................................... 33
Transferring Data Points over I/O Nodes ..................................................................................... 35
Preparing for I/O Data Transfer on the MACRO16 Station ................................................... 36
MS{anynode},MI71: 24-Bit Transfer ....................................................................................... 37
ACC-11E User Manual
Table of Contents 5
MS{anynode},MI69 and MI70: 16-Bit Transfer ...................................................................... 42
MS{anynode}, MI171, MI172, and MI173: 24-Bit/16-Bit Transfer ........................................ 46
LAYOUTS & PINOUTS ............................................................................................................ 47
Board Layout Diagrams ................................................................................................................ 47
Wiring Considerations .................................................................................................................. 48
Terminal Block Option ................................................................................................................. 49
TB1 Top: Inputs 1 thru 12 ........................................................................................................ 49
TB2 Top: Inputs 13 thru 24 ...................................................................................................... 49
TB3 Top: Reference Voltages................................................................................................... 49
Wiring Input Terminal Blocks .................................................................................................. 50
TB1 Bottom: Outputs 1 thru 12 ................................................................................................ 51
TB2 Bottom: Outputs 13 thru 24 .............................................................................................. 51
TB3 Bottom: Reference Voltages ............................................................................................. 51
Wiring Output Terminal Blocks ............................................................................................... 52
D-Sub Option ................................................................................................................................ 53
J1 Top: Inputs 1 thru 12 ........................................................................................................... 53
J2 Top: Inputs 13 thru 24 ......................................................................................................... 53
Wiring Input DB15 Connectors ............................................................................................... 54
J1 Bottom: Outputs 1 thru 12 ................................................................................................... 55
J2 Bottom: Outputs 13 thru 24 ................................................................................................. 55
Wiring Output DB15 Connectors ............................................................................................. 56
SCHEMATICS ............................................................................................................................ 58
APPENDIX A: USING THE UMAC CONFIG PRO2 TOOL ............................................... 60
APPENDIX B: FULL TURBO UMAC M-VARIABLE MAPPINGS ................................... 66
APPENDIX C: FULL POWER UMAC M-VARIABLE MAPPINGS .................................. 78
APPENDIX D: THE CONTROL WORD ................................................................................ 90
ACC-11E User Manual
Introduction 6
INTRODUCTION
The ACC-11E is a 24 In/24 Out general purpose I/O card. Built in the 3U euro card format, it can be used in the following products:
- Turbo UMAC
- Power UMAC
- UMAC MACRO Station
All inputs and outputs are 12-24 VDC, optically isolated, and can be configured as sinking or sourcing.
ACC-11E User Manual
Specifications 7
SPECIFICATIONS
Environmental Specifications
Description
Specification
Operating Temperature
0°C to 45°C,
Storage Temperature
-25°C to 70°C
Humidity
10% to 95 % non-condensing
Electrical Specifications
Description
Specification
Notes
Power Requirements
5V @ 0.05A (10%)
Output Current (individual)
100 mA
For UDN2981 and ULN2803
V1
12 – 24V
User-supplied voltage
Output Voltage
V1 – 1.1V
ULN2803 (See chip data sheet for details)
V1 – 1.8V
UDN2981 (See chip data sheet for details)
Fuse
125V @ 2.0A
Manufacturer: Little Fuse
Physical Specifications
Description
Specification
Notes
Dimensions
Length: 16.256 cm (6.4 in.) Height: 10 cm (3.94 in.) Width: 2.03 cm (0.8 in.)
Weight
180 g
Front Plate included
Terminal Block Connectors
FRONT-MC1,5/12-ST3,81 FRONT-MC1,5/5-ST3,81 FRONT-MC1,5/3-ST3,81
Terminal Blocks from Phoenix Contact. UL-94V0 DB Option Connectors
DB15 Female
UL-94V0
The width is the width of the front plate. The length and height are the dimensions of the PCB.
ACC-11E User Manual
Specifications 8
Agency Approval and Safety
Item
Description
CE Mark
EN61326-1
EMC
EN55011 Class A Group 1 EN61000-4-2 EN61000-4-3 EN61000-4-4 EN61000-4-5 EN61000-4-6
UL
UL 61010-1 File E314517
cUL
CAN/CSA C22.2 No. 1010.1-92 File E314517
Flammability Class
UL 94V-0
KC
EMI: KN 11 EMS: KN 61000-6-2
사 용 자 안 내 문
이 기기는 업무용 환경에서 사용할 목적으로 적합성평가를 받은 기기로서 가정
용 환경에서 사용하는 경우 전파간섭의 우려가 있습니다.
한국 EMC적용제품 준수사항
본 제품은 전파법(KC 규정)을 준수합니다. 제품을 사용하려면 다음 사항에 유
의하십시오. 이 기기는 업무용 환경에서 사용할 목적으로 적합성평가를 받은
기기로서 가정용 환경에서 사용하는 경우 전파간섭의 우려가 있습니다.
입력에 EMC 필터, 서지 보호기, 페라이트 코어 또는 1차측의 케이블에 노이즈
필터를 입력으로 사용하십시오.
ACC-11E User Manual
Addressing and Jumper Settings 9
ADDRESSING ACC-11E
Several jumpers must be configured on the Accessory 11E in order for it to work properly with other I/O cards in the UMAC rack. Jumpers E1-E4 select the starting base I/O address, and for within the base address, jumpers E6A-E6H select whether the low, middle, or high byte will be used.
Turbo/Power UMAC and MACRO Station Jumper Settings
Chip
Select
TURBO
MACRO
POWER
Jumpers
Offset
Index
(n)
E1
E2
E3
E4
E6A-E6H
CS10
Y:$78C00,0,8
Y:$8800,0,8
$A00000.8.8
0
ON
OFF
OFF
OFF
1 to 2
CS10
Y:$78C00,8,8
Y:$8800,8,8
$A00000.16.8
0
ON
OFF
OFF
OFF
2 to 3
CS10
Y:$78C00,16,8
Y:$8800,16,8
$A00000.24.8
0
ON
OFF
OFF
OFF
4 to 5
CS12
Y:$78D00,0,8
Y:$8840,0,8
$B00000.8.8
1
OFF
ON
OFF
OFF
1 to 2
CS12
Y:$78D00,8,8
Y:$8840,8,8
$B00000.16.8
1
OFF
ON
OFF
OFF
2 to 3
CS12
Y:$78D00,16,8
Y:$8840,16,8
$B00000.24.8
1
OFF
ON
OFF
OFF
4 to 5
CS14
Y:$78E00,0,8
Y:$8880,0,8
$C00000.8.8
2
OFF
OFF
ON
OFF
1 to 2
CS14
Y:$78E00,8,8
Y:$8880,8,8
$C00000.16.8
2
OFF
OFF
ON
OFF
2 to 3
CS14
Y:$78E00,16,8
Y:$8880,16,8
$C00000.24.8
2
OFF
OFF
ON
OFF
4 to 5
CS16
Y:$78F00,0,8
Y:$88C0,0,8
$D00000.8.8
3
OFF
OFF
OFF
ON
1 to 2
CS16
Y:$78F00,8,8
Y:$88C0,8,8
$D00000.16.8
3
OFF
OFF
OFF
ON
2 to 3
CS16
Y:$78F00,16,8
Y:$88C0,16,8
$D00000.24.8
3
OFF
OFF
OFF
ON
4 to 5
E6A – E6H Layout Diagram
1 2 3 4 5
E6A
E6B
E6C
E6D
E6E
E6F
E6G
E6H
Legacy MACRO Station Address Jumper Settings
Chip Select
MACRO
Jumpers
E1
E2
E3
E4
CS10
$FFE0
ON
OFF
OFF
OFF
CS12
$FFE8
OFF
ON
OFF
OFF
CS14
$FFF0
OFF
OFF
ON
OFF
ACC-11E User Manual
Addressing and Jumper Settings 10
Sinking or Sourcing Output Select
WARNING
Jumpers E16 thru E21 generally should be left at factory defaults.
They must not be changed without also changing their respective buffer IC, ULN2803A for sinking or UDN2981A for sourcing.
Jumpers
Descriptions
E16 & E17
1-2 = Outputs 1 thru 8 Sinking 2-3 = Outputs 1 thru 8 Sourcing
E18 & E19
1-2 = Outputs 9 thru 16 Sinking 2-3 = Outputs 9 thru 16 Sourcing
E20 & E21
1-2 = Outputs 17 thru 24 Sinking 2-3 = Outputs 17 thru 24 Sourcing
I/O Gate Data Clock Select
Jumper
Function
E5
Servo Clock 2-3 Phase Clock (default)
ACC-11E User Manual
Addressing and Jumper Settings 11
Hardware Address Limitations
The ACC-11E has a hardware address limitation relative to the newer type B series of UMAC high-speed I/O cards. These new I/O cards have four base addresses per chip select (CS10, CS12, CS14, and CS16). This enables these cards to have up to 16 different addresses. The type A cards have one base address per chip select but also have the low-byte, middle-byte, and high-byte type of an addressing scheme and thus allow for a maximum of twelve of these I/O cards.
Name
Type
Category
Possible Number
of Addresses
Maximum Number
of Cards in 1 Rack
ACC-9E
A
General I/O
4
12
ACC-10E
A
General I/O
4
ACC-11E
A
General I/O
4
ACC-12E
A
General I/O
4
ACC-14E
B
General I/O
16
16
ACC-28E
B
Analog I/O
16
ACC-36E
B
Analog I/O
16
ACC-53E
B
Feedback
16
ACC-57E
B
Feedback
16
ACC-58E
B
Feedback
16
ACC-59E
B
Analog I/O
12
12
ACC-65E
B
General I/O
16
16
ACC-66E
B
General I/O
16
ACC-67E
B
General I/O
16
ACC-68E
B
General I/O
16
ACC-84E
B
Feedback
12
12
Addressing Type A and Type B accessory cards requires attention to the following set of rules:
Populating Rack with Type A Cards Only (no conflicts)
In this mode, the card(s) can use any available Address.
Note
Type A cards can have up to 4 different base addresses. Because each card can be setup to use the lower, middle, or high byte of a specific base address, it is possible to populate a single rack with a maximum of 12 Type A accessory cards.
Populating Rack with Type B Cards Only (no conflicts)
In this mode, the card(s) can potentially use any available Address.
Populating Rack with Type A & Type B Cards (possible conflicts)
Typically, Type A and Type B cards should not share the same Chip Select; however, if they do, the following rules apply:
Type A and Type B Feedback Cards
Type A cards cannot share the same Chip Select as Type B Feedback cards.
ACC-11E User Manual
Addressing and Jumper Settings 12
Type A and Type B General I/O Cards
Type A cards can share the same Chip Select as Type B general I/O cards; however, in this mode, Type B cards naturally use the lower byte (default), and Type A cards must be set to the middle/high byte of the selected base address.
Type A Cards and Type B Analog Cards
Type A cards can share the same Chip Select as Type B analog I/O cards; however, in this mode, Type B cards naturally use the middle/high bytes (default), and Type A cards must be set to the low byte of the selected base address.
ACC-11E User Manual
Using ACC-11E with UMAC Turbo 13
USING ACC-11E WITH TURBO UMAC
The procedure for using the ACC-11E with Turbo UMAC has two steps:
1. Configure the Control Word
2. Accessing I/O data points (M-Variables)
Configuring the Control Word
Write a 7 to the control word which is located at {base address + 7}, n, 8 where:
n = 0 if using low byte addressing n = 8 if using middle byte addressing n = 16 if using high byte addressing
The control word must be configured every time the UMAC is powered or reset. This can be done in an initialization (one that disables itself) PLC.
Example 1: Setting up Control Word at Startup for Card at Base Address $78C00, Low Byte Addressing
M3307->Y:$78C07,0,8 // I/O Card 1 control register from suggested M-Variables
Open PLC 1 Clear M3307=$07 Disable PLC 1 Close
Example 2: Setting up Control Word at Startup for 3 Cards at Base Address $78C00; Low, Middle, and High Byte Addressing
M3307->Y:$78C07,0,8 // I/O Card 1 control register using low byte M3317->Y:$78C07,8,8 // I/O Card 2 control register using middle byte M3327->Y:$78C07,16,8 // I/O Card 3 control register using high byte
Open PLC 1 Clear M3307=$07 M3317=$07 M3327=$07 Disable PLC 1 Close
Note
See Appendix for control word details and explanations.
ACC-11E User Manual
Using ACC-11E with UMAC Turbo 14
Accessing I/O data points (M-Variables)
Every ACC-11E has 48 bits of I/O data, which are comprised of one byte (8 bits) at the base address plus five more bytes (8 x 6 = 48) at the next five consecutive addresses. Examples:
I/O data bits for card at base address
$78C00 using low bytes
I/O data bits for card at base address
$78C00 using high bytes
Y:$078C00,0,8 Y:$078C01,0,8 Y:$078C02,0,8
Inputs 1-8 Inputs 9-16 Inputs 17-24
Y:$078C00,16,8 Y:$078C01,16,8 Y:$078C02,16,8
Inputs 1-8 Inputs 9-16 Inputs 17-24
Y:$078C03,0,8 Y:$078C04,0,8 Y:$078C05,0,8
Outputs 1-8 Outputs 9-16 Outputs 17-24
Y:$078C03,16,8 Y:$078C04,16,8 Y:$078C05,16,8
Outputs 1-8 Outputs 9-16 Outputs 17-24
Example: Bitwise M-Variable mapping for ACC-11E at base address $78C00 using low bytes:
#define Input1 M7000 Input1->Y:$078C00,0,1 #define Input2 M7001 Input2->Y:$078C00,1,1 #define Input3 M7002 Input3->Y:$078C00,2,1 #define Input4 M7003 Input4->Y:$078C00,3,1 #define Input5 M7004 Input5->Y:$078C00,4,1 #define Input6 M7005 Input6->Y:$078C00,5,1 #define Input7 M7006 Input7->Y:$078C00,6,1 #define Input8 M7007 Input8->Y:$078C00,7,1 #define Input9 M7008 Input9->Y:$078C01,0,1 #define Input10 M7009 Input10->Y:$078C01,1,1 #define Input11 M7010 Input11->Y:$078C01,2,1 #define Input12 M7011 Input12->Y:$078C01,3,1 #define Input13 M7012 Input13->Y:$078C01,4,1 #define Input14 M7013 Input14->Y:$078C01,5,1 #define Input15 M7014 Input15->Y:$078C01,6,1 #define Input16 M7015 Input16->Y:$078C01,7,1 #define Input17 M7016 Input17->Y:$078C02,0,1 #define Input18 M7017 Input18->Y:$078C02,1,1 #define Input19 M7018 Input19->Y:$078C02,2,1 #define Input20 M7019 Input20->Y:$078C02,3,1 #define Input21 M7020 Input21->Y:$078C02,4,1 #define Input22 M7021 Input22->Y:$078C02,5,1 #define Input23 M7022 Input23->Y:$078C02,6,1 #define Input24 M7023 Input24->Y:$078C02,7,1
#define Output1 M7024 Output1->Y:$078C03,0,1 #define Output2 M7025 Output2->Y:$078C03,1,1 #define Output3 M7026 Output3->Y:$078C03,2,1 #define Output4 M7027 Output4->Y:$078C03,3,1 #define Output5 M7028 Output5->Y:$078C03,4,1 #define Output6 M7029 Output6->Y:$078C03,5,1 #define Output7 M7030 Output7->Y:$078C03,6,1 #define Output8 M7031 Output8->Y:$078C03,7,1 #define Output9 M7032 Output9->Y:$078C04,0,1 #define Output10 M7033 Output10->Y:$078C04,1,1 #define Output11 M7034 Output11->Y:$078C04,2,1 #define Output12 M7035 Output12->Y:$078C04,3,1 #define Output13 M7036 Output13->Y:$078C04,4,1 #define Output14 M7037 Output14->Y:$078C04,5,1 #define Output15 M7038 Output15->Y:$078C04,6,1 #define Output16 M7039 Output16->Y:$078C04,7,1 #define Output17 M7040 Output17->Y:$078C05,0,1 #define Output18 M7041 Output18->Y:$078C05,1,1 #define Output19 M7042 Output19->Y:$078C05,2,1 #define Output20 M7043 Output20->Y:$078C05,3,1 #define Output21 M7044 Output21->Y:$078C05,4,1 #define Output22 M7045 Output22->Y:$078C05,5,1 #define Output23 M7046 Output23->Y:$078C05,6,1 #define Output24 M7047 Output24->Y:$078C05,7,1
ACC-11E User Manual
Using ACC-11E with UMAC Turbo 15
Note
See Appendix for suggested M-Variables for additional cards.
Note
Suggested M-Variable definitions are also available with the UMAC Config. Pro2 tool (see Appendix).
Note
Most systems only use low byte addressing
ACC-11E User Manual
Using ACC-11E with Power UMAC 16
USING ACC-11E WITH POWER UMAC SCRIPT PROGRAMING
The following section describes two software configuration procedures that are needed when using the Power PMAC script programming language:
1. Configuring the Control Word
2. Accessing I/O data points (pointers)
Configuring the Control Word
Write a 7 to the control word which is located at {base address + 7}.n.8 where:
n = 8 if using low byte addressing n = 16 if using middle byte addressing n = 24 if using high byte addressing
The control word must be configured every time the POWER UMAC is powered or reset. This can be done in an initialization (one that disables itself) PLC, usually PLC 1.
Example: Setting up Control Word at Startup for Card at $A00000, Low Byte Addressing
ptr IoCard0Reg7->u.io:$A0001C.8.8 // I/O Card 0 control register from suggested M-Variables
open plc 1 IoCard0Reg7=$7; disable plc 1; close
Example: Setting up Control Word at Startup for 3 Cards at Base Address $A00000; Low, Middle, and High Byte Addressing
ptr IoCard0Reg7->u.io:$A0001C.8.8 // I/O Card 0 control register from suggested M-Variables ptr IoCard1Reg7->u.io:$A0001C.16.8 // I/O Card 1 control register from suggested M-Variables ptr IoCard2Reg7->u.io:$A0001C.24.8 // I/O Card 2 control register from suggested M-Variables
open plc 1 IoCard0Reg7=$7; IoCard1Reg7=$7; IoCard2Reg7=$7; disable plc 1; close
Note
See Appendix for control word details and explanations.
ACC-11E User Manual
Using ACC-11E with Power UMAC 17
Accessing I/O Data Points (Pointers)
The simplest way to access I/O points on the ACC-11E is to define pointer variables (M-Variables) that point to each bit on the I/O device.
Suggested M-Variables
Base offset $A00000, low byte addressing
// Single-bit variables used for accessing I/O points ptr Input1->u.io:$A00000.8.1 // I/O Card 1 Input1 ptr Input2->u.io:$A00000.9.1 // I/O Card 1 Input2 ptr Input3->u.io:$A00000.10.1 // I/O Card 1 Input3 ptr Input4->u.io:$A00000.11.1 // I/O Card 1 Input4 ptr Input5->u.io:$A00000.12.1 // I/O Card 1 Input5 ptr Input6->u.io:$A00000.13.1 // I/O Card 1 Input6 ptr Input7->u.io:$A00000.14.1 // I/O Card 1 Input7 ptr Input8->u.io:$A00000.15.1 // I/O Card 1 Input8 ptr Input9->u.io:$A00004.8.1 // I/O Card 1 Input9 ptr Input10->u.io:$A00004.9.1 // I/O Card 1 Input10 ptr Input11->u.io:$A00004.10.1 // I/O Card 1 Input11 ptr Input12->u.io:$A00004.11.1 // I/O Card 1 Input12 ptr Input13->u.io:$A00004.12.1 // I/O Card 1 Input13 ptr Input14->u.io:$A00004.13.1 // I/O Card 1 Input14 ptr Input15->u.io:$A00004.14.1 // I/O Card 1 Input15 ptr Input16->u.io:$A00004.15.1 // I/O Card 1 Input16 ptr Input17->u.io:$A00008.8.1 // I/O Card 1 Input17 ptr Input18->u.io:$A00008.9.1 // I/O Card 1 Input18 ptr Input19->u.io:$A00008.10.1 // I/O Card 1 Input19 ptr Input20->u.io:$A00008.11.1 // I/O Card 1 Input20 ptr Input21->u.io:$A00008.12.1 // I/O Card 1 Input21 ptr Input22->u.io:$A00008.13.1 // I/O Card 1 Input22 ptr Input23->u.io:$A00008.14.1 // I/O Card 1 Input23 ptr Input24->u.io:$A00008.15.1 // I/O Card 1 Input24 ptr Output1->u.io:$A0000C.8.1 // I/O Card 1 Output1 ptr Output2->u.io:$A0000C.9.1 // I/O Card 1 Output2 ptr Output3->u.io:$A0000C.10.1 // I/O Card 1 Output3 ptr Output4->u.io:$A0000C.11.1 // I/O Card 1 Output4 ptr Output5->u.io:$A0000C.12.1 // I/O Card 1 Output5 ptr Output6->u.io:$A0000C.13.1 // I/O Card 1 Output6 ptr Output7->u.io:$A0000C.14.1 // I/O Card 1 Output7 ptr Output8->u.io:$A0000C.15.1 // I/O Card 1 Output8 ptr Output9->u.io:$A00010.8.1 // I/O Card 1 Output9 ptr Output10->u.io:$A00010.9.1 // I/O Card 1 Output10 ptr Output11->u.io:$A00010.10.1 // I/O Card 1 Output11 ptr Output12->u.io:$A00010.11.1 // I/O Card 1 Output12 ptr Output13->u.io:$A00010.12.1 // I/O Card 1 Output13 ptr Output14->u.io:$A00010.13.1 // I/O Card 1 Output14 ptr Output15->u.io:$A00010.14.1 // I/O Card 1 Output15 ptr Output16->u.io:$A00010.15.1 // I/O Card 1 Output16 ptr Output17->u.io:$A00014.8.1 // I/O Card 1 Output17 ptr Output18->u.io:$A00014.9.1 // I/O Card 1 Output18 ptr Output19->u.io:$A00014.10.1 // I/O Card 1 Output19 ptr Output20->u.io:$A00014.11.1 // I/O Card 1 Output20 ptr Output21->u.io:$A00014.12.1 // I/O Card 1 Output21 ptr Output22->u.io:$A00014.13.1 // I/O Card 1 Output22 ptr Output23->u.io:$A00014.14.1 // I/O Card 1 Output23 ptr Output24->u.io:$A00014.15.1 // I/O Card 1 Output24
// Byte-wide variables used for power-on configuration ptr IoCard1Reg0->u.io:$A00000.8.8 // I/O Card 1 Inputs 1-8 as byte ptr IoCard1Reg1->u.io:$A00004.8.8 // I/O Card 1 Inputs 9-16 as byte ptr IoCard1Reg2->u.io:$A00008.8.8 // I/O Card 1 Inputs 17-24 as byte ptr IoCard1Reg3->u.io:$A0000C.8.8 // I/O Card 1 Outputs 1-8 as byte ptr IoCard1Reg4->u.io:$A00010.8.8 // I/O Card 1 Outputs 9-16 as byte ptr IoCard1Reg5->u.io:$A00014.8.8 // I/O Card 1 Outputs 17-24 as byte ptr IoCard1Reg6->u.io:$A00018.8.8 // I/O Card 1 latch inputs ptr IoCard1Reg7->u.io:$A0001C.8.8 // I/O Card 1 control register
See Appendix for suggested M-Variables for additional cards.
ACC-11E User Manual
Using ACC-11E with Power UMAC 18
USING ACC-11E WITH POWER UMAC C PROGRAMING
Setting Up Digital I/O Access
Delta Tau has developed the following functions which can be used to setup the ACC-11E using the C Programming Language. The last entry in the list describes, as an alternative, how to create user written functions.
Function for Setting the Control Word: ACC11E_SetControlWord() Function for Reading the State of Inputs: ACC11E_GetInputState() Function for Reading the State of Outputs: ACC11E_GetOutputState() Function for Writing to Outputs: ACC11E_SetOutputState() User Written Functions
Function for Setting the Control Word: ACC11E_SetControlWord()
Two parameters must be passed in the calling function:
BaseAddressOffset: One of the four base addresses (jumper selected) ACC-11E can take =0xA00000 =0xB00000 =0xC00000 =0xD00000
ByteSelect: The byte used (jumper selected) for the I/O bits on this card =1 for low byte =2 for middle byte =3 for high byte
The function is of type void, so it will not return any values.
void ACC11E_SetControlWord(unsigned int BaseAddressOffset, unsigned int ByteSelect)
/* Input: BaseAddressOffset: IO Card Base Address offset ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits ControlWord: Control word value to which to set the card's Control Word */
{ volatile unsigned int *ioptr; // Create I/O pointer ioptr = piom + BaseAddressOffset/4 + 7;// Initialize I/O pointer to Control Word register *ioptr = 7 << (8*ByteSelect); // Write Control Word value to register return; }
Note
See Appendix for control word details and explanations.
ACC-11E User Manual
Using ACC-11E with Power UMAC 19
Function for Reading the State of Inputs: ACC11E_GetInputState()
Three parameters must be passed in the calling function:
BaseAddressOffset: One of the four base addresses (jumper selected) ACC-11E can take =0xA00000 =0xB00000 =0xC00000 =0xD00000
ByteSelect: The byte used (jumper selected) for the I/O bits on this card =1 for low byte =2 for middle byte =3 for high byte
InputNumber: The number of the Input pin whose state one desires to read or modify. Inputs are numbered 1–24 on ACC-11E
The function will return the state of the specified pin as an unsigned int: =0, pin is low =1, pin is high
unsigned int ACC11E_GetInputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int InputNumber)
/* Input:
------­BaseAddressOffset: I/O Card Base Address Offset InputNumber: Input Pin Number (1-24) ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits
Output:
------­State of the I/O pin specified*/
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation=0,ShiftValue; InputNumber--; ShiftValue = InputNumber%8 + 8*(ByteSelect-1); HighBitInCorrectLocation = 1 << ShiftValue; // Shift bit to that location ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += InputNumber/8; // Increment to register containing the I/O bit // Return state of I/O point return ((*ioptr >> 8) & HighBitInCorrectLocation) >> ShiftValue; }
Function for Reading the State of Outputs: ACC11E_GetOutputState()
Three parameters must be passed in the calling function:
BaseAddressOffset: One of the four base addresses (jumper selected) ACC-11E can take =0xA00000 =0xB00000 =0xC00000 =0xD00000
ACC-11E User Manual
Using ACC-11E with Power UMAC 20
ByteSelect: The byte used (jumper selected) for the I/O bits on this card =1 for low byte =2 for middle byte =3 for high byte
OutputNumber: The number of the Onput pin whose state one desires to read or modify. Outputs are numbered 1–24 on ACC-11E
The function will return the state of the specified pin as an unsigned int: =0, pin is low =1, pin is high
unsigned int ACC11E_GetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int OutputNumber)
/* Input:
------­BaseAddressOffset: I/O Card Base Address Offset InputNumber: Input Pin Number (1-24) ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits
Output:
------­State of the I/O pin specified*/
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation=0,ShiftValue; OutputNumber--; ShiftValue=OutputNumber%8 + 8*(ByteSelect-1); HighBitInCorrectLocation = 1 << ShiftValue; // Shift bit to that location ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += OutputNumber/8 + 3; // Increment to register containing the I/O bit // Return state of I/O point return ((*ioptr >> 8) & HighBitInCorrectLocation) >> ShiftValue; }
Function for Writing to Outputs: ACC11E_SetOutputState()
Four parameters must be passed in the calling function:
BaseAddressOffset: One of the four base addresses (jumper selected) ACC-11E can take =0xA00000 =0xB00000 =0xC00000 =0xD00000
ByteSelect: The byte used (jumper selected) for the I/O bits on this card =1 for low byte =2 for middle byte =3 for high byte
OutputNumber: The number of the Output pin whose state one desires to read or modify. Outputs are numbered 1–24 on ACC-11E
State: The state to which the desires to set the I/O pin. =0, pin is OFF (low=false) =1, pin is ON (high=true)
ACC-11E User Manual
Using ACC-11E with Power UMAC 21
The function is of type void, so it will not return any values.
void ACC11E_SetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int
OutputNumber, unsigned int State)
/* Input: BaseAddressOffset: I/O Card Base Address offset ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits PinNumber: Output Pin Number (1-24) State: Desired digital state of pin (0 = OFF, 1 = ON) */
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation; OutputNumber--; HighBitInCorrectLocation = 1 << (OutputNumber%8 + 8*ByteSelect); ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += OutputNumber/8 + 3; // Increment to register containing the I/O bit if(State==1) // If the user wants the pin to be ON (high true) {// Logical OR with the bit the user desires to activate *ioptr |= HighBitInCorrectLocation; } else { // Logical AND the register with a 0 in the desired location to bring the pin's state low // right shift to push out garbage in lowest 8 bits, then shift back up 8 bits to have // data in the proper location *ioptr &= (((~0)^HighBitInCorrectLocation) >> 8) << 8; }
return; }
ACC-11E User Manual
Using ACC-11E with Power UMAC 22
Header and Source File
The code for “acc11e.h” and “acc11e.c”, given below, contains the definitions for using the above
functions, prototypes, and the above listed functions. “acc11.h” should be included whenever using the
above ACC-11E C code. The files, acc11e.h and acc11e.c, must be put into the same folder as the C program (BGCPLC, RTICPLC, or Background C Program.
#include "acc11e.h"
Below is the full code for both acc11e.h and acc11e.c.
acc11e.h
#include <gplib.h> #include <RtGpShm.h> // Global Rt/Gp Shared memory pointers
//------------------------------------------------------------­// The following is a projpp created file from the User defines //-------------------------------------------------------------
#include "../../Include/pp_proj.h"
// Corresponds to E1 installed on ACC-11E, Turbo base address of $78C00
#define ACC11E_BaseAddressOffset_E1 0xA00000
// Corresponds to E2 installed on ACC-11E, Turbo base address of $78D00
#define ACC11E_BaseAddressOffset_E2 0xB00000
// Corresponds to E3 installed on ACC-11E, Turbo base address of $78E00
#define ACC11E_BaseAddressOffset_E3 0xC00000
// Corresponds to E4 installed on ACC-11E, Turbo base address of $78F00
#define ACC11E_BaseAddressOffset_E4 0xD00000
#define ON 1 // Assumes that (logic high)=true #define OFF 0 // Assumes that (logic low)=false #define ByteSelectLow 1 #define ByteSelectMiddle 2 #define ByteSelectHigh 3
void ACC11E_SetControlWord(unsigned int BaseAddressOffset, unsigned int ByteSelect); unsigned int ACC11E_GetInputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int InputNumber); unsigned int ACC11E_GetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int OutputNumber); void ACC11E_SetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int
OutputNumber, unsigned int State);
ACC-11E User Manual
Using ACC-11E with Power UMAC 23
acc11e.c
#include <gplib.h> #include <RtGpShm.h> // Global Rt/Gp Shared memory pointers
//------------------------------------------------------------­// The following is a projpp created file from the User defines //-------------------------------------------------------------
#include "acc11e.h"
void ACC11E_SetControlWord(unsigned int BaseAddressOffset, unsigned int ByteSelect)
/* Input: BaseAddressOffset: IO Card Base Address offset ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits ControlWord: Control word value to which to set the card's Control Word */
{ volatile unsigned int *ioptr; // Create I/O pointer ioptr = piom + BaseAddressOffset/4 + 7;// Initialize I/O pointer to Control Word register *ioptr = 7 << (8*ByteSelect); // Write Control Word value to register return; }
unsigned int ACC11E_GetInputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int InputNumber)
/* Input:
------­BaseAddressOffset: I/O Card Base Address Offset InputNumber: Input Pin Number (1-24) ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits
Output:
------­State of the I/O pin specified*/
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation=0,ShiftValue; InputNumber--; ShiftValue = InputNumber%8 + 8*(ByteSelect-1); HighBitInCorrectLocation = 1 << ShiftValue; // Shift bit to that location ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += InputNumber/8; // Increment to register containing the I/O bit // Return state of I/O point return ((*ioptr >> 8) & HighBitInCorrectLocation) >> ShiftValue; }
unsigned int ACC11E_GetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int OutputNumber)
/* Input:
------­BaseAddressOffset: I/O Card Base Address Offset InputNumber: Input Pin Number (1-24) ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits
Output:
------­State of the I/O pin specified*/
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation=0,ShiftValue; OutputNumber--; ShiftValue=OutputNumber%8 + 8*(ByteSelect-1); HighBitInCorrectLocation = 1 << ShiftValue; // Shift bit to that location ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += OutputNumber/8 + 3; // Increment to register containing the I/O bit // Return state of I/O point return ((*ioptr >> 8) & HighBitInCorrectLocation) >> ShiftValue;
ACC-11E User Manual
Using ACC-11E with Power UMAC 24
}
void ACC11E_SetOutputState(unsigned int BaseAddressOffset, unsigned int ByteSelect, unsigned int
OutputNumber, unsigned int State)
/* Input: BaseAddressOffset: I/O Card Base Address offset ByteSelect: =1 for lowest 8 bits, =2 for middle 8 bits, =3 for high 8 bits PinNumber: Output Pin Number (1-24) State: Desired digital state of pin (0 = OFF, 1 = ON) */
{ volatile unsigned int *ioptr; // Create I/O pointer // Compute location for high bit unsigned int HighBitInCorrectLocation; OutputNumber--; HighBitInCorrectLocation = 1 << (OutputNumber%8 + 8*ByteSelect); ioptr = piom + BaseAddressOffset/4; // Initialize pointer ioptr += OutputNumber/8 + 3; // Increment to register containing the I/O bit if(State==1) // If the user wants the pin to be ON (high true) {// Logical OR with the bit the user desires to activate *ioptr |= HighBitInCorrectLocation; } else { // Logical AND the register with a 0 in the desired location to bring the pin's state low // right shift to push out garbage in lowest 8 bits, then shift back up 8 bits to have // data in the proper location *ioptr &= (((~0)^HighBitInCorrectLocation) >> 8) << 8; }
return; }
ACC-11E User Manual
Using ACC-11E with Power UMAC 25
Example: Reading from and Writing to I/O Points on One ACC-11E with CPLC0
This example is for an ACC-11E at base address offset $A00000 with low-byte addressing.
Every scan, the following Background CPLC (BGCPLC0) reads all inputs on the ACC-11E and places them into P-Variables (P7000–P7023) for general purpose use. The BGCPLC will also read from P-Variables (P8000–P8023) and write their values to the output pins of ACC-11E as follows:
P-Variable Number
Pin
Number
P-Variable Number
Pin
Number
P7000
Input 0 P8000
Output 0
P7001
Input 1 P8001
Output 1
P7002
Input 2 P8002
Output 2
P7003
Input 3 P8003
Output 3
P7004
Input 4 P8004
Output 4
P7005
Input 5 P8005
Output 5
P7006
Input 6 P8006
Output 6
P7007
Input 7 P8007
Output 7
P7008
Input 8 P8008
Output 8
P7009
Input 9 P8009
Output 9
P7010
Input 10 P8010
Output 10
P7011
Input 11 P8011
Output 11
P7012
Input 12 P8012
Output 12
P7013
Input 13 P8013
Output 13
P7014
Input 14 P8014
Output 14
P7015
Input 15 P8015
Output 15
P7016
Input 16 P8016
Output 16
P7017
Input 17 P8017
Output 17
P7018
Input 18 P8018
Output 18
P7019
Input 19 P8019
Output 19
P7020
Input 20 P8020
Output 20
P7021
Input 21 P8021
Output 21
P7022
Input 22 P8022
Output 22
P7023
Input 23 P8023
Output 23
ACC-11E User Manual
Using ACC-11E with Power UMAC 26
Example Code: Using BGCPLC1 as an example.
This example assumes that “acc11e.h” and “acc11e.c” have already been placed into the same folder as
the BGCPLC under C LanguageCPLCsbgcplc00 in the Power PMAC IDE Solution Explorer.
#include <gplib.h> #include <stdio.h> #include <dlfcn.h>
#include "../../Include/pp_proj.h" #include "acc11e.h"
void user_plcc()
{ unsigned int ChannelNumber, ArrayIndex; // Allocate indices
for(ChannelNumber = 1; ChannelNumber < 25; ChannelNumber++) { ArrayIndex = ChannelNumber - 1; /* Copy the state of each input into P7000-P7023 */ pshm->P[7000 + ArrayIndex] = (double)ACC11E_GetInputState(ACC11E_BaseAddressOffset_E1, ByteSelectLow, ChannelNumber); /* Copy the state of P8000-P8023 into outputs 1-24 */ ACC11E_SetOutputState(ACC11E_BaseAddressOffset_E1, ByteSelectLow, ChannelNumber, (unsigned int)pshm->P[8000 + ArrayIndex]); } return; }
User Written Functions
User written functions can be created as an alternative to the above described functions. To do so:
Point a volatile unsigned int* pointer variable to the desired ACC-11E memory
location
Perform a whole 32-bit read of the memory location To read I/O states, mask and shift to read the appropriate bit in the word; i.e., the state of
the I/O point
To write I/O states, perform a read-modify-write to change the appropriate bit in the
word (e.g., to enable or disable an output)
Table of ACC-11E I/O Registers in C
To access the I/O pins in ACC-11E, point a volatile unsigned int* pointer to the following registers:
Base Address
A00000
Base Address
B00000
Base Address
C00000
Base Address
D00000
Register
Description
piom+0xA00000/4+0
piom+0xB00000/4+0
piom+0xC00000/4+0
piom+0xD00000/4+0
Inputs 1–8
piom+0xA00000/4+1
piom+0xB00000/4+1
piom+0xC00000/4+1
piom+0xD00000/4+1
Inputs 9–16
piom+0xA00000/4+2
piom+0xB00000/4+2
piom+0xC00000/4+2
piom+0xD00000/4+2
Inputs 17–24
piom+0xA00000/4+3
piom+0xB00000/4+3
piom+0xC00000/4+3
piom+0xD00000/4+3
Outputs 1–8
piom+0xA00000/4+4
piom+0xB00000/4+4
piom+0xC00000/4+4
piom+0xD00000/4+4
Outputs 9–16
piom+0xA00000/4+5
piom+0xB00000/4+5
piom+0xC00000/4+5
piom+0xD00000/4+5
Outputs 17–24
piom+0xA00000/4+7
piom+0xB00000/4+7
piom+0xC00000/4+7
piom+0xD00000/4+7
Control Word
ACC-11E User Manual
Using ACC-11E with Power UMAC 27
The useful data in each of these registers will be found in bits 8–32; the ACC-11E in Power PMAC does not use bits 0–7 of any of its registers. The base addresses (left to right four columns) and bytes (right end column) are selected with jumpers (see Addressing Setup and Jumper Settings section).
Only whole words at a time can be read in C; therefore, it is necessary to mask (using the bitwise “&
operator) and shift (using the “<<” and “>>” operators) to obtain bit values.
A set of pointer variables can be predefined to each I/O register. Alternatively, a set of functions can be created for reading and writing that will automatically point to, read from, and/or modify the appropriate memory location, given the card’s base address, byte select, and pin number.
Loading...
+ 63 hidden pages