10
9-29-2014 rev2.0 1 IntelliSense ® Application Note 1 Messaging between Bimba IntelliSense ® SIM Module and Allen Bradley Micrologix 1100 PLC Application Note

IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

  • Upload
    ngoliem

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 1

IntelliSense® Application Note 1Messaging between Bimba IntelliSense® SIM Module and Allen Bradley Micrologix 1100 PLC

Application Note

Page 2: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 2

Table of Contents

INTRODUCTION/HARDWARE SETUP 3

MODBUS RTU CONFIGURATION 4

MODBUS DATA LAYOUT 5

MESSAGE SETUP 1, 2 & 3 6

MESSAGING ROUTINE 9

Page 3: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 3

Application Note

IntroductionThis application note is intended to be used in conjunction with sample code file APP_NOTE_MI-CROLOGIX_1100_MB_RTU.RSS and serves as an example for basic Modbus RTU communication. The main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_), with a Bimba IntelliSense® Junction Block (ISH-R04).

Hardware SetupFor this example a 2-wire RS485 Modbus network was implemented using the IntelliSense® Junction Block. SIM DIP switches 5 and 6 were set high to tie the RX/TX terminals together. DIP switch 7 was also set high to enable the internal 150 ohm terminating resistor. Power for the SIM unit was supplied using pins 7 and 8 of the junction block.

(Wire colors are not representative of actual cable)

Page 4: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 4

Application Note

Modbus RTU ConfigurationModbus RTU is a serial Master-Slave protocol. This means the Master device (PLC in this case) controls when each Slave device on the network acts upon the Master’s commands. Only one Slave device can transmit back to the master at a time. There can be a maximum of 32 devices on a RS485 Modbus RTU network.The IntelliSense® SIM unit is capable of utilizing a varied of 8 bit serial communication configurations. A baud rate of 9,600 bps, no-parity, 8 bit, and 1 stop bit configuration was set in both the SIM unit and Chan-nel 0 of the MicroLogix. You may adjust these setting for your application, but the setting must match on all devices on the Modbus RTU network. Keep in mind the Modbus Master assumes the address value of 0.

MicroLogix 1100

IntelliSense® SIM

Page 5: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 5

Application Note

Modbus Data LayoutThe Modbus RTU protocol defines how the data registers of a Modbus device are laid out. The IntelliSense® SIM unit currently only utilizes Holding Registers.

0x = Coil = 00001-099991x = Discrete Input = 10001-199993x = Input Register = 30001-399994x = Holding Register = 40001-49999

The Holding Registers of the IntilliSense® SIM units are defined using the following table:

Page 6: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 6

Application Note

Message 1 Setup

A Modbus master transmits function codes to specific Modbus slave addresses. Each function has its own code number.

01 = Read Coils02 = Read Discrete Inputs03 = Read holding Registers04 = Read Input Register05 = Write Single Coil06 = Write Singe Register

The IntelliSense® SIM module only supports the Read Holding Register function 3. This function code allows you to poll the network slave for the current values in a single register or a consecu-tive series of registers using a single command. For this example, 3 message requests are sent to Slave address 1. The first request polls registers 1-32. These register hold the pertinent SIM data that is also view through the SIM directly. The second message returns the Real Time Clock information that the SIM is holding. The third message returns the SIM ID information that was set by the user.

Page 7: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 7

Application Note

Message 2 Setup

Message 3 Setup

The values returned from the SIM unit are configured to populated integer register N10:1-32 with the first message, N10:33-40 with the second, and N10:41-105 with the third.

Page 8: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 8

Application Note

This example solution could be adapted for increased message requests to include multiple Mod-bus Slave addresses. After coping rungs 7-9 and pasting them after the current rung 9, change the Source value of the MOV instruction located on rung nine to the next consecutive message step, and adjust the 3 new EQU conditions so that Source B is equal to the new message step value. Keep in mind the new MSG instruction will have to be setup with the Data Table Address in the PLC, number of elements, beginning location of data registers being polled, and correct slave address.

The Messaging routine in the example program is configured to run in a continuous cycle. This could easily be configured to be run off a triggered event by adjusting the Source value of the last MOV instruction to any value other than a message count value and replacing the first scan bit that clears N10:0 with the desired trigger.

Page 9: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 9

Application Note

Full Screen Print of Messaging Routine

Page 10: IntelliSense Application Note 1 - bimba.com Sample Codes... · main hardware used for this example was an AB MicroLogix 1100 (1763- L16BWA), Bimba IntelliSense® Starter Kit (ISK-SMA_),

9-29-2014 rev2.0 10

Application Note

Full Screen Print of Messaging Routine (cont.)