title: devicenettm slave communication product(s): g3

14
TECHNICAL NOTE TNOI36 Title: DeviceNet TM Slave Communication Product(s): G3, Modular Controller Enhanced Master and DSP ABSTRACT The purpose of this document is to describe the G3’s support for DeviceNet TM and detail the configuration steps necessary to use this feature. It is NOT intended that this document provide a detailed description of DeviceNet TM , but only a brief introduction, necessary to define the terms that are used throughout the remainder of this document. INTRODUCTION DeviceNet TM is a low-level network using the Controller Area Network (CAN) technology, to provide communication between a range of industrial devices, from simple devices such as sensors and actuators, to high-level devices such as controllers and HMIs. ABOUT DEVICENET TM DeviceNet TM is a connection-based network. In this context the term connection refers to a communication path between two or more devices, and not the physical (cable) connection to the DeviceNet network. A connection must be established between two devices in order to transfer data. There are two types of connection defined by the DeviceNet specification. Each has different characteristics and is suited to a specific type of communication. I/O Connection – Dedicated data transfer between a producer and one or more consumers. The format of the data is known or implied by the connection. Explicit Messaging – Generic multi-purpose messaging connection, typically command and response message commands. Each connection type has an extensive number of parameters, which can affect the characteristics of the communication path. For many Master/Slave communications scenarios, a defined set of connections, together with their respective parameter settings exist under the collective name Predefined Master/Slave Connection Set. Many of the steps involved in creating and configuring a connection have been removed with this connection set, thus simplifying the network configuration.

Upload: others

Post on 17-Mar-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

TECHNICAL NOTE TNOI36

Title: DeviceNetTM Slave Communication

Product(s): G3, Modular Controller Enhanced Master and DSP

ABSTRACT The purpose of this document is to describe the G3’s support for DeviceNetTM and detail the configuration steps necessary to use this feature. It is NOT intended that this document provide a detailed description of DeviceNetTM, but only a brief introduction, necessary to define the terms that are used throughout the remainder of this document.

INTRODUCTION DeviceNetTM is a low-level network using the Controller Area Network (CAN) technology, to provide communication between a range of industrial devices, from simple devices such as sensors and actuators, to high-level devices such as controllers and HMIs.

ABOUT DEVICENETTM DeviceNetTM is a connection-based network. In this context the term connection refers to a communication path between two or more devices, and not the physical (cable) connection to the DeviceNet network. A connection must be established between two devices in order to transfer data.

There are two types of connection defined by the DeviceNet specification. Each has different characteristics and is suited to a specific type of communication.

• I/O Connection – Dedicated data transfer between a producer and one or more consumers. The format of the data is known or implied by the connection.

• Explicit Messaging – Generic multi-purpose messaging connection, typically command and response message commands.

Each connection type has an extensive number of parameters, which can affect the characteristics of the communication path. For many Master/Slave communications scenarios, a defined set of connections, together with their respective parameter settings exist under the collective name Predefined Master/Slave Connection Set. Many of the steps involved in creating and configuring a connection have been removed with this connection set, thus simplifying the network configuration.

Predefined Master/Slave Connection Set The DeviceNetTM specification details a number of connections that facilitate data transfer between a Master and Slave devices. The following sections detail the connection types supported by the G3.

• I/O Bit-Strobe Connection

The Bit-Strobe connection is an I/O connection over which Bit-Strobe I/O command and response messages are transferred. The Bit-Strobe command is broadcast by the Master device and is received by all slave devices simultaneously. The command message contains a single bit of information for each slave on the network. Each slave device is required to respond with a Bit-Strobe response message. The response message can contain up to 8 bytes of information.

• I/O Poll Connection

The Poll connection is an I/O connection over which Poll command and response messages are transferred. The Poll command is transmitted by the master, and is directed to a single slave device. The slave device in turn responds with a Poll response message. Both the Poll command and Poll response messages can contain any number of bytes.

• I/O Data Connection

The I/O Data connection is part of the Predefined Master/Slave Connection Set, but instead is included for devices, which support creating I/O data connections via the UCMM (Unconnected Message Manager).

Level of Support The G3 provides Group 2 Server level support: A UCMM capable device that is configured to act as a Slave for the Predefined Master/Slave connection set.

