Tip 56_ General Notes About PROFIBUS and EM 277

  • View
    219

  • Download
    5

Embed Size (px)

Text of Tip 56_ General Notes About PROFIBUS and EM 277

  • 7/25/2019 Tip 56_ General Notes About PROFIBUS and EM 277

    1/12

    6/22/2016 Tip 56: General Notes about PROFIBUS and EM 277

    file:///E:/DATA%20PSM/PLC/tips/tip56.htm

    Version 5.0. Updated 10/01

    General Notes about PROFIBUS and EM 277 (Tip 56)

    Category: CommunicationsSpecial Hardware Requirements:

    One SIMATIC S7-200 CPU 222, CPU 224, CPU 226, or CPU 226XMOne EM 277 PROFIBUS DP expansion module

    Print this Tip

    The S7-200 CPUs can be connected to a PROFIBUS DP network by using an EM 277 PROFIBUS DP expansionmodule. PROFIBUS stands for Process Field Bus. DP stands for distributed peripherals, that is, remote I/O. The EM277 allows the S7-200 CPUs to be DP slave devices on a DP network. A DP master can write data to and read datafrom the S7-200 CPU over the DP network by using the EM 277 PROFIBUS DP module.

    Memory Model DP Master and DP Slave

    The purpose of a PROFIBUS DP connection is the exchange of data. A master device writes output data to a slavedevice. The slave device responds to the write request with input data to be returned to the master.

    The master transfers data from an I/O output area to the slave's output buffer (Receive mailbox). The master reads datafrom the slave's input buffer (Send mailbox) and stores it in an I/O input area. The output and input buffers are located in

    the CPU's variable memory (V memory) area. The figure below shows the memory model for a transfer of 16 output bytesand 16 input bytes.

    PROFIBUS-DP always describes data transfers with respect to the master. Data that is transferred from the master tothe slave is always referred to as output data. Data that is transferred from the slave to the master is always referred toas input data. In the slave, data values that come from the master are still referred to as outputs, even though they areinputs to the slave. In the same manner, data values that are returned to the master are still referred to as inputs, eventhough they are outputs from the slave.

  • 7/25/2019 Tip 56_ General Notes About PROFIBUS and EM 277

    2/12

    6/22/2016 Tip 56: General Notes about PROFIBUS and EM 277

    file:///E:/DATA%20PSM/PLC/tips/tip56.htm 2

    The master tells the slave the start address of the output buffer (Receive mailbox). The master sends the V memoryoffset of the output buffer to the slave as part of the parameter assignment of the slave. If this offset is zero, the slavewill place the output buffer at VB0. If the offset is 5000, the slave will place the output buffer at VB5000.

    The master also tells the slave the size of the output buffer (Receive mailbox). The user configures the master to writesome number of bytes of data to the slave. The master sends this information to the slave as part of the configuration ofthe slave. The slave uses this information to set the size of the output buffer. If the master tells the slave that there are16 output bytes, the slave will set the size of the output buffer to 16 bytes. If the output buffer starts at VB5000, output

    data from the master will be written to locations VB5000 through VB5015.

    The input buffer (Send mailbox, or data to be returned to the master) immediately follows the output buffer. The user alsoconfigures the master for the amount of data to be returned by the slave. This value is written to the slave as part of theslave configuration. The slave uses this information to set the size of the input buffer. Continuing with the exampleabove, if the master places the output buffer at VB5000 and sets the size to 16 bytes, the input buffer will begin atVB5016, directly after the output buffer. If the size of the input buffer is also 16 bytes, the input buffer will be placed atVB5016 through VB5031.

    After the connection between master and slave has been established, the location of the output buffer and the size ofeach buffer can be read from the special memory (SM) of the CPU. The following special memory locations describe thefirst EM 277 module attached to the expansion bus. If the EM 277 is the second intelligent module (non-I/O module), thenthe SM addresses are offset by 50 (SMB250 to SMB279).

    SMB200 to 215 These locations contain 16 ASCII characters giving the module name.

    SMB216 to 219 These locations contain the software revision of the EM 277. The first two characters are themajor revision and the second two characters are the minor revision. For example: if SMB216-219contain 0102, the software revision is 1.02.

    SMW220 This is the EM 277 module error status. Only two values are currently defined. A zero in thislocation means that there are no errors. A value of one means that there is no user supplied 24VDC power attached to the module.

    SMB222 This is the address of the EM 277 that is read from the switches.

    SMB224 This byte location contains the status of the PROFIBUS DP connection. The user program shouldmonitor this location so that the program knows if the DP connection is operating properly. If there

  • 7/25/2019 Tip 56_ General Notes About PROFIBUS and EM 277

    3/12

    6/22/2016 Tip 56: General Notes about PROFIBUS and EM 277

    file:///E:/DATA%20PSM/PLC/tips/tip56.htm 3

    is an error (any value except 2), the program can take action based on the failure of the DPconnection. The following status values are defined:

    0 = No DP communication has occurred since the EM 277 was powered on.1 = The DP master is communicating to the EM 277 but there is a problem with the configuration orparameter assignment information sent by the master.2 = The EM 277 and the DP master are currently exchanging data (normal operation).3 = The EM 277 and the DP master are not currently exchanging data but were exchanging data inthe past.

    SMB225 This byte contains the address of the master that configured the EM 277. This is the master that is

    able to write outputs and read the inputs of the slave.

    SMW226 This word contains the V memory address of the output buffer (Receive mailbox). This value iswritten to the slave in a parameter assignment message during the initialization of the connection.

    SMB228 This byte contains the size of the output buffer (size of the Receive mailbox in bytes). This value iswritten to the slave in a configuration message during the initialization of the connection.

    SMB229 This byte contains the size of the input buffer (size of the Send mailbox in bytes). This value iswritten to the slave in a configuration message during the initialization of the connection.

    Note that special memory locations 226 through 229 (or 276 through 279) show data written to the EM 277 by thePROFIBUS DP master. Writing to these locations will not change the address or size of the buffers. The EM 277 writesthese locations to the CPU whenever there is a change in the PROFIBUS DP status or when the master writes newvalues to the EM 277.

    In STEP 7Micro/WIN (revision 3.1), to display all of the values described above, click PLC on the menu bar.

    On the PLC menu, click Information. In the Information screen, select an intelligent module, and then click theIntelligent Module Information button.

    Using the EM 277 with a Programming Device or HMI

    In addition to acting as a DP slave, the EM 277 can also be used as a programming or HMI port. A programming devicecan upload or download programs to the CPU that is attached to the EM 277. An HMI device can read data from or writedata to the CPU that is attached to the EM 277. The programming device or HMI can be connected to the EM 277 at thesame time as a DP master the DP and programming device/HMI operations do not interfere with each other. To use aprogramming device or HMI device with an EM 277, the programming device or HMI device must be set up to use MPI orPROFIBUS communications. (The EM 277 will not communicate with a programming device/HMI device that is usingPPI protocol.) Use the Setting the PG/PC Interface dialog box to set up communications on the programming device

    Setting the DP Address of the EM 277

    Remove power from the CPU and the EM 277.Set the rotary switches on the front of the EM 277 to the desired address. The top switch (marked X10) setsthe most significant digit of the address (the tens digit). The lower switch (marked X1) sets the least significantdigit of the address (the ones digit).

    Apply power to the CPU and the EM 277.

    Note that the address switches on the EM 277 are only read when the EM 277 is powered on. Changing the addressswitches on the EM 277 with power applied has no effect until the next power cycle.

    Configuring a DP master

    The configuration of a DP master varies considerably depending on the type of device being configured. Tip 57 "How toConnect an S7-300 (Master) to an S7-200 (Slave) by Means of PROFIBUS" describes how to configure a CPU 315-2 DPto communicate with an S7-200 CPU that has an EM 277 PROFIBUS DP module.

    General Notes on PROFIBUS DP

    Contents:

    1.0 General 2.0 Basic PROFIBUS-DP Functions 2.1 Basic Characteristics

  • 7/25/2019 Tip 56_ General Notes About PROFIBUS and EM 277

    4/12

    6/22/2016 Tip 56: General Notes about PROFIBUS and EM 277

    file:///E:/DATA%20PSM/PLC/tips/tip56.htm 4

    2.2 System Configuration and Types of Devices2.3 System Behavior2.4 Cyclic Data Transmission between the DPM1 and the DP Slaves2.4.1 Parameter Assignment2.4.1 Configuration2.4.1 Data Exchange2.5 SYNC and FREEZE Mode2.6 Protection Mechanisms

    3.0 Extended DP Functions3.1 DPV1 Extensions

    3.2 Other Extensions4.0 Device Database (GSD) Files

    1.0 General

    PROFIBUS DP is designed for high-speed data communication at the device level. The protocol and functions aredesigned according to European Standard EN 50 170. PROFIBUS controllers (programm