The text of a manual · part 3 of 8
CDN060 Series DeviceNet Gateway User Manual, pages 19 to 27
Pages 19 to 27 of 71
The original document is the PDF (3.0 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 MKS CDN066
Page 19
CDN060 User Manual revision 1.00
Chapter 4 – Gateway Configuration This chapter describes how to configure and operate the CDN060 gateway. You configure the gateway by reading and writing attribute values over its DeviceNet interface. There are a variety of DeviceNet configuration tools available. Simple configuration tools use GET_ATTRIBUTE and SET_ATTRIBUTE explicit message commands to read and write attribute values, addressing each attribute by its Object, Instance, and Attribute numbers. This information is contained in Chapter 5. More sophisticated configuration tools use EDS files to simplify attribute configuration. You can configure the gateway using pull-down menus, buttons, and data entry fields from the gateway’s Electronic Data sheet (EDS) file. Chapter 6 contains a configuration example using the Rockwell Software RSNetworx program. Configure DeviceNet Interface Set the DeviceNet Baud Rate and MAC ID Address using the rotary switches. Configure switches before connecting to the DeviceNet network. There is either a small triangular indicator or white indicator on the switch. Use a small screwdriver to align that indicator with the desired setting. Remove the CDN060 cover if necessary to access the rotary switches. DeviceNet Baud Rate Switch Valid settings are 125K, 250K, 500K, or PGM. When PGM is selected, the CDN060 uses the baud rate saved in its retentive memory. A valid baud rate must be stored before the PGM selection can be used. The baud rate is stored from the previous CDN060 power cycle. It can also be set over the network (DeviceNet Object Baud Rate attribute). POSITION 0 1 2 3 4
SETTING 125 Kbps 250 Kbps 500 Kbps invalid invalid
POSITION 5 6 7 8 9
SETTING invalid invalid invalid invalid PGM
MAC ID Switches The two MAC ID switches represent decimal numbers from 00 to 99. The LSB switch selects the Ones digit and the MSB switch selects the Tens digit. Valid MAC IDs are 00 to 63. Setting a MAC ID address greater than 63 forces the gateway to use the MAC ID saved in retentive memory. A valid MAC ID must first be stored before this feature can be used. The MAC ID is stored from the previous CDN060 power cycle. It can also be set over the network (DeviceNet Object MAC ID attribute). MSB 0 1 2 3 4 5 6
LSB 0 to 9 0 to 9 0 to 9 0 to 9 0 to 9 0 to 9 0 to 3
MKS Instruments, Inc.
Address 00 to 09 10 to 19 20 to 29 30 to 39 40 to 49 50 to 59 60 to 63
MSB 6 7 8 9
LSB 4 to 9 0 to 3 0 to 9 0 to 9
D.I.P. Products Group
Address stored address stored address stored address stored address
19
Page 20
CDN060 User Manual revision 1.00
Serial Channel Baud Rate / Option Switch The CDN060 gateway has a rotary switch for the serial channel. This switch has different functions for the CDN066 and CDN067 models. The CDN066 model uses the rotary switch to select the RS232 channel baud rate. Valid settings are 300, 600, 1200, 2400, 4800, 9600, 19200 bits per second, and PRG (table below). When PRG is selected, the CDN066 uses the Baud Rate attribute in the Serial Stream Object. A valid baud rate must be written over DeviceNet to this attribute. POSITION 0 1 2 3 4
SETTING 9600 bps 4800 bps 2400 bps 1200 bps 600 bps
POSITION 5 6 7 8 9
SETTING 300 bps 19200 bps invalid invalid PRG
The CDN067 model does not use the rotary switch for configuration, but the current switch position (0-9) can be accessed in the Serial Stream Object Option Switch attribute. Power Up Gateway Connect the gateway to a DeviceNet network to power up the gateway. DeviceNet Status LEDs The CDN060 gateway has two bi-color status LEDs (NET and MOD) that indicate operational status. During power-up, the LEDs cycle through a sequence of alternating red and green. After power-up, the NET LED should be flashing green (or solid green if allocated to a DeviceNet master) and the MOD LED should be solid green. If this does not occur, disconnect from DeviceNet and verify all the switch settings. See Chapter 8 for additional troubleshooting topics. State Off Flashing Red Solid Red Flashing Green Solid Green
DeviceNet Status LED (NET) No power. Configuration error. Check DeviceNet switch settings. Unrecoverable error. Device not allocated to a DeviceNet master. Normal runtime, device allocated as a slave.
State Off Flashing Red Solid Red Flashing Green Solid Green
Module Status LED (MOD) No power. Configuration error. Check object attribute settings. Unrecoverable error. Not defined. Normal Operation.
MKS Instruments, Inc.
D.I.P. Products Group
20
Page 21
CDN060 User Manual revision 1.00
Serial Channel Status LEDs The gateway has two bi-color LEDs to indicate serial channel activity. The TX LED flashes green when a packet is being transmitted. The RX LED flashes green when a packet is being received. A fault is indicated by solid red. After power-up, both LEDs should be off. State
Transmit Status LED (TX)
Off Flashing Red Solid Red Flashing Green Solid Green
No data being transmitted Not defined Transmit error (parity or overrun error) Data being transmitted Not defined
State
Receive Status LED (RX)
Off Flashing Red Solid Red Flashing Green Solid Green
No data being received Not defined Receive error (parity or overrun error) Data being received Not defined
Register EDS File If using a DeviceNet configuration tool that supports Electronic Data Sheet (EDS) files, you should now register the gateway’s EDS file with the software. The latest EDS file versions can be downloaded from www.mksinst.com. Select the EDS file that matches your gateway’s part number and firmware version. Follow your configuration tool instructions to register EDS file.
MKS Instruments, Inc.
D.I.P. Products Group
21
Page 22
CDN060 User Manual revision 1.00
Configure Serial Channel The Serial Stream Object attributes control the CDN060 serial channel. These settings apply to all serial transmit and receive operations. Before you can set or change any gateway configuration settings, make sure the gateway is not in the DeviceNet master scanlist. Number
Name
Serial Stream Object Instance Attributes (Class Code 64) Data Type Value
3
Receive Data
4
Transmit Data
5
Status
6
Baud Rate
7
Parity
8 9 10
Data Size Stop Bits Flow Control
11 12 13 14
Receive Count Transmit Count Maximum Receive Size Data Format
15
Block Mode
16 17 18 19
Delimiter Pad Character Maximum Transmit Size Idle String
MKS Instruments, Inc.
Short_String Received message data. Returned in Poll Response Message. or Byte Array Short_String Message data to transmit. Received in Poll Command Message. or Byte Array USINT Bit 0 – Transmit Channel Blocked Bit 1 – Transmit Buffer Empty Bit 2 – Receive Parity Error (set = 0 to clear) Bit 3 – Receive Buffer Empty Bit 4 – Receive Buffer Overflow Error (set = 0 to clear) Bit 5 – Framing Error (set = 0 to clear) Bit 6 – Transmit Buffer Overflow Error (set = 0 to clear) Bit 7 – CTS Signal State (1 = asserted) USINT 0 = 9600 bps 4 = 600 bps 1 = 4800 bps 5 = 300 bps 2 = 2400 bps 6 = 19200 bps 3 = 1200 bps USINT 0 = no parity 5 = mark (force to 1) 1 = even parity 6 = space (force to 0) 2 = odd parity USINT Read-only. 7 bits if parity enabled, 8 bits if no parity. USINT Read-only. Fixed at 1 bit. USINT 0 = none 2 = CTS / RTS 1 = XON / XOFF 4 = CTS Detect Mode USINT Number of bytes in Receive Buffer. Any write clears buffer. USINT Number of bytes in Transmit Buffer. Any write clears buffer. USINT Defines the maximum #bytes returned by RX Message read. USINT Bit 0 – String Format (0 = Short_String, 1 = Byte Array) Bit 1 – Strip Parity Bits (0 = retain, 1 = strip) Bit 2 – Pad Justification (0 = left justify, 1 = right justify) Bit 3 – Pad Received Message (0 = no, 1 = yes) USINT Bit 0 – Pre/Post Delimiter (0 = pre-delimiter, 1 = post-delimiter) Bit 1 – Strip Delimiter (0 = keep delimiter, 1 = strip delimiter) Bit 2 – Delimiter Enable (0 = no, 1 = yes) Bit 3 – Enable Receive Sequence Number (0 = no, 1 = yes) Bit 4 – Enable Transmit Sequence Number (0 = no, 1 = yes) Bit 5 – Resend (0 = no, 1 = yes) Bit 6 – Synchronization (0 = no, 1 = handshake protocol) USINT Delimiter byte value CHAR Pad byte value USINT Defines the maximum # bytes that can be transmitted. Short_String 1-16 byte string transmitted when gateway receives a null Poll (no input bytes). Short_String length = 0 for no Idle String.
D.I.P. Products Group
22
Page 23
CDN060 User Manual 20
Fault String
21 22 23 24
Status Enable Status Clear Enable Four Wire Option Switch revision 1.00 Short_String 1-16 byte string transmitted when gateway’s Polled I/O connection times out. Short_String length = 0 for no Fault String. USINT Set to any nonzero value to enable Status input byte. USINT Set to any nonzero value to enable Status Clear output byte. USINT CDN067 only. Enables RS422 full duplex (4-wire) operation. USINT CDN067 only. Position of Option rotary switch (0-9).
Receive Data – Data from the last valid message packet. Receive Data includes the Status and Receive Sequence Number bytes if enabled, and the RX Message bytes. The RX Message format is either Short_String or Byte Array, defined by Data Format attribute. If no message data is available, the RX Message will be a null packet or Short_String with length = 0. Receive Data is returned in the DeviceNet Poll Response Message. Receive Data Status
Receive Sequence Number
RX Message
Data Format = xxxxxxx0 Length
Data Format = xxxxxxx1
Short_String data bytes
Byte Array data bytes
Transmit Data – Data to transmit out the serial channel by the gateway. Transmit Data includes the Status Clear and Transmit Sequence Number bytes if enabled, and the TX Message bytes. Format is either Short_String or Byte Array, defined by Data Format attribute. Transmit Data is typically received in the DeviceNet Poll Command Message. Reading Transmit Data returns the last byte in the Transmit Buffer. Transmit Data Status Clear
Transmit Sequence Number
TX Message
Data Format = xxxxxxx0 Length
Data Format = xxxxxxx1
Short_String data bytes
Byte Array data bytes
Status – Contains bit-mapped serial channel status and error bits for transmit and receive operations. Clearing the bits indicated will clear the error condition. Baud Rate – Sets the serial channel’s data or baud rate. Enter number from 1-6 to select corresponding baud rate value. For CDN066, the RS232 Baud Rate switch must be set to PRG before this attribute can be used to set the baud rate.
MKS Instruments, Inc.
D.I.P. Products Group
23
Page 24
CDN060 User Manual revision 1.00
Parity – Selects the parity type used in the serial byte. Data Size – Read-only attribute indicates number of data bits in one serial byte. This number does not include start, parity, or stop bits. If parity is enabled, 7 data bits are used. If no parity, 8 data bits are used. Stop Bits – Read-only attribute indicates number of stop bits in one serial byte. Fixed at 1. Flow Control – Selects the method of flow control used across the serial interface. NONE means there is no flow control over the serial data exchange. The transmitting device can overflow the receiving device’s buffer. XON/XOFF is a software flow control option. Receiving device sends an XOFF character to the transmitting device when its buffer is full, stopping further transmission. It sends an XON character when it can again receive data. The XOFF and XON characters are not saved as message data. CTS/RTS is an RS232 hardware flow control option, available only on the CDN066 gateway. The RTS is an output and CTS is an input signal. The gateway keeps RTS active (low) when it can receive data. It only transmits data when CTS is active (low). CTS Detect Mode is an RS232 hardware flow control option, available only on the CDN066 gateway. When CTS is asserted, the CDN066 serial channel can transmit and receive. When CTS is not asserted, the CDN066 serial channel is disabled and Receive Buffer cleared. Receive Count – Number of bytes currently available in the Receive Buffer. Writing any value to this attribute will clear the Receive Buffer. Transmit Count – Number of bytes currently in the Transmit Buffer. Writing any value to this attribute will clear the Transmit Buffer. Maximum Receive Size – Defines the maximum number of data bytes to be returned when the Receive Buffer is read using either an Explicit Message or a Poll Response Message. Data Format – Control byte that defines the format of the TX Message and RX Message bytes transferred across DeviceNet. Bit 3 selects whether the RX Message bytes are padded with the Pad bytes. Set this bit = 1 to enable. If there are not enough message bytes in the Receive Buffer to fill up the RX Message input bytes, then Pad characters are added at either the beginning or end of the message bytes. Bit 2 selects whether Pad bytes are added at the beginning of the message (0 = left justify) or at the end of the message (1 = right justify). This bit is used only if the Pad option is enabled.
MKS Instruments, Inc.
D.I.P. Products Group
24
Page 25
CDN060 User Manual revision 1.00
Bit 1 defines whether the gateway saves the parity bit in received message bytes (set = 0), or if the gateway forces the parity bit to 0 in received message bytes (set = 1). This is typically used when receiving 7-bit ASCII data. Bit 0 defines String Format for TX Message and RX Message byte strings. Set to 0 for Short_String format, and 1 for Byte Array format. Short_String defines the first byte as an explicit length byte, containing the number of bytes that follow. Byte Array has an implied length, derived from the Maximum Receive Size attribute. Block Mode – Control byte that defines the serial receive mode, synchronization mode, and resend message option. Bit 6 enables the Handshake Protocol synchronization option. When enabled, the Receive Sequence Number byte is added to Receive Data input bytes, and the Transmit Sequence Number byte is added to the Transmit Data output bytes. Bit 5 enables the resend message option. When enabled, the gateway continuously returns RX Message data in the Poll Response message. If no new data has been received, then the last data bytes are returned. Bit 4 enables the Transmit Sequence Number synchronization option. When enabled, the Transmit Sequence Number byte is added to the Transmit Data output bytes. Bit 3 enables the Receive Sequence Number synchronization option. When enabled, the Receive Sequence Number byte is added to the Receive Data output bytes. Bit 2 selects the serial receive mode. Set = 0 for Stream Mode, and set = 1 for Block Mode. Bit 1 selects whether the Delimiter is saved in the Receive Buffer (set = 0), or it is discarded (set = 1). This bit is only used when Block Mode is enabled. Bit 0 selects Pre-Delimiter Mode (set = 0) or Post-Delimiter Mode (set = 1). This bit is only used when Block Mode is enabled. Delimiter – Byte value used to indicate the start of a new message (Pre-Delimiter Mode), or the end of a received message (Post-Delimiter Mode). This attribute is only used in Block Mode. Pad Character – Byte value used to pad the RX Message bytes. Maximum Transmit Size – Defines the maximum size of TX Message output bytes, or the maximum number of data bytes to be transmitted across the RS232 channel from one Poll Command message. Idle String – Defines the byte string that is transmitted when the gateway receives a null Poll (no input bytes, or a Short_String value with length = 0). Enter the byte string in Short_String data
MKS Instruments, Inc.
D.I.P. Products Group
25
Page 26
CDN060 User Manual revision 1.00 format, with 1st byte = string length. Set the length byte to 0 if you don’t want to transmit an Idle String. The Idle String can be from 0 to 16 bytes long, not counting Short_String length byte. Example Idle String is [ 0x01 0x41 ], where string length is 1 and data byte is 0x41 (‘A’). You must use the RSNetworx Class Instance Editor (Set Attribute Single command) to write a Short_String attribute value. Fault String – Defines the byte string that is transmitted when the gateway’s connection to the DeviceNet master times out. Enter the byte string in Short_String data format, with 1st byte = string length. Set the length byte to 0 if you don’t want to transmit a Fault String. The Fault String can be from 0 to 16 bytes long, not counting Short_String length byte. Example Fault String is [ 0x02 0x42 0x43 ], where string length is 2 and data bytes are 0x42 (‘B’) and 0x43 (‘C’). You must use the RSNetworx Class Instance Editor (Set Attribute Single command) to write a Short_String attribute value. Status Enable – Write any nonzero value to include the Status byte in Receive Data input bytes. Status Clear Enable – Write any nonzero value to include the Status Clear byte in Transmit Data output bytes. Four Wire – CDN067 model only. Set = 0 for RS485 half-duplex mode (2-wire). Set = 1 for RS422 full-duplex mode (4-wire). Option Switch – CDN067 model only. Returns the current Option rotary switch position (0-9).
MKS Instruments, Inc.
D.I.P. Products Group
26
Page 27
CDN060 User Manual revision 1.00
Configure DeviceNet Master Scanlist You must calculate the number of input and output bytes required by your CDN060 configuration before you can add the gateway to the DeviceNet master scan list. You need to configure the DeviceNet master to send the specific number of output bytes in its Poll Command Message, and receive the specific number of input bytes in the gateway’s Poll Response Message. Once the input and output bytes are mapped in the DeviceNet master, the user application program will be able to read and write data values to the input and output bytes. Poll Consume Size The Poll Consume Size is the size (in bytes) of the Poll Command Message data field that is sent by the DeviceNet master to the CDN060. Poll Command data: [Status Clear byte][Transmit Sequence Number byte][Short_String length byte][TX data bytes (0-64)]
The first 3 bytes are present if enabled. The following equation is used to calculate the CDN060 Poll Consume Size. Only include the overhead bytes that are enabled.
+
Status Clear byte Transmit Sequence Number byte Short_String length byte Maximum Transmit Size
1 1 1 ____
Poll Consume Size
____
Poll Produce Size The Poll Produce Size is the size (in bytes) of the Poll Response Message data field that is sent from the CDN060 to the DeviceNet master. Poll Response data: [Status byte][Receive Sequence Number byte][Short_String length byte][RX data bytes (0-64)]
The first 3 bytes are present if enabled. The following equation is used to calculate the CDN060 Poll Produce Size. Only include the overhead bytes that are enabled.
+
Status byte Receive Sequence Number byte Short_String length byte Maximum Receive Size
1 1 1 ____
Poll Produce Size
____
MKS Instruments, Inc.
D.I.P. Products Group
27