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

The text of a manual · part 31 of 59

Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 16 - EAF Process Control Instructions, pages 252 to 259

Pages 252 to 259 of 490, from Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual

The original document is the PDF (2.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 Allen-Bradley 1772-LW /LWD, Allen-Bradley 1772-LWP, Allen-Bradley 1772-LX / LXP and Allen-Bradley 1772-LZP

Page 252

Chapter 16 EAF Process Control Instructions

Rung 5

This is the Data Address of the EAF instruction. It points the next value added to the calculation (present position). This is an optional display rung.

Rung 6

This rung displays the result of the EAF instruction. Words 040 through 043 are used for internal calculations and must not be manipulated. Word 044 contains the 3 most significant digits (fifth word of the EAF result) and word 045 contains the 3 least significant digits (sixth word of the EAF result). There is an implied decimal point between these two words (044 and 045). This is an optional display rung.

If you want to calculate the standard deviation for a new set of values, you must reset to zero: 1.

The accumulated value of the timer.

2.

The data in the data address word, rung 5 (047 in this example).

3.

The results in the result words, rung 6 (0044 and 0045 in this example).

The starting position of the File-to-Word Move must also be set to one. (The accumulated value of counter 034 in this example.) Six-Digit Functions Six-digit averaging and standard deviation ladder diagrams are very similar with the following exceptions: 1.

The averaging function number is 06 and standard deviation is 07.

2.

The first result word in 6-digit averaging occurs one word after the Result Address. The first eight words of the 6-digit standard deviation result are reserved for internal processor calculations, and thus the result occurs 9 decimal words after the Result Address.

16-41

Page 253

Chapter 16 EAF Process Control Instructions

Averaging The averaging instruction determines the arithmetic average of a group of six digit BCD values. The maximum number of values you can average is 999 or is limited by the data table area available. The Averaging instruction uses the formula: y + n

ȍ Xn i i+1 where: Xi = y = n = six digit signed BCD values the average of the values the number of values

Entry and Display of Input and Result Values Figure 16.12 shows one method you can use to enter values and display results of the six digit averaging. Although there are several techniques for accomplishing this, we chose Get instructions. Be careful not to select data and result addresses so that they overlap. Figure 16.12 6-Digit Averaging Ladder Diagram 150 0030 0031 G G 00 005 005

EXECUTE AUX FUNCTION FUNCTION NUMBER: 06 0040 DATA ADDR: 0160 RESULT ADDR: FILE TO FILE MOVE 0033 COUNTER ADDR: 001 POSITION: 021 FILE LENGTH: 0040-0064 FILE A: 0160-0204 FILE R: 021 RATE PER SCAN

0161 0162 0163 0164 G G G G 000 003 000 000

0033 EN 17 0033 DN 15 010 00

Here is a description of the ladder diagram. This programming example averages five values and stops.

16-42

Page 254

Chapter 16 EAF Process Control Instructions

Rung 1

The EAF rung calculates an average upon a false-to-true transition of bit 15000. This bit must remain energized until the done bit (bit 16115 in this example) is energized. Word 0030 the number of samples you want to average. Word 0031 the number of samples to sum per scan (from 1 to the total number of samples). The Data Address of the EAF (040) is reserved for the preset position. Each value to be averaged requires four consecutive data table words, beginning at word 041 in this example. The result address stores intermediate calculations in the first word (160) and the final result in words 161-163.

Rung 2

This rung is conditioned with a branch end to keep the File-to-File Move from becoming true. The data values to be averaged are in addresses 0041-0064. Each value uses 4 words (the format is xxx xxx . xxx xxx). The first word (0040) is reserved for present position value. (Optional display rung)

Rung 3

This rung displays the result of the EAF instruction. Word 0160 is an intermediate summation. You do not have to put this word in the rung. There is an implied decimal point between words 162 and 163. (Optional display rung)

If you want average a new set of values, you must do the following: 1.

Zero the data in the data address or present position word (040 in this example).

2.

Initiate a false to true transition of bit 15000.

16-43

Page 255

Chapter 16 EAF Process Control Instructions

Standard Deviation The Standard Deviation instruction determines the standard deviation of a group of six digit values. The maximum number of values the instruction can handle is 999 or is limited by the data table area available. Standard deviation instruction uses the formula:

y +

NJ

ȍ(x * x ) avg i n

Nj

1/2

2 where: xi xavg n

= the group of values whose standard deviation you want to calculate = the arithmetic average of the group of values = the number of values in the group

Entry and Display of Input and Result Values Figure 16.13 shows one method you can use to enter values and display results of the 6-digit standard deviation. Although there are several techniques for accomplishing this, we chose Get instructions. Figure 16.13 6-Digit Standard Deviation Ladder Diagram 150 0030 0031 G G 00 005 005

EXECUTE AUX FUNCTION FUNCTION NUMBER: 07 0040 DATA ADDR: 0160 RESULT ADDR: FILE TO FILE MOVE 0033 COUNTER ADDR: 001 POSITION: 021 FILE LENGTH: 0040-0064 FILE A: 0160-0204 FILE R: 021 RATE PER SCAN

0170 0171 0172 0173 G G G G 000 001 414 210

0033 EN 17 0033 DN 15 010 00

The first eight words after the result address are used for intermediate calculation. The standard deviation ladder diagram is the same as the ladder diagram for averaging with the exception already discussed. The result address stores intermediate calculations in the first 8 words (160-167) and the final result in the next 4 words (170-173, the implied decimal point is after word 171). The done bit is 17015.

16-44

Page 256

Chapter 16 EAF Process Control Instructions

If you want to calculate the standard deviation of a new set of values, you must:

Wall Clock/Calendar

1.

Reset to zero the data in the data address word (0040 in this example).

2.

Reset to zero the data in the result words (0160-0173) in this example).