HARDWARE To use DeviceNetTM on the G3, Enhanced Modular Controller or Data Station Plus platforms, an option card must first be installed. The option card provides the hardware necessary to support the CAN physical layer specification as required by the DeviceNetTM standard.

Configuring the option card is a two-stage process; first the option card must be selected in Crimson (DeviceNet Option Card), and then the ‘DeviceNet Predefined Group 2 Server Driver’ configured to run on the newly created DeviceNet Interface port.

CRIMSON 2.0 CONFIGURATION The following example requires the usage of an Allen Bradley 1756-ControlLogix PLC, along with RSLogix5000 and RSNetWorx for DeviceNet software and a G310 HMI.

Configure the G3 DeviceNet option card. Install the G3DN0000 option card in the G310 as per the provided instructions.

Click on File>New to create a new Crimson database and select G3 Series HMI – G310.

Enter the Communications section. In the tree on the left, select G3 from the top of the tree. Select the Edit button at the right, and select the DeviceNet Option Card from the dialog box as shown in Fig. 1. Click OK.

Fig. 1

The DeviceNet Option card appears at the end of the tree. Select the DeviceNet Interface from under the DeviceNet Option Card item.

On the right hand pane, click on the Edit button to open the driver picker dialog box. Select the DeviceNet Predefined Group 2 Server driver. Fig. 2.

Fig. 2

Set the appropriate Station Address, Baud Rate, and I/O Poll Size.

Make sure the Data Format Settings are set to Transform: Swap Bytes In Word. Fig. 3.

Fig. 3

IMPORTANT NOTE: The I/O Polled Size is determined by the settings in both the DeviceNet Master and the registered .EDS file for the G3. Changing these settings will be addressed in the Automatic Update of the EDS File section. Please refer to this section before setting up the PLC.

Create Gateway Blocks. Select the DeviceNet device from the tree at the left, and add two Gateway Blocks; one for Read Data and one for Write Data, using the Add Gateway Block button on the right hand pane.

Select the first Gateway Block and select the Edit button at the right.

Set the block for I/O Polled Command Data, starting at element PollC 00000. Fig. 4.

NOTE: For 16-bit support, select Word as Word. For 32-bit support, select Word as Long. The latter is recommended as DeviceNetTM uses 32 bits integer addressing.

Fig. 4

Set the block size for 4, and the Direction for: Device To G3. This will be the Read Data block.

Select the second Gateway Block and set it up for I/O Polled Response Data 00000, with a length of 4, and the Direction G3 To Device. This will be the Write Data Block. Fig. 5 shows both gateway blocks once completed.

NOTE: Read and Write are from the G3 point of view. This means the master can send data in Block A, so the G3 can read data, On the other hand, the master can only pull data from block B, so the G3 can only write data.

Fig. 5

The addressing scheme available is outlined below: -

BitC – Identifies the I/O Bit-Strobe command data (Master to Slave).

BitR – Identifies the I/O Bit-Strobe response data (Slave to Master).

PollC – Identifies the I/O Poll command data (Master to Slave).

PollR – Identifies the I/O Poll response data (Slave to Master).

DataC – Identifies the I/O Consumed Data (Master to Slave).

DataP – Identifies the I/O Produced Data (Slave to Master).

Data Mapping Close the Communications module and enter in the Data Tags.

Create tags to read and write each value from the DeviceNet network. These tags will be Internal Integers. In this example, we have defined four reading and four writing tag integer values to communicate with the ControlLogix PLC. Fig. 6.

Fig. 6

Navigate back to the Communications section, and assign the tags to the Gateway Blocks. Select the polled memory location at the left, and drag and drop or double-click the tag on the right to map it. Fig. 7.

Fig. 7

Configure the User Interface. Insert each data tag on the display. Fig. 8.

Fig. 8

Change the Write tags to Data Entry so you can change the data value in the PLC.

Save the database and download to the HMI.

AUTOMATIC UPDATE OF THE EDS FILE (ELECTRONIC DATA SHEET) DeviceNet nodes use an Electronic Data Sheet to describe the communications parameters available at each device on the DeviceNet network.

By design, each DeviceNet master can handle a maximum of 124 Input words and 123 Output words. In the default EDS file for the G3, the Input and Output data sizes are set at 16 bytes each. This equates to four words of data input and four words of data output. These values can be set higher, but it is important to note that if the default values are set higher, they might conflict with other DeviceNet implementations.

