The text of a manual · part 8 of 8
DN120 DeviceNet Gateway User's Manual, pages 64 to 71
Pages 64 to 71 of 71
The original document is the PDF (1.4 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 Microscan DN-120
Page 64
DN120 DeviceNet Gateway User’s Manual The format of the Poll Response Message input bytes is as follows: [ Status ] [ Short_String length ] [ Short_String data ] [ undefined bytes ] 1 byte 1 byte 0-15 bytes
The gateway always returns 16 input bytes in the Poll Response Message, even if the scanned barcode data contains fewer bytes, or if a new barcode message has not been received. The gateway returns new message data only once, and returns a null data string if there is no new message data. The application should use the Short_String length byte to determine if a new message is being returned. A length greater than zero indicates the number of valid data bytes (new message data). A length of 0 indicates no valid data bytes (no new message). The Barcode Scanner sends the following 6-byte serial message when it reads a UPC label printed with ‘12345’ (ASCII numbers). 0x31 0x32 0x33 0x34 0x35 0x03
The gateway generates the following Poll Response Message in response to the first Poll Command Message after its receives the Barcode message. The Status Byte is 0x0A, indicating no transmit or receive errors, an empty Transmit Buffer, and an empty Receive Buffer. The Delimiter is stripped, so the Short_String length is 5. There are 5 valid data bytes, and the remaining 10 input bytes are undefined. 0x0A
0x05
0x31 0x32 0x33 0x34 0x35
XX XX XX XX XX XX XX XX XX XX
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 15 other input bytes are undefined. 0x0A
0x00
Microscan Systems, Inc.
XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
64
Page 65
DN120 DeviceNet Gateway User’s Manual
Example 4 – Transmitting Fixed-Length Data Print an ASCII string from a PLC to a bar code scanner, using a DN120 gateway and a DeviceNet scanner (master). The text message string is always 25 characters long, including any ASCII control characters. The bar code scanner RS232 channel is connected to a DN120 serial channel. The DN120 DeviceNet channel is connected to the PLC DeviceNet scanner. The DeviceNet network is powered by an external 24VDC power supply. PLC & DeviceNet Scanner Bar Code Scanner
DN120 Gateway
Power Supply
DeviceNet network
RS232
Bar Code Scanner The bar code scanner’s RS232 channel is set for 9600 bps, 7 data bits, even parity, and 1 stop bit. DN120 Gateway The DN120 serial channel is configured to transmit this RS232 message format. A string format will be Byte Array, since the message size is fixed. Transmit Sequence Numbers will be used to signal a new message to transmit. The Maximum Transmit Size is 25, which is the number of message bytes. The Serial Stream Object attributes are shown below 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 14. Data Format 15. Block Mode 18. Max Transmit Size
Data 5 1 1 00000000 00010000 25
Class / Instance / Attribute / Data 0x40 0x01 0x06 0x05 0x40 0x01 0x07 0x01 0x40 0x01 0x0A 0x01 0x40 0x01 0x0E 0x00 0x40 0x01 0x0F 0x10 0x40 0x01 0x12 0x19
Description 5 = 300 bps 1 = Even parity 1 = XON / XOFF String Format = Byte Array Transmit Sequence Number enabled Fixed message size of 25 bytes
The gateway will transmit 25 output bytes received in a Poll Command Message. The Status Clear byte is not enabled. The Transmit Sequence Number is enabled. The Length Byte is not enabled (Byte Array format). The Poll Consume Size can now be calculated for this DN120 configuration.
+
Status Clear byte Transmit Sequence Number byte Short_String length byte Maximum Receive Size Poll Produce Size
Microscan Systems, Inc.
0 1 0 25 26
65
Page 66
DN120 DeviceNet Gateway User’s Manual The format of the Poll Command Message output bytes is as follows: [ Transmit Sequence Number ] [ message data ] 1 byte 25 bytes
The gateway always receives 26 output bytes in the Poll Command Message. It will not transmit a new serial message until the Transmit Sequence Number received in the Poll Command is different than the number received in a previous Poll Command. The application should increment the Transmit Sequence Number when it sends new output byte values in the Poll Command Message, to enable the transmission of the new message.
Microscan Systems, Inc.
66
Page 67
DN120 DeviceNet Gateway User’s Manual
Example 5 – Transmitting Variable-Length Data Same configuration as Example 4, except the text message string can be from 1 to 25 characters long, including ASCII control characters. Bar Code Scanner The bar code scanner’s RS232 channel is set for 9600 bps, 7 data bits, even parity, and 1 stop bit. DN120 Gateway The DN120 serial channel is configured to transmit this RS232 message format. A string format will be Short_String, since the message size is variable. The Maximum Transmit Size is 25, since the largest text message contains 25 characters. The Serial Stream Object attributes are shown below 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 14. Data Format 15. Block Mode 18. Max Transmit Size
Data 5 1 1 00000001 00000000 25
Class / Instance / Attribute / Data 0x40 0x01 0x06 0x05 0x40 0x01 0x07 0x01 0x40 0x01 0x0A 0x01 0x40 0x01 0x0E 0x01 0x40 0x01 0x0F 0x00 0x40 0x01 0x12 0x19
Description 5 = 300 bps 1 = Even parity 1 = XON / XOFF String Format = Short_String Transmit Sequence Number disabled Fixed message size of 25 bytes
The gateway will transmit the output bytes received in a Poll Command Message. The Status Clear byte is not enabled. The Transmit Sequence Number is not enabled. The Length Byte is enabled (Short_String format). The Poll Consume Size can now be calculated for this DN120 configuration.
+
Status Clear byte Transmit Sequence Number byte Short_String length byte Maximum Receive Size Poll Produce Size
0 0 1 25 26
The format of the Poll Command Message output bytes is as follows: [ Short_String length ] [ message data ] 1 byte 25 bytes
The gateway always receives 26 output bytes in the Poll Command Message, regardless of the variable length messages. The gateway uses the Short_String length byte to determine the valid number of message bytes in the Poll Command Message. It will only transmit the valid message bytes. All remaining output bytes are ignored. If the gateway receives a Poll Command Message with Short_String length = 0, no output bytes are transmitted. The application can send variable-length Short_Strings to be transmitted, and send Null Data (length = 0) when there is no message to transmit.
Microscan Systems, Inc.
67
Page 68
DN120 DeviceNet Gateway User’s Manual
Chapter 8 – Troubleshooting Problem DeviceNet Configuration Program • does not recognize Gateway.
Possible Cause Register Gateway EDS file with Configuration Program.
DeviceNet Configuration Program • does not recognize Gateway after loading EDS file.
Check Major and Minor Revisions for Gateway and EDS file, to see if you have correct EDS file for your Gateway's firmware version.
Gateway does not appear on DeviceNet network.
• • • • •
Check wiring and cable connections. Check DeviceNet power supply voltage. Make sure Gateway baud rate matches network baud rate. Verify Gateway baud rate is set from rotary switches or retentive memory value. Make sure Gateway MAC ID is not used by another device.
After setting Gateway MAC ID, DeviceNet Master does not recognize Gateway.
• • • •
Disconnect Gateway from network before changing MAC ID. Make sure Gateway MAC ID is not used by another device. Verify Gateway MAC ID is set from rotary switches or retentive memory value. Verify DeviceNet baud rate.
NET LED is flashing red.
•
Gateway is removed from DeviceNet Master scanlist or network. Power cycle Gateway to reset.
NET LED is solid red.
•
Make sure Gateway MAC ID is not used by another device. Possible DeviceNet network failure.
NET LED is off.
• • • •
Check wiring and cable connections. Check DeviceNet power supply voltage. Make sure Gateway baud rate matches network baud rate. Verify Gateway baud rate is set from rotary switches or retentive memory value.
MOD LED is flashing or solid red. •
Gateway has failed. Cycle power to reset. Replace Gateway if necessary.
RX LED does not flash green when • data is sent to the Gateway. • • •
If Sync enabled, make sure Receive Request Number and Receive Acknowledge Number are equal. Application must acknowledge last received message before gateway will receive the next message. Verify data is being received in Receive Data. Verify source device is transmitting data to Gateway. Make sure hardware flow control signals are properly connected.
RX LED is solid red after Gateway • receives data. •
Check Status byte for any Receiver errors. Reset Gateway or clear Status error bits if necessary. Make sure parity is set to match transmitting device settings.
TX LED is solid red after receiving • data from DeviceNet Master. •
Check Status byte for Transmitter errors. Reset Gateway or clear Status error bits if necessary. Make sure parity is set to match receiving device settings.
TX LED does not flash green when • Gateway should be transmitting data. • 1747-SDN Scanner displays error • code 77.
If Transmit Sequence Number enabled, make sure number is being incremented by the application. Gateway will not transmit new data unless the Transmit Sequence Number is changed. Verify data is being saved in Transmit Data. Gateway Poll Produce Size and/or Poll Consume Size value do not 1747-SDN Poll Rx/Tx settings.
Microscan Systems, Inc.
68
Page 69
DN120 DeviceNet Gateway User’s Manual
Appendix A – Product Specifications DeviceNet Interface Power Requirements: Loss of Ground: Reverse Polarity: Signal Levels:
11 - 28 Vdc @ 50 mA Yes -30 Vdc ISO11898
Serial Channel Isolation: ESD Protection: Overload Protection: Short Circuit: RS232 Output Levels:
500 Volts +/- 10 kV +/- 30 Volts Indefinite +/- 7.9 Volts (unloaded, typical)
Environmental Operating Temperature: Storage Temperature: Size (inches): Mounting (inches) PCB Encapsulation:
0o C to 70o C -25o C to 85o C 3.25 x 2.37 x 1.08 0.5 tabs, 3/16 diameter mounting holes RTV Silicon Compound
Microscan Systems, Inc.
69
Page 70
DN120 DeviceNet Gateway User’s Manual
Appendix B – DeviceNet Template Class
Instance
Attribute
Microscan Systems, Inc.
Default
Setting
Unit
Comments
70
Page 71
DN120 DeviceNet Gateway User’s Manual
Appendix C – ASCII Character Codes Non-Printable Characters
Printable Characters
Hex
Dec
Char
Name
Kybd Hex
Dec
Char
Hex
Dec
Char
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
Null Start of heading Start of text End of text End of transmit Enquiry Acknowledge Bell Backspace Horizontal tab Line feed Vertical tab Form feed Carriage return Shift out Shift in Data line escape Device control 1 Device control 2 Device control 3 Device control 4 Negative acknowledge Synchronous idle End of transmit block Cancel End of medium Substitute Escape File separator Group separator Record separator Unit separator
Ctrl @ Ctrl A Ctrl B Ctrl C Ctrl D Ctrl E Ctrl F Ctrl G Ctrl H Ctrl I Ctrl J Ctrl K Ctrl L Ctrl M Ctrl N Ctrl O Ctrl P Ctrl Q Ctrl R Ctrl S Ctrl T Ctrl U Ctrl V Ctrl W Ctrl X Ctrl Y Ctrl Z Ctrl [ Ctrl \ Ctrl ] Ctrl ^ Ctrl _
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 53 55 56 57 58 59 60 61 62 63
Space ! " # $ % & ' ( ) * + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5A 0x5B 0x5C 0x5D 0x5E 0x5F
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _
Microscan Systems, Inc.
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3A 0x3B 0x3C 0x3D 0x3E 0x3F
Hex
Dec
Char
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A 0x6B 0x6C 0x6D 0x6E 0x6F 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7A 0x7B 0x7C 0x7D 0x7E 0x7F
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL
71