Communicating to hyper terminal. How does one know that the PLC is transmitting characters out of its serial port? You can view the pulses or protocol produced using a hyper terminal window.
For that, you need to set the hyper terminal settings to 19200, N, 8, 1, which is same as the settings of PLC serial DF1 driver.
Double-click MAC and enter the IP (Fig. 7).
Ladder programming. Once the AB PLC is successfully interfaced to the PC, we need to properly program it using RSLOGIX provided by Rockwell Automation. For programming the PLC, we use Ladder programming. Typical PLC programs use blocks like timers on and off, counters, digital I/Os, RS232 communication blocks and others.
Ladder program is similar to the wiring diagram of the circuit. We redraw the wiring diagram using two vertical lines to represent input power rails and stringing the rest of the circuit between these. Sub-routines are implemented as another ladder.
A typical example of a block used for RS232 programming is AWA (Fig. 9).
ASCII write append (AWA). The AWA instruction sends a specified number of characters (for example, 50) of the source tag (ST14:0) to a PLC serial port 2 and appends either one or two pre-defined characters. It is used for RS232 communication.
Similarly, an SCL is an instruction used to read and scale an analogue input to a corresponding physical value like temperature or pressure.
In the above example, the address for the analogue input is I: 1.0 and the converted raw data is divided by 10,000 and added to offset to implement a linear transfer function like
y = mx + c
A number of free Ladder programming tutorials are available on the Internet. Inside the PLC, we have various registers like output, input, status and binary. Each bit in these registers specifies a function. Addresses of the devices are built on the basis of names, PLC slot numbers, words and bit numbers. Address representations differ from manufacturer to manufacturer.
The table above shows some of the bit addresses of the PLC and how these are related to field devices.
A typical address of an AB PLC for output coil is built as in Fig. 12.
Once you write your Ladder code for the PLC, download the code into the PLC. Let the PLC be in Run mode after that.
Fig. 13 shows how an RS232 port can be configured for handshaking a power supply device, which has settings 9600, N, 8, 1.
Wonderware InTouch SCADA
Wonderware’s InTouch HMI software for visualisation and industrial process control offers outstanding ease of use and simple-to-configure graphics. For having an interactive GUI to control outputs of PLC, RS232 devices via PLC, we use Wonderware InTouch SCADA. A simple GUI can be made in Wonderware by following simple steps:
1. Open Wonderware Development tool by double-clicking on Desktop icon.
2. Start a new project.
3. From the palette on the right side, choose the appropriate graphical object to be inserted.
4. Click on the screen to insert the object.
5. Double-click on the object to add a suitable tag name and type of object. Type defines usage; it may be analogue or discrete.
6. Double-click on the tag to assign properties to the object. Different operations like visibility or blink can be controlled on the basis of scripting.
7. If the tag is I/O type (meant to read or control a device), specify the address of the device.
8. Address of the device can be obtained from registers of the PLC, which can be viewed in RSLogix.
9. In Modify Access Name window, keep the access name as KEPServerEX_SL. KEPServer acts as a communicator between RSLogix and Wonderware InTouch.
10. In this fashion, develop the entire GUI with specific tag names, addresses of devices and PLC variables used in Ladder logic.
Access name. Each PLC uses a specific protocol to communicate with the I/O server or DA server. InTouch then uses an access name concept to continue this communication for dynamic data exchange (DDE). Typically, because here KEPServer is acting as a communicator between PLC RSLogix and Wonderware InTouch, we specify access name in InTouch as KEPServerEX_SL. Access names are selected in the tag name dictionary for each tag used in the application.
Scripting. In all control systems, it is essential to provide software interlocks to prevent human errors. So the best method would be using Window Scripts in InTouch. Window scripts execute periodically when an InTouch window is opened, or one time when an InTouch window is opened or closed.
Programming here is done using scripts, which is similar to any programming language. A typical scripting example is shown in Fig. 18.
KEPware’s OPC server KEPServerEX provides an easy and reliable way to connect the Allen Bradley PLC to HMI, SCADA, Historian, MES, ERP and countless custom applications. Here, you can use KEPServer for communicating RSLOGIX to Wonderware InTouch using the Ethernet/IP protocol.
Be careful while specifying tagnames in KEPServer. Tag names and their corresponding addresses should match those mentioned in Wonderware InTouch development.
Running the final application
Once your PLC code is downloaded into the PLC and run from RSLogix, run KEPServer. Open the runtime application of Wonderware InTouch software and open your GUI file. Always make sure that KEPSersver is running in the background while you run Wonderware InTouch application.
Such a control system can be very useful for industrial automation, in research laboratories and big industries. The graphical interface makes it easy for the operator to operate switching and controlling operations. The PLC provides a very rugged solution to control relays and RS232 devices.
Joby Antony is masters in computer technology from the USA,
and is currently working as engineer-F at Inter-University Accelerator Centre (IUAC), New Delhi
Akshay Kumar is a third-year B.Tech student at Delhi Technological University, New Delhi, and currently an intern at IUAC