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

The text of a manual · part 15 of 21

Remote I/O Scanner 1747-SN User Manual: M0 - M1 Files and G Files

Pages 113 to 126 of 171, from Remote I/O Scanner 1747-SN User Manual

The original document is the PDF (1.1 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 1747-SN

Page 113

Appendix

B

M0 - M1 Files and G Files

This appendix contains important information about M0-M1 files and G files. The information is general in nature and supplements specific information contained in earlier chapters of this manual.

M0 - M1 Files

M0 and M1 files are data files that reside in specialty I/O modules only. There is no image for these files in the processor memory. The application of these files depends on the function of the particular specialty I/O module. With respect to the SLC processor (SLC 5/02 or later), the M0 file is a module output file (a write only file) and the M1 file is a module input file (a read only file). The opposite is true for specialty I/O modules, where the M0 file is a read only file, and the M1 file is a write only file. M0 and M1 files can be addressed in your ladder program and they can also be acted upon by the specialty I/O module - independent of the processor scan. It is important that you keep the following in mind in creating and applying your ladder logic:

IMPORTANT

1

During the processor scan, the ladder program can address M0 and M1 data with bit, word, or file instructions. Each time an M0-M1 file address is encountered in the program, an immediate data transfer to or from the specialty I/O module occurs. The impact these immediate data transfers have on processor scan time is described in Appendix D of the SLC 500 Instruction Set Reference Manual, Publication 1747-RM001.

Publication 1747-UM013B-EN-P - January 2005

Page 114

B-2

M0 - M1 Files and G Files

Addressing M0-M1 Files The addressing format for M0 and M1 files is below:

Mf:e.s/b Where M = module f = file type (0 or 1) e = slot (1-30) s = word (0 to max. supplied by module) b = bit (0-15)

Restrictions on Using M0-M1 Data File Addresses M0 and M1 data file addresses can be used in all instructions except the OSR instruction and the instruction parameters noted below:

Instruction

Parameter (uses file indicator #)

BSL, BSR

File (bit array)

SQO, SQC, SQL

File (sequencer file)

LFL, LFU

LIFO (stack)

FFL, FFU

FIFO (stack)

Monitoring Bit Addresses For SLC 5/02 processors, the M0/M1 Monitoring option is always disabled. (This processor does not allow you to monitor the actual state of each addressed M0/M1 address.)

M0/M1 Monitoring Option Disabled When you monitor a ladder program in the Run or Test mode with the M0/M1 Monitoring option disabled, the following bit instructions, addressed to an M0 or M1 file, are indicated as false regardless of their actual true/false logical state.

Publication 1747-UM013B-EN-P - January 2005

Page 115

M0 - M1 Files and G Files

Mf:e.s ] [ b

Mf:e.s ]/[ b

Mf:e.s ( ) b

Mf:e.s (L) b

B-3

Mf:e.s (U) b f = file (0 or 1) When youWhen are monitoring ladder program the Runprogram or Test mode, theRun display does not showthe these you arethemonitoring the in ladder in the or Test mode, instructions as being true display when thedoes processor theminstructions as true. APS or HHT not evaluates show these as being true when the processor evaluates them as true.

If you need to show the state of the M0 or M1 addressed bit, you can transfer the state to an internal processor bit. This is illustrated below, where an internal processor bit is used to indicate the true/false state of a rung.

B3 ] [

EQU

B3 ] [ 0

1

EQUAL Source A Source B

N7:12 N7:3

M0:3.0 ( ) 1

This rung will not show its true rung state because the EQU instruction is always shown as true and the M0 instruction is always shown as false.

B3 ] [

EQU

B3 ] [ 0

1

EQUAL Source A Source B

N7:12 N7:3

B3 ( ) 2 M0:3.0 ( ) 1

OTE instruction B3/2 has been added to the rung. This instruction shows the true or false state of the rung.

M0/M1 Monitoring Option Enabled

IMPORTANT

This option is not supported by the SLC 5/02 processor.

The SLC 5/03, SLC 5/04 and SLC 5/05 processors allows you to monitor the actual state of each addressed M0/M1 address (or data table). The highlighting appears normal when compared to the other processor data files. The processor’s performance will be degraded to the degree of M0/M1 referenced screen data. For example, if your screen has only one M0/M1 element, degradation will be minimal. If your screen has 69 M0/M1 elements, degradation will be significant.

Publication 1747-UM013B-EN-P - January 2005

Page 116

B-4

M0 - M1 Files and G Files

Transferring Data Between Processor Files and M0 or M1 Files The processor does not contain an image of the M0 or M1 file. As a result, you must edit and monitor M0 and M1 file data via instructions in your ladder program. For example, you can copy a block of data from a processor data file to an M0 or M1 data file or vice versa using the COP instruction in your ladder program. The COP instructions below copy data from a processor bit file and integer file to an M0 file. For the example, assume the data is configuration information affecting the operation of the specialty I/O module.

S:1 ] [ 15 First scan bit. It makes this rung true only for the first scan after entering Run mode.

COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 16

COP COPY FILE Source #N7:0 Dest #M0:1.16 Length 27

The COP instruction below copies data from an M1 data file to an integer file. This technique is used to monitor the contents of an M0 or M1 data file indirectly, in a processor data file.

COP COPY FILE Source #M1:4.3 Dest #N10:0 Length 6

Access Time During the program scan, the processor must access the specialty I/O card to read/write M0 or M1 data. This access time must be added to the execution time of each instruction referencing M0 or M1 data. For the SLC 5/03, SLC 5/04 and SLC 5/05 processors, the instruction types vary in their execution times. The following table shows approximate access times per instruction or word of data for the SLC 5/02, SLC 5/03, SLC 5/04 and SLC 5/05 processors.

Publication 1747-UM013B-EN-P - January 2005

Page 117

M0 - M1 Files and G Files

B-5

Processor

Instruction Type

Access Time per Bit Instruction or Word of Data

Access Time per Multi-Word Instruction

SLC 5.02 Series B

All Types(1)

1930 µs

1580 µs plus 670 µs per word

SLC 5/02 Series C

All Types(1)

1160 µs

950 µs plus 400 µs per word

SLC 5/03 (All Times)

XIC or XIO

782 µs

--

OTU, OTE, or OTL

925 µs

--

COP to M file

--

772 µs plus 23 µs per word

COP from M file

--

760 µs plus 22 µs per word

FLL

--

753 µs plus 30 µs per word

MVM to M file

894 µs

-- any source or Destination M file address

730 µs

--

XIC or XIO

743 µs

--

OTU, OTE, or OTL

879 µs

--

COP to M file

--

735 µs plus 23 µs per word

COP from M file

--

722 µs plus 22 µs per word

FLL

--

716 µs plus 30 µs per word

MVM to M file

850 µs

-- any source or Destination M file address

694 µs

--

SLC 5/04 OS 400 SLC 5/05

(1) Except the OSR instruction and the instruction parameters noted on page B-2.

SLC 5/02 Processor Example

M0:2.1 ] [ 1

M1:3.1 ]/[ 1

M0:2.1 ( ) 10

If you are using a SLC 5/02 Series B processor, add 1930 µs to the program scan time for each bit instruction addressed to an M0 or M1 data file. If you are using a SLC 5/03 Series C processor, add 1160 µs.

Publication 1747-UM013B-EN-P - January 2005

Page 118

B-6

M0 - M1 Files and G Files

COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 34

If you are using a SLC 5/02 Series B processor, add 1580 µs plus 670 µs per word of data addressed to the M0 or M1 file. As shown above, 34 words are copied from #B3:0 to M0:1.0. Therefore, this adds 24360 µs to the scan time of the COP instruction. If you are using a SLC 5/02 Series C processor, add 950 µs plus 400 µs per word. This adds 14550 µs to the scan time of the COP instruction.

SLC 5/03 Processor Example

COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 34

The SLC 5/03 processor access times depend on the instruction type. Consult the table on B-4 for the correct access times to add. As an example, if you use a COP to M file instruction like the one shown above, add 772 µs plus 23 µs per word. This adds 1554 µs to the SLC 5/03 processor scan time due to the COP instruction.

SLC 5/04 and SLC 5/05 Processor Example

COP COPY FILE Source #B3:0 Dest #M0:1.0 Length 34

The SLC 5/04 and SLC 5/05 processors access times depend on the instruction type. Consult the table on B-4 for the correct access times to add. As an example, if you use a COP to M file instruction like the one shown above, add 735 µs plus 23 µs per word. This adds 1517 µs to the processor scan time due to the COP instruction.

Publication 1747-UM013B-EN-P - January 2005

Page 119

M0 - M1 Files and G Files

B-7

Minimizing the Scan Time You can keep the processor scan time to a minimum by economizing on the use of instructions addressing the M0 or M1 files. For example, XIC instruction M0:2.1/1 is used in rungs 1 and 2 of the figure below, adding approximately 2 ms to the scan time if you are using a SLC 5/02 Series B processor.

1

M0:2.1 ] [ 1

2

B3 ] [ 12

B3 ( ) 10 B3 ( ) 14

M0:2.1 ] [ 1

XIC instructions in rungs 1 and 2 are addressed to the M0 data file. Each of these instructions adds approximately 1 ms to the scan time (SLC 5/02 Series B processor).

In the equivalent rungs of the figure below, XIC instruction M0:2.1/1 is used only in rung 1, reducing the SLC 5/02 scan time by approximately 1 ms.

1

M0:2.1 ] [ 1

2

B3 ] [ 12

B3 ( ) 10 B3 ] [ 10

B3 ( ) 14

These rungs provide equivalent operation to those of figure A by substituting XIC instruction B3/10 for XIC instruction M0:2.1/1 in rung 2. Scan time is reduced by approximately 1 ms (Series B processor).

The following figure illustrates another economizing technique. The COP instruction addresses an M1 file, adding approximately 4.29 ms to the scan time if you are using a SLC 5/02 Series B processor. Scan time economy is realized by making this rung true only periodically, as determined by clock bit S:4/8. (Clock bits are discussed in Appendix B of the SLC 500 Instruction Set Reference Manual, Publication 1747-RM001.) A rung such as this might be used when you want to monitor the contents of the M1 file, but monitoring need not be on a continuous basis.

S:4/8 causes the #M1:4.3 file to update the #N10:0 file every 2.56 seconds.

S:4 ] [ 8

B11 [OSR] 0

COP COPY FILE Source #M1:4.3 Dest #N10:0 Length 6

Publication 1747-UM013B-EN-P - January 2005

Page 120

B-8

M0 - M1 Files and G Files

Capturing M0-M1 File Data The first two ladder diagrams in the last section illustrate a technique allowing you to capture and use M0 or M1 data as it exists at a particular time. In the first figure, bit M0:2.1/1 could change state between rungs 1 and 2. This could interfere with the logic applied in rung 2. The second figure avoids the problem. If rung 1 is true, bit B3/10 captures this information and places it in rung 2. In the second example of the last section, a COP instruction is used to monitor the contents of an M1 file. When the instruction goes true, the 6 words of data in file #M1:4.3 is captured as it exists at that time and placed in file #N10.0.

Specialty I/O Modules with Retentive Memory Certain specialty I/O modules retain the status of M0-M1 data after power is removed. See your specialty I/O module user’s manual. This means that an OTE instruction having an M0 or M1 address remains on if it is on when power is removed. A “hold-in” rung as shown below will not function as it would if the OTE instruction were non-retentive on power loss. If the rung is true at the time power is removed, the OTE instruction latches instead of dropping out; when power is again applied, the rung will be evaluated as true instead of false.

B3 ] [ 0

M0:2.1 ( ) 1

M0:2.1 ] [ 1

ATTENTION

When used with a speciality I/O module having retentive outputs, this rung can cause unexpected start-up on powerup.

You can achieve non-retentive operation by unlatching the retentive output with the first pass bit at powerup:

Publication 1747-UM013B-EN-P - January 2005

Page 121

M0 - M1 Files and G Files

S:1 ] [ 15

M0:2.1 (U) 1

B3 ] [

M0:2.1 ( ) 1

0

B-9

This rung is true for the first scan after powerup to unlatch M0:2.1/1.

M0:2.1 ] [ 1

G Files

Some specialty I/O modules use G (confiGuration) files (indicated in the specific specialty I/O module user’s manual). These files can be thought of as the software equivalent of DIP switches. The content of G files is accessed and edited offline under the I/O Configuration function. You cannot access G files under the Monitor File function. Data you enter into the G file is passed on to the specialty I/O module when you download the processor file and enter the REM Run or any one of the REM Test modes.

Configuring G Files using RSLogix 500

TIP

The G File configuration of the 1747-SN module is streamlined in RSLogix. You do not have to configure the file at the bit level. RSLogix provides a window menu that provides the configuration options.

1. Access the I/O configuration menu in RSLogix.

Publication 1747-UM013B-EN-P - January 2005

Page 122

B-10

M0 - M1 Files and G Files

Figure B.1 I/O Configuration Screen

2. Click the “Adv Config” button to access the next menu. You can edit the number of words in each category. Although, it is recommended to leave them at default values unless specific project considerations require changes. See Chapter 4 for more information on configuring the module. Figure B.2 Advanced Configuration Menu

Publication 1747-UM013B-EN-P - January 2005

Page 123

M0 - M1 Files and G Files

B-11

3. Click “Edit G Data” to access the setup screen for the module. Figure 2.3 Scanner G File Configuration Options

Once you understand how the modules map Remote I/O locations, this menu is used to set up the Scanner. First select a group number in a logical rack. Then select the type of addressing for that group, either ¼ rack, ½ rack ¾ rack of full rack.

Publication 1747-UM013B-EN-P - January 2005

Page 124

B-12

M0 - M1 Files and G Files

Figure 2.4 Rack Configurations

Once you select the group and type of addressing, the I/O word layout for the group is shown.

Publication 1747-UM013B-EN-P - January 2005

Page 125

M0 - M1 Files and G Files

B-13

Figure 2.5 Example of a Half-Rack Addressing in Group 1

After all devices have been properly mapped, click OK and the G file is automatically configured. This procedure eliminates the bit by bit process needed to configure the G file with other programming tools.

Publication 1747-UM013B-EN-P - January 2005

Page 126

B-14

M0 - M1 Files and G Files

Editing G File Data Data in the G file must be edited according to your application and the requirements of the specialty I/O module. You edit the data offline under the I/O configuration function only. With the decimal and hex/bcd formats, you edit data at the word level: • G1:1 = 234 (decimal format) G1:1 = 00EA (hex/bcd format) With the binary format, you edit data at the bit level: • G1/19 = 1

IMPORTANT

Publication 1747-UM013B-EN-P - January 2005

Word 0 of the G file is configured automatically by the processor according to the particular specialty I/O module. Word 0 cannot be edited.