Crimson provides an EDS file generator tool to create a file that matches your G3 settings. This file can therefore be used to configure the Master.

To generate this file, enter the Communications module and select the DeviceNet interface on the left. Under the Electronic Data Sheet, select Yes in Synchronize and choose the path and name where the file should be saved using the Browse button. Fig. 9.

Fig. 9

Saving the database using the File>Save command will synchronize and therefore update the EDS file.

Each time EDS parameters are modified, the EDS file will need to be re-registered within RSNetWorx for DeviceNet. These changes will also need to be reflected in the following locations:

• RSNetWorx master node Scanlist, Input Table, and Output Table

• ControlLogix PLC DeviceNet Scanner configuration

Note: Inputs and Outputs are with respect to the master, therefore inputs refer to data sent from the slave and read by the master.

CONFIGURING THE RSNETWORX FOR DEVICENET SOFTWARE RSNetWorx for DeviceNet is used to set up and manage a DeviceNet network. To begin the configuration, launch RSNetWorx for DeviceNet from your development PC.

Start a new network by selecting: File>New>DeviceNet Configuration.

Register the EDS file generated by Crimson 2.0 as shown in the previous section of this document by selecting: Tools>EDS Wizard>Register an EDS file(s).

Select Register a single file, and browse to the location where you saved the G3.EDS file.

Make sure that the .EDS file validation is successful.

If desired, select a new image file to represent the G3.

Review the EDS registration, and finish the process.

Select the DeviceNet Master by navigating in the tree on the left hand side. Navigate to: DeviceNet>Category>Communication Adapter>1756-DNB/A. Select the appropriate Major Rev and drag it into the network workspace at the right.

Select the G3 Slave by navigating in the tree on the left. Navigate to: DeviceNet>Vendor>Red Lion Controls>Generic Device. Select the G3-SERVER and drag it into the network workspace at the right.

Configure the master to add the slave device to the scanlist. Right click the DNB module and select properties. From the Scanlist tab, select the G3-SERVER from the Available Devices pane, and add it to the Scanlist pane. Select the Edit I/O Parameters button.

Make sure that the Strobed or Change of State boxes are not selected. In the Polled section, verify that the Input and Output sizes are 16 bytes. These must match the I/O Poll Size selections made above in the G3. In DeviceNet networks, 4 bytes constitute a full word. Therefore the 16 bytes selection represents 4 full words of addressable 32-bit data.

Select the Input tab. Verify that the four words of G3-SERVER data are mapped to YourDNBSlot:I.Data[0…3]. From the Output tab, verify that the four words are mapped to YourDNBSlot:O.Data[0…3].

Apply the changes, and save your RSNetWorx for DeviceNet configuration.

CONFIGURING THE ALLEN BRADLEY CONTROLLOGIX PLC Allen Bradley ControlLogix PLCs are programmed with RSLogix 5000 programming software. To begin the DeviceNet configuration, launch RSLogix 5000 from your development PC.

Create a ControlLogix program containing a valid DeviceNet Scanner. In this application a 1756-DNB was used.

Configure the DeviceNet Scanner to be address 0. Make sure to set up the 32-bit Input and Output memory spaces for a size of 32 (to match the configuration made above in both G3 and RSNetWorx for DeviceNet.)

Select the RSNetWorx tab, and navigate to the RSNetWorx for DeviceNet configuration that you have previously created. Open the configuration from here and download it to the network.

In the Main Task tree, open the Main Routine Ladder Logic file. Create a rung of ladder to enable the DeviceNet network. The required output is always: Local:YourDNBSlot:0.CommandRegister.Run

Create a few rungs by taking the DeviceNet Input data, Local:2:I.Data[0…3], and adding 1 to them. Store the results in Local:2:O.Data[0…3]. Based on the configuration in the G3, if values are changed on the G3 Write tags, the Read tags will display the respective values, plus one.

Save and download this configuration to the ControlLogix PLC.

WIRING THE DEVICENET NETWORK Please note that all DeviceNet networks require the usage of a termination resistor at the two end nodes on the network. This resistor is typically a ¼ watt 120 ohm resistor. It is recommended to place the resistor between CAN H (White) and CAN L (Blue) of the DeviceNet connection.