The text of a manual · part 29 of 39
C200HW-DRT21, CQM1-DRT21, DRT1 Series DeviceNet Slaves Operation Manual: W347-E1-06.pdf, pages 281 to 290
Pages 281 to 290 of 381, from C200HW-DRT21, CQM1-DRT21, DRT1 Series DeviceNet Slaves Operation Manual
The original document is the PDF (7.8 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 Omron DRT1-ID16
Page 281
Section 6-2
RS-232C Units
6-2-6
Using the RS-232C Unit The RS-232C Unit is set and controlled using explicit DeviceNet messages or the DeviceNet Configurator. When the default communications settings for the RS-232C port are not used, the settings must be changed using explicit messages or the DeviceNet Configurator.
Making Settings with Explicit Messages 1,2,3...
The general operating procedure for the RS-232C Unit is as follows: 1. Turn ON the power to the Master Unit and all Slaves, including the RS232C Unit. 2. When necessary, explicit messages can be sent from the Master to set the parameters of the RS-232C ports 1 and 2 on the RS-232C Unit. Note a) Communications setting do not become effective even after the explicit message has been completed normally. For the settings to be effective, the RS-232C port must be reset using the PORT RESET command, or by restarting the RS-232C Unit. The previous settings will be in effect until the new settings are enabled. b) The communications settings are held internally by the RS-232C Unit, so once they have been set, they will not change when the Unit is turned OFF or reset, and once set, it is not necessary to set the parameters again, unless there are changes to be made. 3. Register the RS-232C Unit in the Master’s scan list. There are two methods of registering on the scan list. • Turn ON the Enable Scan List software switch on the Master Unit. • Create a scan list and registering the Unit using a DeviceNet Configurator. For further details on Master Unit operations, refer to the DeviceNet Master Unit Operation Manual or the DeviceNet Configurator Operation Manual. 4. When necessary, explicit messages can be sent from the Master to control the flow of data through the RS-232C ports 1 and 2 on the RS-232C Unit. Note a) When sending or receiving data through ports 1 and 2, it is necessary to check the status word allocated to the RS-232C Unit for communications status in the Master’s IN Area. b) Ports 1 and 2 can send and receive data independently but because the RS-232C Unit itself can only process one explicit message at a time, even if the SEND/RECV commands to be sent are for another port, always make sure that the previous explicit message has been processed before sending the next message.
Making Settings with the DeviceNet Configurator
1,2,3...
The communications settings can be made using the OMRON DeviceNet Configurator (version 2.@ or later). When using a version earlier than 2.@, contact your local sales office before use. (Version information can be confirmed from the Help Menu.) 1. Connect a DeviceNet Configurator to the DeviceNet Network and go online. 2. Turn ON the power to the RS-232C Unit.
266
Page 282
Section 6-2
RS-232C Units
3. Locate the RS-232C Unit’s icon in the Network Configuration window and double click the icon.
The Device Parameters Editing Window (Communications Settings parameter setting window) will be displayed. 4. Either double click on the Communications parameter that you want to change or select the desired parameter and press the Enter Key.
It will become possible to change the parameter.
267
Page 283
Section 6-2
RS-232C Units 5. Set or change parameters. • frame format
Put check marks next to the items that you want to disable and press the Enter Key, or click another location in the window.
• Data size Input the new value and press the Enter Key, or click another location in the window.
• Settings other than frame format and Data size Select the desired parameter setting from the corresponding pull-down menu and press the Enter Key, or click another location in the window. (In this example, the character format is being set.)
268
Page 284
Section 6-2
RS-232C Units
6. When the desired parameter changes and settings have been completed, click the Download Button. The edited parameters will be written to the RS-232C Unit.
7. Click the Reset Button to enable the edited parameters. A reset confirmation message will be displayed. Click the Yes button to confirm. Note
1. When exchanging data through ports 1 and 2, it is necessary to confirm the status of the data transfer (communications status) in the words allocated to the RS-232C Unit in the Master Unit’s Input Area. 2. It is possible to operate ports 1 and 2 independently, but the RS-232C Unit can process only one explicit message at a time. Even if you are going execute a send command or receive command for the other port, confirm that the previous explicit message processing has been completed before executing the next explicit message.
6-2-7
Explicit DeviceNet Messages Explicit DeviceNet messages sent from the Master Unit can be used to control the parameters of the RS-232C Unit’s ports 1 and 2 and to control the flow of data. The RS-232C Unit processes the commands received from the Master Unit and returns responses. Master
RS-232C Unit
Command
Command
Response
269
Page 285
Section 6-2
RS-232C Units RS-232C Unit Explicit Message List
The explicit messages that can be processed by the RS-232C Unit are as listed in the following table. For the RS-232C Unit, the service code and the Instance ID determine the processing content and object. The Class ID is always 0094 Hex. Explicit message PARAMETER SET
Function Sets the parameters for an RS-232C port.
Service code (See note) 10 Hex (90 Hex)
Instance ID
Page
01 Hex
272
PARAMETER READ
Reads the parame- 0E Hex (8E Hex) 01 Hex ters set for an RS-232C port.
275
INITIALIZE PARAMETERS
Initializes the parameters for an RS-232C port.
05 Hex (85 Hex)
01 Hex
276
RS-232C DATA SEND
Transmits data from an RS-232C port. Reads data received by an RS-232C port. Resets an RS-232C port. When an error occurs in an explicit message (command), an error response is sent from the RS-232C Unit.
10 Hex (90 Hex)
Port 1: 02 Hex Port 2: 03 Hex
276
0E Hex (8E Hex) Port 1: 02 Hex Port 2: 03 Hex
277
05 Hex (85 Hex)
278
RS-232C RECEIVE DATA READ PORT RESET Error response
--- (94 Hex)
Port 1: 02 Hex Port 2: 03 Hex ---
279
Note The parentheses indicate the response values. Explicit Message Format
This section explains the common features of explicit commands and responses. Details and usage examples will only be provided however, for those explicit messages that the RS-232C Unit can process. For details on using explicit messages with a Master Unit, refer to the DeviceNet Operation Manual. The number of bytes designated for Class ID, Instance ID, and Attribute ID differ depending on the Master. When sent from an OMRON DeviceNet Master, Class ID and Instance ID are 2 bytes (4 digits), and Attribute ID is 1 byte (2 digits). For an example using this case, see 6-2-8 Using Explicit DeviceNet Messages. Command Block 00
94
Class ID Service Code Destination node address
151 bytes max.
Instance ID Attribute ID
Data
Destination Node Address The node address of the RS-232C Unit controlled by the explicit message (command) in single-byte (2-digit) hexadecimal.
270
Page 286
Section 6-2
RS-232C Units Service Code, Class ID, Instance ID, Attribute ID
The parameters for specifying command, processing object, and processing content. For the RS-232C Unit, however, Class ID is always 94 Hex. Attribute ID is not necessary for some commands. If the specified codes and ID area are outside the permitted range, an error response will be returned (08FF Hex), and the command will not be executed. Data Data set when necessary. A maximum of 151 bytes can be set. Some commands do not require this data. Response Block • The normal response block is shown below. 1,024 bytes max. No. of received bytes
Service code
Data
Source node address
• The error response block is shown below. This response block is returned when an error occurs for an explicit message.
Error code No. of received Service code bytes (94 Hex: Fixed) Source node address
• If an explicit message fails (timeout etc.), an explicit message response will not be returned. When the command has been sent using the FINS command EXPLICIT MESSAGE SEND, only an FINS error response is returned. No. of Received Bytes The number of bytes received from the source node address is returned in hexadecimal. When an error response is returned for an explicit message, the number of bytes is 0004 Hex. Source Node Address The node address of the node from which the command was sent is returned in hexadecimal. Service Code For normal completion, the value when leftmost bit of the service code specified by the command is ON is stored as shown in the table below. Command service code
Response service code
10 Hex 0E Hex
90 Hex 8E Hex
05 Hex
85 Hex
When an error response is returned for an explicit message, the value is 94 Hex.
271
Page 287
Section 6-2
RS-232C Units Data
Data read when the PARAMETER EAD or RS-232C RECEIVE DATA READ commands are used. The maximum number of bytes is 1,024. Only a maximum of 152 bytes can be read using an OMRON DeviceNet Master. Be sure not to exceed the maximum of 152 bytes. Error Code The explicit message error code. For details see Error Response on page 279. PARAMETER SET
Sets the parameters for the specified RS-232C port. Command Block 10
00
94
Class ID Service Code Destination node address
01
6 bytes max.
Instance ID Attribute ID
Set values
00
Response Block
No. of received Service code bytes Source node address
272
Page 288
Section 6-2
RS-232C Units Parameters Attribute ID, Set Values (Command)
The parameters and set values are set as shown in the following table. Port Port 1
Parameters Set all parameters
Attribute ID 64 Hex
Set values ALL PARAMETER SET (See below)
Initial values Initial values for each parameter
Data bit length, par- 65 Hex ity, No. of stop bits
Specify the appropriate set values from the Data bit length: parameters in the table, as single-byte (2-digit) 7 bits hexadecimal. (See note.) Parity: Even No. of stop bits: 2 bits
Header code 66 Hex enable/disable, delimiter code enable/disable, flow control enable/disable
Specify bit data in single-byte (2-digit) hexadecimal, as shown in the following diagram.
Baud rate
Specified in single-byte (2-digit) hexadecimal as follows: 00 Hex: 1,200 bps 01 Hex: 2,400 bps 02 Hex: 4,800 bps 03 Hex: 9,600 bps 04 Hex: 19,200 bps 05 to 07 Hex: Not allowed Specifies the header code in single-byte (2digit) hexadecimal.
2,400 bps
Specifies the delimiter code in single-byte (2digit) hexadecimal.
03 Hex (ETX code)
67 Hex
Header code (only 68 Hex when header code is enabled) Delimiter code (only 69 Hex when delimiter code is enabled) No. of bytes 6A hex received after the delimiter (when the delimiter code is enabled) or the No. of bytes received per frame (when the delimiter code is disabled).
Bit
Always 0
Header code and delimiter code enabled, flow control disabled
Header code: 0: Enabled 1: Disabled Delimiter code: 0: Enabled 1: Disabled Flow control (RS/CS control) 0: Enabled 1: Disabled
02 Hex (STX code)
Specifies the number of bytes in single-byte (2- 00 Hex digit) hexadecimal.
273
Page 289
Section 6-2
RS-232C Units Port Port 2
Parameters Set all parameters
Attribute ID 6B Hex
Set values ALL PARAMETER SET (See below)
Initial values Initial values for each parameter
Data bit length, par- 6C Hex ity, No. of stop bits
Specify the appropriate set values from the parameters in the table, as single-byte (2-digit) hexadecimal). (See note.)
Data bit length: 7 bits Parity: Even No. of stop bits: 2 bits
Header code 6D Hex enable/disable, delimiter code enable/disable, flow control enable/disable
Specify bit data in single-byte (2-digit) hexadecimal, as shown in the following diagram.
Header code and delimiter code enabled, flow control disabled
Baud rate
6E Hex
Header code (only when header code is enabled)
6F Hex
Bit
Always 0
Header code: 0: Enabled 1: Disabled Delimiter code: 0: Enabled 1: Disabled Flow control (RS/CS control) 0: Enabled 1: Disabled
Specified in single-byte (2-digit) hexadecimal as follows: 00 Hex: 1,200 bps 01 Hex: 2,400 bps 02 Hex: 4,800 bps 03 Hex: 9,600 bps 04 Hex: 19,200 bps 05 to 07 Hex: Not allowed Specifies the header code in single-byte (2digit) hexadecimal.
2,400 bps
Delimiter code (only 70 Hex when delimiter code is enabled)
Specifies the delimiter code in single-byte (2digit) hexadecimal.
03 Hex (ETX code)
No. of bytes 71 hex received after the delimiter (when the delimiter code is enabled) or the No. of bytes received per frame (when the delimiter code is disabled).
Specifies the number of bytes in single-byte (2- 00 Hex digit) hexadecimal.
02 Hex (STX code)
Note Port 1 and 2 parameter settings for data bit length, parity, and No. of stop bits: Set value
274
Data bit length
Parity
No. of stop bits
00 Hex 01 Hex
7 7
Even Odd
1 1
02 Hex 03 Hex
7 7
None Even
1 2
04 Hex 05 Hex
7 7
Odd None
2 2
06 Hex 07 Hex
8 8
Even Odd
1 1
08 Hex 09 Hex
8 8
None None
1 2
0A Hex to 0F Hex
7
Even
2
Page 290
Section 6-2
RS-232C Units ALL PARAMETER SET
Writes all the Attribute ID set values to consecutive words, and transmits all the settings at the same time, as shown in the following diagram. Bit First word First word +1 First word +2
First word +3
Attribute code 64 Hex (6 B Hex)
Data bit length 65 Hex (6C Hex)
Header code enable/disable 66 Hex (6D Hex)
Baud rate 67 Hex (6E Hex) Delimiter code 69 Hex (70 Hex)
Header code 68 Hex (6F Hex) No. of bytes received after the delimiter /per frame 6A Hex (71 Hex)
00 Hex: Fixed
Note The hexadecimal values displayed above are the set values for Attribute ID. The values in parentheses are the Attribute ID values for port 2
• The new set values will become effective if the PORT RESET command is sent or the RS-232C Unit is restarted after the command is completely normally. PARAMETER READ
Reads the parameters set for the RS-232C port. If the PARAMETER SET command has not been sent, or the RS-232C Unit has not been reset, this command will read the previously set parameters, not the new settings. (The RS-232C port will also operate according to the previous settings.) Command Block 0E
00
94
Class ID Service Code Destination node address
00
01
Instance ID Attribute ID
Response Block 6 bytes max. Service Set values No. of received code bytes Source node address
Parameters Attribute ID (Command) Specifies the Attribute ID for reading the set values. For details on what to specify, see PARAMETER SET on page 272. It is also possible to specify all parameters at once (Port 1: 64 Hex, Port 2: 6B Hex). Set Values (Response) Reads the values that are set in Attribute ID and stores them. For details on the meaning of the stored values, see PARAMETER SET on page 272.
275