The text of a manual · part 4 of 12
CM52 Remote I/O Interface Module Operator's Manual, pages 31 to 40
Pages 31 to 40 of 116
The original document is the PDF (886 KB). 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 Datalogic CM52
Page 31
Flag I/O addresses for quarter-rack CM52 starting at first quarter. Discrete Output Data (Command Flags) Word
LSB
O:030/7
MSB
LSB
O:030/6
O:030/5
O:030/4
O:030/3
O:030/2
O:030/1
O:030/0
O:030/17 O:030/16 O:030/15
O:030/14
O:030/13
O:030/12 O:030/11 O:030/10
O:031/7
O:031/4
O:031/3
O:031/2
0
Word
O:031/6
O:031/5
O:031/1
O:031/0
1 Dig Out 2 Dig 0ut 1 Init MSB
O:031/17 O:031/16 O:031/15
O:031/14
O:031/13
O:031/12 O:031/11 O:031/10
Discrete Output Data (Response Flags) Word
LSB
I:030/7
I:030/6
I:030/5
I:030/4
I:030/3
I:030/2
I:030/1
I:030/0
MSB
I:030/17
I:030/16
I:030/15
I:030/14
I:030/13
I:030/12
I:030/11
I:030/10
Task 3
Task 2
Task 1
Task 0
Done
Done
Done
Done I:031/0
0
Word
LSB
I:031/7
I:031/6
I:031/5
I:031/4
I:031/3
I:031/2
I:031/1
Dig In 2
Dig In 1
Error
Timeout
Done
Ack
1
MSB
I:031/17
I:031/16
I:031/15
I:031/14
I:031/13
I:031/12
I:031/11
I:031/10
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
Addr 07
Addr 06
Addr 05
Addr 04
Addr 03
Addr 02
Addr 01
Addr 00
Data
Data
Data
Data
Data
Data
Data
Data
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Flag I/O addresses for half-rack CM52 starting at the second quarter. Discrete Output Data (Command Flags) Word LSB
O:032/7
O:032/6
O:032/5
O:032/4
O:032/3
O:032/2
O:032/1
O:032/0
O:032/17
O:032/16
O:032/15
O:032/14
O:032/13
O:032/12 O:032/11 O:032/10
O:033/7
O:033/6
O:033/5
O:033/4
O:033/3
O:033/2
0 MSB Word LSB
O:033/1
O:033/0
1 Dig Out 2 Dig 0ut 1 Init MSB Word LSB
O:033/17
O:033/16
O:033/15
O:033/14
O:033/13
O:033/12 O:033/11 O:033/10
O:034/7
O:034/6
O:034/5
O:034/4
O:034/3
O:034/2
O:034/17
O:034/16
O:034/15
O:034/14
O:034/13
O:034/12 O:034/11 O:034/10
O:035/7
O:035/6
O:035/5
O:035/4
O:035/3
O:035/2
O:035/17
O:035/16
O:035/15
O:035/14
O:035/13
O:035/12 O:035/11 O:035/10
O:034/1
O:034/0
2 MSB Word LSB
O:035/1
O:035/0
3 MSB
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
25
Page 32
Discrete Output Data (Command Flags) Word
LSB
I:032/7
I:032/6
I:032/5
I:032/4
I:032/3
I:032/2
I:032/1
I:032/0
MSB
I:032/17
I:032/16
I:032/15
I:032/14
I:032/13
I:032/12
I:032/11
I:032/10
Task 3
Task 2
Task 1
Task 0
Done
Done
Done
Done
0
Word
LSB
I:033/7
I:033/6
I:033/5
I:033/4
I:033/3
I:033/2
I:033/1
I:033/0
Dig In 2
Dig In 1
Error
Timeout
Done
Ack
1
MSB
Word
LSB
I:033/17
I:033/16
I:033/15
I:033/14
I:033/13
I:033/12
I:033/11
I:033/10
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
Addr 07
Addr 06
Addr 05
Addr 04
Addr 03
Addr 02
Addr 01
Addr 00
Data
Data
Data
Data
Data
Data
Data
Data
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Ready
I:034/7
I:034/6
I:034/5
I:034/4
I:034/3
I:034/2
I:034/1
I:034/0
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
Addr 15
Addr 14
Addr 13
Addr 12
Addr 11
Addr 10
Addr 09
Addr 08
Data
Data
Data
Data
Data
Data
Data
Data
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Ready
I:034/17
I:034/16
I:034/15
I:034/14
I:034/13
I:034/12
I:034/11
I:034/10
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
Addr 23
Addr 22
Addr 21
Addr 20
Addr 19
Addr 18
Addr 17
Addr 16
Data
Data
Data
Data
Data
Data
Data
Data
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Ready
I:035/7
I:035/6
I:035/5
I:035/4
I:035/3
I:035/2
I:035/1
I:035/0
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
MUX32
Addr 31
Addr 30
Addr 29
Addr 28
Addr 27
Addr 26
Addr 25
Addr 24
Data
Data
Data
Data
Data
Data
Data
Data
Ready
Ready
Ready
Ready
Ready
Ready
Ready
Ready
I:035/17
I:035/16
I:035/15
I:035/14
I:035/13
I:035/12
I:035/11
I:035/10
2
MSB
Word
LSB
3
MSB
26
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
Page 33
3.2.2 Command and Response Parameters (Block Data) The parameter portion of the RF commands is transmitted using the PLC Block Transfer function. This is necessary because the number of data bytes required for an entire command and response exceeds the limited size of the discrete I/O buffers. The block data typically includes the command opcode, timeout value, data length, starting tag address, etc. Block Transfers are limited to 64 words (128 bytes). Reads and writes of data lengths greater than 128 bytes will require multiple Block Transfers. Block Transfer Reads may use a length of 0 – the CM52 will return the appropriate number of words for the command just executed. For instance, if a Tag Read command requesting 10 bytes from a tag is issued using a Block Transfer Write command, the subsequent Block Transfer Read command used to retrieve the data may request a length of 0 words. The CM52 will return 5 words of data because the previous command requested 10 bytes. Command Parameters The first word of the command parameter block data has the same format for all CM52 commands. The number and meaning of parameter / data words following the first word will vary with different commands. Refer to the individual command descriptions for information on remaining parameters. The first command parameter word is defined as follows: Word MSB
15
14
13
12
0
11
10
9
2
1
8
OPCODE LSB
7
6
5
4
3
Task Number
0 Device Number
Reserved
00 = Task 0 01 = Task 1 10 = Task 2 11 = Task 3
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
27
Page 34
Opcode The first byte of the command parameters, the Opcode, tells the CM52 which operation it is to perform. Subopcode Following the Opcode is the Subopcode byte that specifies the Task Number (0-3) and the device being addressed (antenna or serial port). Device The device number refers to the RFID antenna or serial port that the command is addressing. The values can be: 0 = COM (Port) 1 or Antenna 0 1 = COM (Port) 2 or Antenna 1 Task Number The CM52 has a multitasking operating system and up to four tasks may execute concurrently. The task number refers to the execution task assigned to the command and can have a value of 0-3 (binary 00-11) The task number should be set to 0 unless there are multiple tasks running concurrently. Response Parameters Many commands will have no block data response because the only CM52 response will be to set appropriate status bits in the Response Flags. Commands that cause data or additional status information to be returned by the CM52 will provide that data in response to a Block Transfer Read instruction. See the descriptions of the individual commands for the format of the block data returned.
3.3 Command Data Lengths Since the Command and Response Flags are transferred in discrete data buffers, generally the entire Block Data buffer (up to 64 words, or 128 bytes) is available for data. However, certain commands contain other parameters within the block data that limit the number of data bytes.
28
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
Page 35
The following table shows the amount of data that can be transferred in one Block Transfer operation for a sampling of CM52 commands. Table 13, Maximum Transaction Size
CM52 Command
Maximum Data Bytes
HS Tag Write (one field)
118
HS Tag Write (two fields)
114
HS Tag Write (three fields)
110
HS Tag Read
128
Serial Write
124
Serial Read
128
HMS Tag Write (one field)
118
HMS Tag Write (two fields)
114
HS Tag Write (three fields)
110
HMS Tag Read
128
MUX32 Write
58
Specific limitations are given in the command descriptions.
3.4 Block Transfer Problems Unsolicited Block Transfers can occur if the first slot is used for discrete output data. In PLC-2 systems these problems can also result from input data assigned to the first slot. The first slot can not be used for input or output data in CM52 racks. Problems may also occur with some scanners if a Block Transfer Read is requested when the scanner is requesting a Block Transfer Write or if a Block Transfer Write is requested when the scanner is requesting a Block Transfer Read.
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
29
Page 36
3.5 Command Protocol To issue a command, a sequence must be followed as shown in the flowchart below. The command parameters must first be downloaded using a Block Transfer Write command and then the Initiate bit should be set. The CM52 will immediately acknowledge receipt of the command by setting the Acknowledge bit to “1” and executing the command. When the PLC sees the Acknowledge bit set, it should reset the Initiate bit to 0. The CM52 will not set the Done bit until the command is completed and the transition from 1 to 0 is seen on the Initiate bit. The flowchart in Figure 9 illustrates the handshake sequence for a Tag Write command.
Figure 9, Tag Write Command Flow
30
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
Page 37
The flowchart in Figure 10 illustrates the handshake sequence for a Tag Read operation.
Figure 10, Tag Read Command Flow
The sequences shown above demonstrate what is known as a 4-edge handshake and is the most secure method for message control. Execution of the command has begun while the second half of the handshake
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
31
Page 38
is being negotiated. The overlap in processing is made possible by the real-time operating system and provides increased transaction speed. Please refer to the product disk for example files written in both ladder logic and C language.
3.5.1 Posted Commands Posted Commands allow the Host to initiate multiple commands, and then receive acknowledgment from the CM52 while the commands are executing concurrently. A bit in the response Flags may be monitored to determine the status of the posted command. After a Posted Read, a Buffer read must be performed to collect the data. Data for Posted Commands is read from, and written to, one of the four Task Buffers. After issuing a Buffer Write command, a Posted Write will complete the operation.
3.6 Command Descriptions This section will provide details for each command supported by the CM52. For each command the following is given: A brief description of the command functionality The opcode and description of command parameters The order of parameters to be downloaded in the Block Transfer Write instruction A copy of the discrete bit maps for both the command and response flags The order of parameters to be uploaded in the Block Transfer Read instruction, where applicable The possible return status values NOTE: The Response Flags as shown are valid for a CM52 configured as a quarter-rack device. For half-rack configurations and additional three bytes of MUX32 Data Ready Flags would also be available.
32
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
Page 39
Parameters are shown as words to match the integer fields of the PLC memory. The CM52 assumes data will be transmitted in the exact order as it appears in these descriptions. Where a word is made up of two distinct one-byte parameters, the individual bytes will be identified. Where a byte contains bit-mapped fields, the individual bit values will be defined. All offset and length parameters are given in bytes unless otherwise specified. Values are provided in decimal or hexadecimal format. Hexadecimal values are followed by an `H’. Bytes are read right to left with the least significant bit being 0. Bit ordering in the discrete I/O blocks (command and response flags) are given in octal notation with the lower byte (LSB) first. Bit ordering in Transfer Blocks (parameters and data) is given in decimal with the upper byte (MSB) first. Please see Appendix A for a command quick reference.
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module
33
Page 40
3.6.1 Initialization Commands The following commands are typically executed once during initialization though they may be done at any time. Define Mode, Opcode 120 Establish the mode for future commands. Turning on Verify Mode causes all tag write commands to subsequently read the tag to verify that data was correctly stored. Turning on trace causes a trace of services executed to appear on serial port COM1. This is useful for debugging. Default is no verification and no trace. Enabling the time stamp causes a date-time stamp to appear in the trace. Swap Mode and Word Mode affect data being transferred by instructions such as tag read, tag write, serial read, etc. The explanation below illustrates transformations in hexadecimal. Only data transferred is affected. The instruction format remains the same. Normally, the Define Mode command is not used since the default byte and word alignment is correct for the Allen-Bradley PLCs. This means, when transferring a string of bytes, the first byte, byte 0 is in the leftmost half of the 16-bit register (upper byte), and byte 1 is in the rightmost half (lower byte). Swap Mode The bytes are swapped in each word. i.e., Master
Slave
1234 5678
=>
3412 7856 (write)
1234 5678
<=
3412 7856 (read)
34
Copyright 1998, Escort Memory Systems CM52 Remote I/O Interface Module