The text of a manual · part 12 of 31
DF1 Protocol and Command Set Reference Manual: 7 - Communication Commands, pages 88 to 97
Pages 88 to 97 of 251, from DF1 Protocol and Command Set Reference Manual
The original document is the PDF (2.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.
Filed in the catalog under the Allen-Bradley 5250-LP and Allen-Bradley 5250-MLP1
Page 88
Chapter
7
Communication Commands This chapter contains the format you should use when sending communication commands to Allen-Bradley processors. Use this key to help learn the conventions that depict the communication commands listed in this chapter: command command name This text describes how the command is used.
• PLC-3 processors that can use the command command format reply format
C command code function code
CMD
FNC command description data varies up to a maximum number of bytes
R
CMD each block represents one byte Unless otherwise stated, values are shown in hexadecimal.
"
Message packets The message packets for these commands include STS and possibly EXT STS fields that contain status and error code information. For more information on these bytes, see Chapter 8, “Message Packet Status Codes (STS, EXT STS).” Protecting data files from write access Using a PLC-5/11, -5/20, 5/30, -5/40, -5/60, or -5/80 processor, you can also specify privileges to protect data files from write access on a DH+ link. Using an SLC 5/02, 5/03, or 5/04 processor, you can specify static file protection to protect data files from write access from any of the communication channels. Important:
In some cases, switch settings on an interface module can disable a command at a PLC/SLC node. For additional information on your module’s switch settings, refer to that module’s user documentation. (For a list of related publications and products, refer to the preface of this manual.)
In addition to the commands listed in this chapter, we’ve also included examples: Section
Page
PLC-5 Type/Data Parameter Examples
7-36
SLC 500 Information
7-38
Reading and Writing SLC 500 Data (using SLC terminology)
7-38
Reading and Writing SLC 500 Data (using PLC-2 terminology)
7-38
Publication 1770-6.5.16 - October 1996
Page 89
7–2
Communication Commands
Use this table to locate commands you want to use. For additional information on the commands, refer to the specified pages. ATTENTION: Using command codes not listed will produce unpredictable results.
! Command
CMD
FNC
Processors Micro- Logix 1000 apply port configuration
0F
8F bit write
0F
02
0F
3A
0F
80 close file
0F
82 diagnostic status
06
03 disable forces
0F
41 disable outputs
07
00 download all request
0F
50 download completed
0F
52 download request
0F
05 echo
06
00 enable outputs
07
01 enable PLC scanning
07
03 enter download mode
07
04 enter upload mode
07
06 exit download/upload mode
07
05 file read
0F
04 file write
0F
03 get edit resource
0F
11 initialize memory
0F
57 modify PLC-2 compatibility file
0F
5E open file
0F
81
04
Â
0F
09 physical write
0F
08 protected bit write
02
 protected typed file read
0F
A7 change mode physical read
4 4 4 4
SLC 500
4 4 4 4
SLC 5/03
SLC 5/04
4
4 4 4 4 4
4
4
4
4
4
4
4
4 4
PLC-2
PLC-3
PLC-5 /250
4➄
4
4
4
4
4
7-4 7-4
4 4
7-5
4
4
4
4
4 4 4
4 4➄
4 4➄
4 4
4 4➄
4
4
4
4
4
7-6 7-6
4
4 4
➄
4 4
7-7 7-7 7-8 7-8
➄
7-9 7-9
4 4 4
4 4 4
7-6
➄
7-9 7-10 7-10
4 4
4 4➄
4 4 4➄ 4➄
4 4
PLC-5/ VME
7-5
7-10 7-11
4
7-11 7-12 7-12 7-13
4 4
4 4
À
This command cannot be executed by channel 0 of a PLC-5/11, -5/20, -5/30, -5/40, -5/60, or -5/80 processor.
Á
The following processors can initiate these commands but cannot respond to them: Processor Series/Revision Processors: Series A / revision M PLC-5/40, -5/40L, -5/60, -5/60L Series A / revision J PLC-5/30 Series A / revision H PLC-5/11, -5/20 Series B / revision J PLC-5/40, -5/40L, -5/60, -5/60L Series C / revision G PLC-5/11, -5/20, -5/20E, -5/30, -5/40, -5/40L, -5/V40, -5V40L, -5/60, -5/60L, -5/80, -5/80E, -5/V80
Â
This command has no FNC byte.
Ã
SLC 500 refers to any SLC 500, SLC 5/01, SLC 5/02, SLC 5/03, or SLC 5/04 processor.
➄
Receive only. Processors with this note cannot send the command; they receive the command from a computer.
Publication 1770-6.5.16 - October 1996
PLC-5
7-5
4 4 4 4
4
4
1774- PLC
Page
7-13
4 4 4
7-13 7-14
4
4
7-15 7-16
Page 90
Communication Commands
Command
CMD
FNC
Processors Micro- Logix 1000 protected typed file write protected typed logical read with three address fields protected typed logical write with three address fields
7–3
SLC 500Ã
SLC 5/03
SLC 5/04
1774- PLC
PLC-2
Page PLC-3
PLC-5
PLC-5 /250
PLC-5/ VME
0F
AF
4
4
4
4
0F
A2
4
4
4
4
4
7-17
0F
AA
4
4
4
4
4Á
7-18 protected write
00
 read bytes physical
0F
17 read diagnostic counters
06
01 reset diagnostic counters
06
07 read link parameters
06
09 read-modify-write
0F
26 read-modify-write N
0F
79 read section size
0F
29 restart request
0F
0A return edit resource
0F
12 set CPU mode
0F
3A set data table size
06
08 set ENQs
06
06 set link parameters
06
0A set NAKs
06
05 set timeout
06
04 set variables
06
02 shutdown
0F
07 typed read
0F
68 typed write
0F
67 unprotected bit write
05
 unprotected read
01
 unprotected write
08
 upload all request (upload)
0F
53 upload completed
0F
55 upload
0F
06 word range read
0F
01 word range write
0F
00 write bytes physical
0F
18
7-16
4 4 4 4
4 4 4
4 4 4
4 4 4
4 4
4 4 4
4 4 4
4
4
4 4
4
4 4
4
4 4
4
4 4
4 4
4 4
4 4
7-19
4➄ 4➄ 4➄
4
7-19 7-19 7-22 7-20
4 4
4
4 4 4 4
4
4 4➄ 4➄ ➄
4
7-20 7-21 7-22 7-23
4
4➄
4
4➀
4➄
4 4 4 4
4 4➀ 4➀
4 4➄ 4➄
4 4 4 4 4 4 4
4 4 4 4 4 4➄ 4➄
4 4 4
4 4 4➄
4
7-24 7-26 7-24 7-25 7-25
4 4 4
4 4 4
4 4 4
À
This command cannot be executed by channel 0 of a PLC-5/11, -5/20, -5/30, -5/40, -5/60, or -5/80 processor.
Á
The following processors can initiate these commands but cannot respond to them: Processor Series/Revision Processors: Series A / revision M PLC-5/40, -5/40L, -5/60, -5/60L Series A / revision J PLC-5/30 Series A / revision H PLC-5/11, -5/20 Series B / revision J PLC-5/40, -5/40L, -5/60, -5/60L Series C / revision G PLC-5/11, -5/20, -5/20E, -5/30, -5/40, -5/40L, -5/V40, -5V40L, -5/60, -5/60L, -5/80, -5/80E, -5/V80
Â
This command has no FNC byte.
Ã
SLC 500 refers to any SLC 500, SLC 5/01, SLC 5/02, SLC 5/03, or SLC 5/04 processor.
➄
Receive only. Processors with this note cannot send the command; they receive the command from a computer.
4 4 4 4 4 4
➀
7-25
➄
7-27 7-27 7-28
4 4
7-28 7-30 7-30 7-31 7-32
4 4
7-33 7-34 7-34 7-34 7-35
4
7-35
Publication 1770-6.5.16 - October 1996
Page 91
7–4
Communication Commands apply port configuration Changes the configuration of some or all ports. If there are no parameters, changes all ports. This command reconfigures the ports based on information in the processor’s physical memory. It is normally used as part of a physical download operation where the processor memory and configuration are to be fully restored. A programming device must have the edit resource to use this command.
• PLC-5 • PLC-5/VME • SLC 5/03 • SLC 5/04
C
DST PSN SRC PSN CMD STS 0F
R
LNH LNH CMD DST PSN SRC PSN STS HI LO 4FH
TNS
FNC 8F
A
TNS
B EXT Data STS
A - number of ports to change is a one-byte field 00 means ports." B - port numbers in this list are two bytes each, low byte first. Data - returned only if there is an EXT STS error 12H. It contains the file and element that relate to the error. LNH - length of the optional portion of the reply packet in bytes.
"
First four words of apply port configuration The first four words are currently unused and unexamined. To assure compatibility with any future use of these bytes, they should be initialized to 0. DST, PSN, and SRC are included for reference only.
bit write (write bit) Modifies the bits at the address specified by either a word symbol, a file symbol plus a word offset, or a logical address. This address must point to a word within a file. The function code is 2. Unlike unprotected writes and protected bit writes, this command can change the bits in a single word only.
• PLC-3 • PLC-5 (receive only) • PLC-5/250
C
DST SRC
CMD 0F STS
TNS
FNC 02
R
SRC DST
CMD 4F STS
TNS
EXT STS
PLC-3 Logical Address (2 - 51 bytes.)
Set Mask
The EXT STS field may be attached to the reply packet only when there is an error.
Publication 1770-6.5.16 - October 1996
Reset Mask
Page 92
Communication Commands
7–5 change mode MicroLogix 1000 Changes the mode of the MicroLogix processor.
• MicroLogix 1000 • SLC 500 • SLC 5/03 • SLC 5/04
C
DST SRC
CMD STS 0F
TNS
FNC Mode 3A xxh
R
SRC DST
CMD STS 4F
TNS
EXT STS
Mode - 01 = change to Program mode (REM program) 02 = change to Run mode The EXT STS field may be attached to the reply packet only when there is an error.
SLC 500 Changes the mode of the SLC processor. For an SLC 5/03 or SLC 5/04 processor, change mode only works when the keyswitch is in the REM position. C
DST SRC
CMD STS 0F
TNS
FNC Mode 80 xxh
R
SRC DST
CMD STS 4F
TNS
EXT STS
Mode - 01 = change to PROGRAM mode (REM program) 06 = change to RUN mode (REM Run) 07 = change to TEST-Cont. Scan Mode (REM Test) 08 = change to TEST-Single Scan Mode (REM Test) 09 = change to TEST-Debug Single Step (REM Test). SLC 500 and SLC 5/01 processors do not support 09 mode The EXT STS field may be attached to the reply packet only when there is an error.
close file
• SLC 500 • SLC 5/03 • SLC 5/04
Closes a file in an SLC 500 processor. When closing program file 0 (in an SLC 500, SLC 5/01, or SLC 5/02 processor) after it has been opened for write, the SLC processor calculates the LRC for the directory, data and internal files. C
DST SRC CMD STS 0F
R
SRC DST
TNS
FNC 82
Tag
CMD EXT 4F STS STS
The EXT STS field may be attached to the reply packet if there is an error.
Publication 1770-6.5.16 - October 1996
Page 93
7–6
Communication Commands diagnostic status Reads a block of status information from an interface module. The reply contains the status information in its DATA field. The status information varies with the type of interface module. (For additional information, see Chapter 10, “Diagnostic Status Information.”) • 1774-PLC • MicroLogix 1000 • PLC-2 • PLC-3 • PLC-5 • PLC-5/250 (receive only) • SLC 500 • SLC 5/03 • SLC 5/04
C
DST SRC CMD STS 06
TNS
FNC 03
R
SRC DST CMD STS 46
TNS
Data (max. 244 bytes)
disable forces Disables the forcing function for I/O. All forcing data is ignored, but remains intact.
• MicroLogix 1000 • PLC-5 • PLC-5/250 (receive only) • SLC 500 • SLC 5/03 • SLC 5/04
C
DST SRC CMD STS 0F
TNS
FNC 41
R
SRC DST CMD STS 4F
TNS
EXT STS disable outputs • 1774-PLC
Publication 1770-6.5.16 - October 1996
Turns off all of the 1774-PLC processor’s outputs. Use this command to disable the outputs before sending a physical write. C
DST SRC CMD STS 07
TNS
R
SRC DST CMD STS 47
TNS
FNC 00
Page 94
Communication Commands
7–7 download all request (download)
• PLC-5 • PLC-5/250 (receive only) • PLC-5/VME
Places a PLC-5 processor in Download mode before downloading a complete system. A “no privilege” error is returned if the requestor does not have privilege to place the processor in Download mode. This error occurs when: • the processor is in Run or Remote Run mode (must be in Program or Remote Program mode) • the processor is being edited • some other node is already downloading to the processor C
DST SRC CMD STS 0F
TNS
FNC 50
R
SRC DST
CMD STS 4F
TNS
EXT STS
The EXT STS field may be attached to the reply packet only when there is an error.
download completed Use after downloading a complete system to place the processor back in the mode that it was in. (For PLC-5 processors, it returns to the mode it was in prior to executing download all request.) • PLC-5 • PLC-5/250 (receive only) • PLC-5/VME • SLC 500 • SLC 5/03 • SLC 5/04
C
DST SRC CMD STS 0F
TNS
FNC 52
R
SRC DST
CMD STS 4F
TNS
EXT STS
The EXT STS field may be attached to the reply packet only when there is an error.
Publication 1770-6.5.16 - October 1996
Page 95
7–8
Communication Commands download request (download privilege)
• PLC-3
Used by a computer to inform an interface module that it wants to perform a download. If the module grants the download privilege, the computer may begin issuing physical reads or physical writes. If another node already has the download privilege, the second node is denied the privilege. Before performing an upload/download, issue diagnostic status to get the last word of memory to read or write. Bytes 11-14 in the diagnostic status reply return E60.0.0 - this is the start of unused memory. Start your read or write at 00 00 00 00. C
DST SRC
CMD STS 0F
TNS
FNC 05
R
SRC DST
CMD STS 4F
TNS
EXT STS
The EXT STS field may be attached to the reply packet only when there is an error.
echo Checks the integrity of transmissions over the communication link. The command message transmits up to 243 bytes of data to a node interface module. The receiving module should reply to this command by transmitting the same data back to the originating node. • 1774-PLC • MicroLogix 1000 • PLC-2 • PLC-3 • PLC-5 • PLC-5/250 (receive only) • SLC 500 • SLC 5/03 • SLC 5/04
Publication 1770-6.5.16 - October 1996
C
DST SRC CMD STS 06
TNS
FNC 00
R
SRC DST CMD STS 46
TNS
Data (max. 243 bytes)
Data (max. 243 bytes)
For SLC 500, SLC 5/01, and SLC 5/02 processors, maximum data size is 95 bytes; for SLC 5/03 and SLC 5/04 processors, maximum data size is 236 bytes.
Page 96
Communication Commands
7–9 enable outputs • 1774-PLC
Returns control of the outputs to the 1774-PLC ladder diagram program. Use this command to cancel the effect of disable outputs. C
DST SRC CMD STS 07
TNS
R
SRC DST CMD STS 47
TNS
FNC 01 enable PLC scanning Restarts the 1774-PLC processor’s program scanner after a physical write has been performed.
• 1774-PLC
C
DST SRC CMD STS 07
TNS
R
SRC DST CMD STS 47
TNS
FNC 03 enter download mode Puts the PLC-2 processor in the download mode. Use this command on a PLC-2 node before sending a physical write to the node. • PLC-2
C
DST SRC CMD STS 07
TNS
R
SRC DST
CMD STS 47
TNS
Important:
FNC 04
For early revisions of the 1771-KA2 and the industrial terminal, when you send an enter download/upload mode, the industrial terminal port is disabled until you send an exit download/upload mode. When the industrial terminal port is disabled, the industrial terminal enters the mode select state. To leave this state, you must manually select a mode at the industrial terminal.
If you are using
Use
•1771-KA/A revision F •1771-KG/A enter download mode before sending physical read commands.
•1771-KA2/B •1771-KG/B or later enter upload mode before sending physical read commands.
Publication 1770-6.5.16 - October 1996
Page 97
7–10
Communication Commands enter upload mode Puts the PLC-2 processor in Upload mode. Use this command on a PLC-2 node before sending a physical read to the node. • PLC-2
C
DST SRC CMD STS 07
TNS
R
SRC DST CMD STS 47
TNS
Important:
FNC 06
When you send an enter upload mode, the industrial terminal port is disabled until you send an exit download/upload mode.
exit download/upload mode Takes the PLC-2 processor out of the Upload or Download mode. Use this command to restart the PLC-2 processor after performing an upload or download operation.
• PLC-2
Important:
Do not send this command after a download/upload command; you must recycle power to the 1771-KA, -KA2, -KG, or 1785-KA3 module to enable industrial terminal communication.
C
DST SRC CMD STS 07
TNS
R
SRC DST CMD STS 47
TNS
FNC 05
You must remove the temporary End statement from the beginning of the program and re-insert the first byte of the program.
file read (read file) Reads data, starting at a file symbol or a block address. This starting address must point to a file of words. • PLC-3 • PLC-5/250
C
DST SRC
CMD 0F STS
TNS
FNC 04
R
SRC DST
CMD 4F STS
TNS
Data - max. 244 bytes or 122 words)
Packet Offset
Total Trans
The DATA field may be replaced by an EXT STS field if there is an error.
Publication 1770-6.5.16 - October 1996
Logical Address (2 - 51 bytes.)
Size