Data Communication And Networking

50 421 0
Data Communication And Networking

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Data Communication and Networking Dr –Ing Vo Que Son Email: sonvq@hcmut.edu.vn Telecomm Dept Faculty of EEE DCN-2013 HCMUT Content  Chapter 3: Data Link Layer Protocols Flow Control Error Control Connection Management Data link layer Protocols  Chapter 4: Industrial Networks MODBUS Controller Area Network Applications Telecomm Dept Faculty of EEE DCN-2013 HCMUT     MODBUS MODBUS Protocol is a Serial Communication Protocol created by MODICON company to connect PLC to programming tools It is now widely used to establish master-slave communication between intelligent devices It can be implemented using RS232, RS422, or RS485 variety (e.g fiber, MODBUSofismedia independent of the radio, physicalcellular, layer etc ) Telecomm Dept Faculty of EEE or over a DCN-2013 HCMUT MODBUS  MODBUS Serial line RS485 is a low cost network using a master/slave medium access with a transmission speed from 1,200 to 115 Kbits/s Telecomm Dept Faculty of EEE Applicatio Application Modbus Presentation Session Transport Network Link Physical Maste Slave r - RS485 DCN-2013 HCMUT MODBUS  MODBUS TCP/IP uses TCP/IP and Ethernet 10 Mbit/s or 100 Mbits/s to carry the MODBUS messaging structure Applicatio Application Préee Préeentation Session Modbus Transport TCP Network Link IP CSMA / CD ETHERNET V Telecomm Dept Faculty of EEE o 802.3 r Physical DCN-2013 HCMUT MODBUS  MODBUS PLUS is a higher speed network Mbit/s token passing derivative that uses the MODBUS messaging structure Telecomm Dept Faculty of EEE Applicatio Application Modbus Presentation Session Transport Network Link Physical 802.4 Token passing RS485 DCN-2013 HCMUT MODBUS ASCII and RTU The MODBUS protocol comes in versions : ASCII transmission mode: Each eight-bit byte in a message is sent as ASCII characters RTU transmission mode: Each eight-bit byte in a message is sent as two four-bit hexadecimal characters The main advantage of the RTU mode is that it achieves higher throughput ASCII mode allows time intervals of up to second to occur between characters without causing an error Telecomm Dept Faculty of EEE DCN-2013 HCMUT MODBUS Frame Structure  The Modbus frame structure is the same for requests (master to slave messages) and responses (slave to master messages) Modbus RTU silence Address Function Data Checksum silence Silence >= 3,5 characters Modbus ASCII : Address 0x3A Telecomm Dept Faculty of EEE Function Data Checksum CR 0x0D LF 0x0A DCN-2013 HCMUT Address field Address Function Data Checksum  Valid slave device addresses are in the range of 247 decimal  The individual slave devices are assigned addresses in the range of 247  Value is reserved for broadcast messages (no response)  Request :  A master addresses a slave by placing the slave address in the address field of the message  Response :  When the slave sends its response, it places its own address in this address field of the response to let the master know which Telecomm Dept slave is responding Faculty of EEE DCN-2013 HCMUT Function field Address Function Data Checksum Valid codes are in the range of 255 decimal Request : The function code field tells the slave what kind of action to perform Response : For a normal response, the slave simply echoes the original function code For an exception response, the slave returns a code that is equivalent to the original function Telecomm Dept code with its most significant bit set to a logic Faculty of EEE DCN-2013 HCMUT 10 Ex: Binary Countdown Telecomm Dept Faculty of EEE DCN-2013 HCMUT 36 Physical Layer Possibilities MUST support bit dominance Specifically rules out transformer coupling for high-noise applications Differential driver used • • Voltage across wires is dominant; high impedance (0V differential) is recessive Opto-isolators are commonly used as we Telecomm Dept Faculty of EEE DCN-2013 HCMUT 37 Non-Return to Zero (NRZ) Encoding  Send a Zero as LO; send One as HI  Worst case can have all zero or all one in a message – no edges in data  Simplest solution is to limit data length to perhaps bits • SYNC andtechnique END arecommonly opposite values, guaranteeing edges per This is the used on computer serial portstwo / UARTs  Bandwidth is one edge per bit message • Telecomm Dept Faculty of EEE DCN-2013 HCMUT 38 Bit Stuffing To Add Edges To NRZ Encoding  Long NRZ messages cause problems in receivers  Clock drif means that if there are no edges, receivers lose track of bits   Periodic edges allow receiver to resynchronize to sender clock Solution: add “stuff bits”  Stuff bits are extra bits added to force transitions regardless of data  Typical approach: add an opposite-valued stuff bit after every identical bits  In best case you don’t need stuff bits – they only are needed for runs of values Telecomm Dept Faculty of EEE DCN-2013 HCMUT 39   CAN - Message SOF – Start of frame (SYNC symbol): Format Single dominant bit Arbitration field – binary countdown priority value; set by application  An RTR (remote transmission) field for atomic transactions  Control field  4-bit data length (number of bytes in data field); valid values:  bit specifies standard or extended format; bit unused  Data field: to bytes  CRC field: 15-bit CRC, followed by one recessive delimiter bit ACK field: If message received OK, assert as dominant bit (at  least one node received) END of frame delimiter: recessive bits mark end of frame(phase violation for bit stuff pattern)  Telecomm Dept Faculty of EEE DCN-2013 HCMUT 40 CAN - Error Detection Error detection: Using CRC Telecomm Dept Faculty of EEE DCN-2013 HCMUT 41 “Big” and “Small” nodes  Some nodes can handle a lot of messages  Many message mailboxes/filters  Fast processor  Some small nodes have limited capacity  One or two mailboxes/filters via one  Slow processor  Dedicated mailbox per message (hardware ensures no data lost)  System designer has to prevent message over-run  If mailbox shared, ensure messages to slow processors are of: spaced•apart • • Must be infrequent Must ALSO not be clumped closer than receiver response time This ends up being a constraint for real time scheduling (a later lecture) Telecomm Dept Faculty of EEE DCN-2013 HCMUT 42 “Big ” and “Small” nodes  “Small” node: Could get over-run with messages even if it didn’t need them  “Big” node: hardware message filters sort & filter messages without interrupting CPU  Message object holds most recent message for that type – not a queue! Telecomm Dept Faculty of EEE DCN-2013 HCMUT 43  Mask Registers Used to set up message filters  Mask register selects bits to examine  Object Arbitration register selects bits that must match to be accepted  Map multiple messages into each message object “mailbox” Telecomm Dept Faculty of EEE DCN-2013 HCMUT 44  Mask Registers: Example Mask Register:   Message Object Arbitration: Effective Match Value:  Matches theses message IDs Telecomm Dept Faculty of EEE DCN-2013 HCMUT 45 DeviceNet One of several higher-level protocols Based on top of CAN Used for industrial control (valves, motor starters, display panels, …) • Caterpillar is a member of ODVA as well (Open DeviceNet Vendors Assn.), but for factory automation Basic ideas: CAN is used in high volumes = cheaper network chips than competitors But it does specify a hierarchy of message ID format Use structured approach to message formats to Telecomm Dept standardize Faculty of EEE operation DCN-2013 HCMUT 46   DeviceNet Each node on network “owns” a source node or message ID (or both)  E.g., Use message object arbitration to subscribe to a particular message ID Use message filters to only listen to messages you care about   E.g., Use mask object to accept that message ID from any source node # Elevator example: message ID is button press; source node # tells which • Single receiver mailbox then holds most recently received button press message button • Message must be processed before next such message is received Telecomm Dept Faculty of EEE DCN-2013 HCMUT 47 DeviceNet Group Strategy  Group Prioritized by Message ID / Node number High priority messages with fairness to nodes  Group Prioritized by Node number / Message ID Gives nodes priority to have  Group Global housekeeping messages / must be unique in system Essentially same as Group 1, but allows Group (no node number) higher priority Telecomm Dept Faculty of EEE DCN-2013 HCMUT 48 CAN Example Digital radio - = -•=-_:_~mt• Window lift Universal light Additional i l Steer ng wheel pane l Universal motor CAN Controller area network GPS Global Positioning System GSM LIN MOST Telecomm Dept Faculty of EEE Universal pane Global System for Mobile Communications Local interconnect network Media-oriented systemstransport [Leen02] DCN-2013 HCMUT 49  CAN Tradeoff Advantages:  High throughput under light loads   Local and global prioritization possible  Arbitration is part of the message - low overhead tpd bit length)  Unfair access - node with a high priority can "hog" the network  Requires bit dominance (can’t be used with transformer coupling) • Can be reduced in severity with Message + Node # prioritization  Propagation delay limits bus length (2 Disadvantages: • Can, in principle, use a bus guardian to limit duty cycle of each node   Poor latency for low priority nodes: Starvation is possible Optimized for:  Moderately large number of message types Telecomm Dept  Arbitration overhead is constant Faculty of EEE DCN-2013 HCMUT 50 ... survive in automation world more interested with interconnecting to Ethernet networks and more specially, IP/Ethernet  networks Using MODBUS TCP and Client/Server model for communication Telecomm... Control Error Control Connection Management Data link layer Protocols  Chapter 4: Industrial Networks MODBUS Controller Area Network Applications Telecomm Dept Faculty of EEE DCN-2013 HCMUT... Communication speed 83 kbps Applications:  Main Automotive Protocol: Mercedes-Benz uses several CAN networks Depending on model and year the following may be used  Factory Automation  Machine Control

Ngày đăng: 04/12/2016, 08:57

Từ khóa liên quan

Mục lục

  • Slide 1

  • Slide 2

  • Slide 3

  • Slide 4

  • Slide 5

  • Slide 6

  • Slide 7

  • Slide 8

  • Slide 9

  • Slide 10

  • Slide 11

  • Slide 12

  • Slide 13

  • Slide 14

  • Slide 15

  • Slide 16

  • Slide 17

  • Slide 18

  • Slide 19

  • Slide 20

Tài liệu cùng người dùng

Tài liệu liên quan