The text of a manual · part 7 of 8
CDN060 Series DeviceNet Gateway User Manual, pages 55 to 63
Pages 55 to 63 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 55
CDN060 User Manual revision 1.00
6) Select the CDN066 under Available Devices: and click the > button to transfer to Scanlist.
7) RSNetworx warns that the CDN066 does not contain any I/O data. Click OK to continue.
MKS Instruments, Inc.
D.I.P. Products Group
55
Page 56
CDN060 User Manual revision 1.00
8) Click on the Edit I/O Parameters button. Use the ∧ and ∨ buttons to set Rx Size: to the calculated Poll Consume Size value and the Tx Size: to the calculated Poll Produce Size value. Click Apply to update I/O parameters.
8) RSNetworx prompts to Automap the new input and output data bytes. Select Yes to automap. If you select No, then you must manually map the I/O bytes in the memory tables.
9) RSNetworx prompts if you want to download the changes to the 1747-SDN. Click Yes.
MKS Instruments, Inc.
D.I.P. Products Group
56
Page 57
CDN060 User Manual revision 1.00
10) Select the Input tab to view the automapped CDN066 input bytes.
11) Click the Advanced… button to view current input mapping detail. Change the mapping to suit your application. Click Apply Mapping button after you make changes. Click Yes at the RSNetworx prompt to download any changes to the 1747-SDN. Click Close to continue.
MKS Instruments, Inc.
D.I.P. Products Group
57
Page 58
CDN060 User Manual revision 1.00
12) Select the Output tab to view the automapped CDN066 output bytes.
13) Click the Advanced… button to view current input mapping detail. Change the mapping to suit your application. Click Apply Mapping button after you make changes. Click Yes at the RSNetworx prompt to download any changes to the 1747-SDN. Click Close to continue.
MKS Instruments, Inc.
D.I.P. Products Group
58
Page 59
CDN060 User Manual revision 1.00
Chapter 7 – Configuration Examples This chapter contains four example gateway configurations. Example 1 – Receiving Fixed-Length Data Read UPC labels into a PLC using a serial barcode scanner, a CDN066 gateway, and a DeviceNet scanner (master). The barcode scanner RS232 channel is connected to a CDN066 serial channel. The CDN066 DeviceNet channel is connected to the PLC DeviceNet scanner. The DeviceNet network is powered by an external 24VDC power supply. Barcode Scanner
PLC & DeviceNet Scanner
CDN066 Gateway
UPC labels
RS232
Power Supply
DeviceNet network
Barcode Scanner The barcode scanner’s RS232 channel is set for 9600 bps, 8 data bits, no parity, and 1 stop bit. When it reads a UPC label, it transmits a 5-byte serial message, which consists of the 5 ASCII characters printed on the UPC label. CDN066 Gateway The receive mode will be Stream Mode, since there is no defined Delimiter for the start of a message or the end of a message. All received data bytes will be returned as DeviceNet input bytes. The Maximum Receive Size is 5, because the Barcode Scanner messages have a fixed length of 5 bytes. The data bytes will be returned as a Short_String. The gateway will only return the data bytes once in a Poll Response Message. The Serial Stream Object can now be configured. The following shows the Serial Stream Object attribute settings for this application. The 3rd column lists the address string if using Set_Attribute_Single commands to write the attribute values. Serial Stream Object Configuration (Class Code 64 or 0x40) Attribute 6. Baud Rate 7. Parity 10. Flow Control 13. Max Receive Size 14. Data Format 15. Block Mode
Data 0 0 2 5 00000001 00000000
Class / Instance / Attribute / Data 0x40 0x01 0x06 0x00 0x40 0x01 0x07 0x00 0x40 0x01 0x0A 0x02 0x40 0x01 0x0D 0x05 0x40 0x01 0x0E 0x01 0x40 0x01 0x0F 0x00
Description 0 = 9600 bps 0 = no parity 2 = CTS / RTS Fixed message size of 5 bytes String Format = Short_String
The gatway will return 6 bytes of Receive Data, because the Maximum Receive Size is set to 5 and the data format is Short String (add 1 for length byte). The Status and Receive Sequence Number bytes are not enabled. The Poll Produce Size can now be calculated for this CDN060 configuration.
MKS Instruments, Inc.
D.I.P. Products Group
59
Page 60
CDN060 User Manual
+ revision 1.00
Status byte Receive Sequence Number byte Short_String length byte Maximum Receive Size Poll Produce Size
0 0 1 5 6
The format of the Poll Response Message input bytes is as follows: [ Short_String length ] [ Short_String data ] 1 byte 5 bytes
The gateway always returns 6 input bytes in the Poll Response Message, even if a new barcode message has not been received. The gateway will return new message data only once, and return a null data string if there is no new message data. The application should check the Short_String length byte to determine if a new message is being returned. A length of 5 indicates valid data bytes (new message data). A length of 0 indicates no valid data bytes (no new message). The Barcode Scanner sends the following 5-byte serial message when it reads a UPC label printed with ‘12345’ (ASCII numbers). 0x31 0x32 0x33 0x34 0x35
The gateway generates the following Poll Response Message in response to the first Poll Command Message after its receives the Barcode message. The Short_String length is 5, since 5 bytes were received. 0x05
0x31 0x32 0x33 0x34 0x35
The gateway generates the following Poll Response Message in response to subsequent Poll Command Messages, until it receives another Barcode message. The Short_String length is 0, indicating a null data string. The 5 data bytes are undefined. 0x00
XX XX XX XX XX
MKS Instruments, Inc.
D.I.P. Products Group
60
Page 61
CDN060 User Manual revision 1.00
Example 2 – Receiving Pre-Delimited Data Same configuration as Example 1. Barcode Scanner The barcode scanner’s RS232 channel is set for 9600 bps, 8 data bits, no parity, and 1 stop bit. When it reads a UPC label, it transmits following ASCII message format. The message always begins with the ASCII STX start-of-text (0x02) character. The barcode data will consist of a variable number of 1 to 14 ASCII characters, depending upon the UPC label being scanned. It will not transmit a 0x02 in the barcode data field. [ STX ] [ ASCII barcode data ]
CDN066 Gateway The receive mode will be Pre-Delimiter Mode, because the barcode messages always begin with the same character. The Delimiter is 0x02 (STX). The Maximum Receive Size is 15, because the largest message contains 1 STX byte and 14 ASCII bytes. The received bytes will be returned as a Short_String. An ASCII NUL Pad character (0x00) will be added at the end of the message if needed. The gateway will always return the data bytes in the Poll Response Message. The Receive Sequence Number will be used to indicate when a new message is returned. The Serial Stream Object can now be configured. The following shows the Serial Stream Object attribute settings for this application. The 3rd column lists the address string if using Set_Attribute_Single commands to write the attribute values. Serial Stream Object Configuration (Class Code 64 or 0x40) Attribute 6. Baud Rate 7. Parity 10. Flow Control 13. Max Receive Size 14. Data Format
Data 0 0 2 15 00001101
Class / Instance / Attribute / Data 0x40 0x01 0x06 0x00 0x40 0x01 0x07 0x00 0x40 0x01 0x0A 0x02 0x40 0x01 0x0D 0x0F 0x40 0x01 0x0E 0x0D
15. Block Mode
00101101
0x40 0x01 0x0F 0x2D
16. Delimiter 17. Pad Character
STX NUL
0x40 0x01 0x10 0x02 0x40 0x01 0x11 0x00
Description 0 = 9600 bps 0 = no parity 2 = CTS / RTS Receive messages up to 15 bytes Pad receive message Pad justificaiton = right (end of msg) String Format = Short_String Resend = enabled Receive Sequence Number = enabled Delimiter = enabled Pre-Delimiter 0x02 = ASCII STX character 0x00 = ASCII NUL character
The gateway will return up to 16 bytes of Receive Data, because the Maximum Receive Size is set to 15 and the data format is Short String (add 1 for length byte). The Status byte is not enabled. The Receive Sequence Number byte is enabled. The Poll Produce Size can now be calculated for this CDN060 configuration.
+
Status byte Receive Sequence Number byte Short_String length byte Maximum Receive Size Poll Produce Size
MKS Instruments, Inc.
D.I.P. Products Group
0 1 1 15 17
61
Page 62
CDN060 User Manual revision 1.00
The format of the Poll Response Message input bytes is as follows: [ Receive Sequence Number ] [ Short_String length ] [ Short_String data ] [ Pad bytes ] 1 byte 1 byte 0-15 bytes
The gateway always returns 17 input bytes in the Poll Response Message, even if the scanned barcode data contains fewer bytes. The application should check the Short_String length byte to determine the number of valid data bytes being returned in a particular Poll Response Message. The remaining input bytes have undefined values. The gateway will always return the last received Short_String data in its Poll Response Message. The gateway increments the Receive Sequence Number when new Short_String data is returned. The application can use the Receive Sequence Number to determine if the Short_String data is new or old information. The Barcode Scanner sends the following 8-byte serial message when it reads a UPC label printed with ‘1234567’ (ASCII numbers). 0x02 0x31 0x32 0x33 0x34 0x35 0x36 0x37
The gateway generates the following Poll Response Message. The Receive Sequence Number is 1, since this is the first message received from the Barcode Scanner. The Short_String length is 8, since 8 bytes were received. 7 Pad characters are added at the end of the message.
0x01
0x08
MKS Instruments, Inc.
0x02 0x31 0x32 0x33 0x34 0x35 0x36 0x37
D.I.P. Products Group
0x00 0x00 0x00 0x00 0x00 0x00 0x00
62
Page 63
CDN060 User Manual revision 1.00
Example 3 – Receiving Post-Delimited Data Same configuration as Example 1. Barcode Scanner The barcode scanner’s RS232 channel is set for 9600 bps, 8 data bits, no parity, and 1 stop bit. When it reads a UPC label, it transmits following ASCII message format. The message always begins ends with the ASCII ETX end-of-text (0x03) character. The barcode data will consist of a variable number of 1 to 14 ASCII characters, depending upon the UPC label being scanned. It will not transmit a 0x03 in the barcode data field. [ ASCII barcode data ] [ ETX ]
CDN066 Gateway The receive mode will be Post-Delimiter Mode, because the barcode messages always end with the same character. The Delimiter is 0x03 (ETX), and will not be included in the receive data. The Maximum Receive Size is 15, because the largest message contains 14 ASCII bytes and 1 ETX byte. The received bytes will be returned a Short String. The gateway will only return new data bytes once in the Poll Response Message. The Status byte will be enabled. The Serial Stream Object can now be configured. The following shows the Serial Stream Object attribute settings for this application. The 3rd column lists the address string if using Set_Attribute_Single commands to write the attribute values. Serial Stream Object Configuration (Class Code 64 or 0x40) Attribute 6. Baud Rate 7. Parity 10. Flow Control 13. Max Receive Size 14. Data Format 15. Block Mode
Data 0 0 2 15 00000001 00000110
Class / Instance / Attribute / Data 0x40 0x01 0x06 0x00 0x40 0x01 0x07 0x00 0x40 0x01 0x0A 0x02 0x40 0x01 0x0D 0x0F 0x40 0x01 0x0E 0x01 0x40 0x01 0x0F 0x06
16. Delimiter
ETX
0x40 0x01 0x10 0x03
Description 0 = 9600 bps 0 = no parity 2 = CTS / RTS Receive messages up to 15 bytes String Format = Byte Array Delimiter = enabled Strip Delimiter enabled Post -Delimiter 0x03 = ASCII ETX character
The gateway will return up to 16 bytes of Receive Data, because the Maximum Receive Size is set to 15 and the data format is Short String (add 1 for length byte). The Status byte is enabled. The Receive Sequence Number byte is not enabled. The Poll Produce Size can now be calculated for this CDN060 configuration.
+
Status byte Receive Sequence Number byte Short_String length byte Maximum Receive Size Poll Produce Size
MKS Instruments, Inc.
D.I.P. Products Group
1 0 1 15 17
63