3.

Initiate a false to true transition of bit 15000.

The EAF Wall Clock/Calendar function allows you to set time, date, leap year, and day of the week and read them for control and reporting purposes. Over the temperature range, the worst case clock accuracy will be +/– 10 minutes per month. Entry and Display of Set and Read Values Figure 16.14 shows a method for inserting set and read values. Be careful not to select set and read addresses so close together that they overlap. The first rung is the set rung. It contains Get instructions and an EAF block. You must use an Examine On for conditioning. Three addressed Gets contain set data. These Gets need not be consecutively addressed. However, they must be in the same rung as the EAF block and must immediately precede the EAF instruction. The data address in the EAF block must be 010 (the default value) or a run-time error results. (Word 010 is not altered by the instruction and can be used elsewhere in the program.) The result address is not used by the set instruction and can be any address. The second rung is the read rung. It contains three consecutively addressed Get instructions and an EAF block. The data address is not used by the Read instruction and can be any address. The result address is chosen to put read data into three consecutively addressed data table words. It points to the first of the three addresses.

16-45

Page 257

Chapter 16 EAF Process Control Instructions

Figure 16.14 EAF Set and Read Rung 011 00

020 G 010

021 022 G G 027 000

040 G 010

041 G 027

042 G 059

EXECUTE AUX FUNCTION FUNCTION NUMBER: 10 010 DATA ADDR: 200 RESULT ADDR: EXECUTE AUX FUNCTION FUNCTION NUMBER: 15 200 DATA ADDR: 040 RESULT ADDR:

Keystrokes Enter an EAF (like Figure 16.14) by performing the following steps. 1.

Enter the Examine On and Get instructions.

2.

Press [Shift] [EAF].

3.

Enter the appropriate function number (Table 16.A).

4.

Enter the data and result addresses.

5.

Enter the set values. The clock stops when you are setting any of the three functions.

Time Time is displayed in military format. For example: 15:00 hours is 3:00pm. 0AA 0BB 0CC 0AA = hours (00 – 23) 0BB = minutes (00 – 59) 0CC = seconds (00 – 59) Word format for Set and Read Time functions is the same. The only difference between the two EAFs is their function number: Set Time is 10 and Read Time is 15. Enter EAF rungs like those shown in Figure 16.15.

16-46

Page 258

Chapter 16 EAF Process Control Instructions

Figure 16.15 Set and Read Time Input and Display Rungs 011 00

020 G 010

021 022 G G 027 000

040 G 010

041 G 027

042 G 059

EXECUTE AUX FUNCTION FUNCTION NUMBER: 10 010 DATA ADDR: 010 RESULT ADDR: EXECUTE AUX FUNCTION FUNCTION NUMBER: 15 010 DATA ADDR: 040 RESULT ADDR:

Enter the time and set the condition bit (01100) true. Then, start the clock by resetting the condition bit. Dates Dates are entered as numbers. For example: November is displayed as 011. The year 1994 is displayed as 094. Word format for Set and Read Date functions are the same. The only difference between the two EAFs is their function number: Set Date is 11 and Read Date is 16. Enter EAF rungs like those shown in Figure 16.16. Figure 16.16 Set and Read Date Input and Display Rungs 011 00

020 G 011

021 022 G G 013 085

050 G 011

051 G 013

052 G 085

EXECUTE AUX FUNCTION FUNCTION NUMBER: 11 010 DATA ADDR: 010 RESULT ADDR: EXECUTE AUX FUNCTION FUNCTION NUMBER: 16 010 DATA ADDR: 050 RESULT ADDR:

Enter the date and set the condition bit (01100) true. Then, start the calendar by resetting the condition bit.

16-47

Page 259

Chapter 16 EAF Process Control Instructions

Leap Year and the Day of the Week Leap year is displayed as a number representing the number of years since the last leap year. For example: –[GET]–[GET]– 00A 00B In the first Get: 000 represents leap year 001 represents the first year since leap year 002 represents the second year since leap year 003 represents the third year since leap year In the second Get, the day of the week is displayed as a number from 1-7. You may set this Get to any number from 1-7. It increments each day at midnight. After it increments to 7, it starts over again at 1. Word format for set and read leap year and the day of the week functions are the same. The only difference between the two EAFs is their function number: set leap year and the day of the week is 12; read is 17. Enter EAF rungs like those shown in Figure 16.17. Figure 16.17 Set and Read Leap Year and the Day of the Week Input and Display Rungs 011 00

060 G 003

070 G 003

071 G 007

061 G 003

EXECUTE AUX FUNCTION FUNCTION NUMBER: 11 010 DATA ADDR: 010 RESULT ADDR: EXECUTE AUX FUNCTION FUNCTION NUMBER: 17 010 DATA ADDR: 070 RESULT ADDR:

Enter the Leap Year and Day of the Week values and set the condition bit (01100) true. Then, set the leap year and day of the week by resetting the condition bit (01100).

16-48