Motor a Pasos

Páginas: 10 (2275 palabras) Publicado: 24 de octubre de 2011
Document Type: Tutorial NI Supported: Yes Publish Date: Feb 18, 2009

Introduction to MODBUS
Overview MODBUS is an application-layer protocol based on a client/server or request/reply architecture. It was published by Modicon and 1979 and is primarily used in industrial applications. The following tutorial outlines the high level functionality of the MODBUS application layer with emphasis onthe specifications for a serial implementation and TCP/IP specification. For more details, please see the complete MODBUS specifications on www.modbus.org. Table of Contents 1. 2. 3. 4. 5. 6. MODBUS Protocol Hardware Implementations LabVIEW Libraries MODBUS IO server MODBUS Frequently Asked Questions 1Resources

MODBUS Protocol Introduction The MODBUS protocol follows a client/server(master/slave) architecture where a client will request data from the server. The client can also ask the server to perform some action. The client initiates a process by sending a function code that represents the type of transaction to perform. The transaction performed by the MODBUS protocol defines the process a controller uses to request access to another device, how it will respond to requests fromother devices, and how errors will be detected and reported. The MODBUS protocol establishes a common format for the layout and contents of message fields. During communications on a MODBUS network, the protocol determines how each controller will know its device address, recognize a message addressed to it, determine the kind of action to be taken, and extract any data or other informationcontained in the message. Controllers communicate using a master/slave technique where only one device, the master, can initiate transactions or queries. The other devices, slaves, respond by supplying the requested data to the master or by taking the action requested in the query. Typical master devices include host processors and programming panels. Typical slaves include programmable controllers.Figure 1: Basic MODBUS Network1

Figure 2: Basic MODBUS Transaction1

The messages exchanged between the client and the server is called frames. There are two types of MODBUS frames: Protocol Data Unit (PDU) and Application Data Unit (ADU). The PDU frames contain a function code followed by data. The function code represents the action to perform and the data represents the information to beused for this action. ADU frames add a little more complexity with an additional address part. ADU frames also provide some error checking. Both the ADU and PDU frames follow Big-Endian encoding.

1/10

www.ni.com

Figure 3: MODBUS Frame1

MODBUS transactions always perform a set of actions by reading or writing to a set of four data types. Table 1 describes the four data formats usedby the MODBUS application layer.

Table 3: MODBUS Data Types1

The Discrete Inputs represent a single bit (Boolean) which can only be read. In other words, the client can only perform a read action on the discrete inputs. The same holds for the Input Registers. The client can only read the server’s Input Registers. The difference between the Discrete Inputs and the Input Registers is that theInput Registers represent 16 bits while the Discrete Inputs are only a single bit. The Coils also represent a Boolean data type which can be read and written from the client. The Holding Registers represent a 16 bit word that can be read and written to.

Figure 4: MODBUS Transaction with Data Types1

The Complete MODBUS Transaction As mentioned before, the type of action that the serverperforms is defined by a function code. For example, if the client wants to reads a certain Discrete Input, it will send a function code of 0x02 followed by the address of the desired Discrete Input. The server will read the 0x02 and will know that the client wants a Discrete Input. The server will retrieve the Discrete Input from the given address and reply back to the client.

2/10

www.ni.com...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • MOTOR A PASOS
  • Motores a paso
  • motor de pasos
  • Motor a pasos
  • Motores a paso
  • Motores a Pasos
  • Motor a pasos
  • Motores A Pasos

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS