Blogger Tips and TricksLatest Tips And TricksBlogger Tricks

Friday, 30 May 2014

Implemention of customized SCADA for X-Ray Machine

Implementation of customized SCADA for X-Ray Machine



This paper is an effort to enable the Delta PLC (Programmable Logic Controller) DVP14SS to communicate with the Visual Basic 6.0 using Modbus.DLL. The communication between DVP14SS and Visual Basic 6.0 is via Modbus Serial Protocol stated by Delta PLC manufactures. In automated systems there is control supervision, and also health and safety monitoring via supervisory control and data acquisition (SCADA) systems. Values of important parameters such as temperatures, pressures, voltages, etc. are sensed and transferred to monitoring stations in control rooms. After processing the information, decisions are made and supervisory commands are sent to change conditions such as set points or to engage emergency procedures. The data from sensors and set commands to actuators are sent via wired or wireless communication channels. So, communication mechanisms are an integral part of any complex automated system. The SCADA software’s are the software packages and are not free and the cost depends on tag count. Visual Basic 6.0 platform can be used to develop the SCADA application effectively. Using VB 6.0 a platform can be developed to integrate software and hardware across spectrum of vendors. Here, a simple approach is proposed; which takes care of the communication between Delta PLC and visual Basic using Modbus DLL (provided by Delta PLC). Visual Basic can serve as a cost effective solution since it is not necessary to purchase a licenses for a small scale application as well as it is cheaper than conventional SCADA packages.  
I.      Introduction
During the past decade, the industrial sector throughout the world has shifted from classical methods of control and Automation to the state of arts techniques. This allowed the industries to attain higher percentage of growth and production, which consequently gives rise to reduction in costs of the product .This trend of automation is gaining Automated systems use local control systems that utilize sensor information in feedback loops, process this information, and send it as control commands to actuators to be implemented & processed [2]. Such closed-loop feedback control is necessary because of the uncertainties in the knowledge of the process and in the environmental conditions. Feedback control systems rely heavily on the ability to receive sensor information and send commands using wired communications.
PLCs  have  become  favourite  tools  in  the  control  industry  because  of  their  simplicity, robustness, I/O  interface and  reliable performance
SCADA as the name suggests is not a full control system but rather focuses on the supervisory level. As such, it is a purely software package that is positioned on top of hardware to which it is interfaced, in general via PLCs, or other commercial hardware modules. SCADA systems are nowadays employed in major industries of the world including Oil and Gas, Petroleum, Food, Textile and other industrial sectors. SCADA systems are developed by major companies which include Wonderware Inc, Siemens, Rockwell Automation, Intellution and GE. However the prices they demand for their systems are discouraging the industries to switch towards automation [3]. 
Visual Basic is tool provides platform to develop new optimum Windows or SCADA applications.  Visual Basic can communicate with PLC with various ways. Visual Basic does not have code for communication protocol inbuilt.  User  need  to  write  code  for communication  protocol  or  need  to  purchase ActiveX  controls    which  are  used  to  develop applications.[4]

II.   Method of Interfacing
The primary goal of SCADA system is to assist the operator in running a machine and managing a process. A good SCADA system will increase the productivity of the operator and machine, increase uptime, and assist in providing consistent product quality. The required functionality of SCADA will vary based upon the type and complexity of product produced the type of machinery used, the skills of the operator, and the degree of automation of the machinery [3]. The types of functionality typically included are:
·     Link between PLC and PC.
·     Visual HMI
·     Trending Real Time and Archived Data [3].
Delta DVP14SS comes with serial port and the communication protocol is serial Modbus protocol which is a open resource Modbus protocol. Visual Basic acts as a Modbus Master device which issues request or commands (Query) on serial bus which is received by slave.  PLC acts as a Modbus slave device and responds to the Master by sending massage called response. Modbus Query and Response contains fields like device address, function code, data, and error check [6]. Figure 1 shows the system block diagram.
Figure 1 Block diagram

In the previous work [4] is an effort to show simple approach to communicate Delta PLC with visual Basic using MSComm control for more effective and efficient process control.  .This paper is an effort to design and evaluate the the other approach to communicate Delta PLC using Modbus.dll provided by Delta PLC manufactures. DMT Modbus Library is used for development industrial device that support Modbus format, based on Windows Winsock API (WSA). The software developer can import the library for implementing device's communication via serial or ethernet. The MBDRV Communications Driver is a Windows Dynamic Link Library (DLL) that enables Windows programs to communicate with devices that understand the Modbus Protocol. The driver provides an easy way for the user to develop programs that access Modbus device’s points and registers.  Information is passed using standard variables in the user’s host language [5].
The Modbus driver can be used with any language that supports calls to external DLLs, including C/C++ static/dynamic standard library, support Microsoft Visual C++ / Visual Basic, Borland C++ Builder, Sun Java J2SE, etc.[5]
DMT Library provides functions with the following steps:

  • ·     Step1.Opening communication port
  • ·     Step 2. Data access input/output functions
  • ·     Step 3. Acquiring status functions if necessary
  • ·     Step 4. Closing communication port

DMT library provides various functions related to communication control, Data access & communication Status between PLC and PC. Communication control functions include creating Modbus serial connection & closing the serial connection.e.g.

 Function used to create Serial connection:
int OpenModbusSerial(char *comport_name, int baud_rate, int data_len, char parity, int stop_bits, int modbus_mode);

OpenModbusSerial Function Parameters [5]
Comport name, e.g. "COM1"
Baud rate, e.g. 9600
Data length, e.g. 7
Parity bit, e.g. 'E'
Stop bit, e.g. 1
Modbus mode, 1 for Modbus/ASCII, 2 for Modbus/RTU

OpenModbusSerial function then returns the value to indicate whether the connection is successful or not e.g.

OpenModbusSerial Function Returned Value [5]
Value returned
Serial open failed
Non zero
Serial open succeeded

Function used to close Serial connection:
void CloseSerial();
Closes the Serial connection.

Data access functions include sending request for Modbus data & receive responses from Modbus data.e.g.

 Function used to send request for Modbus Data:
int RequestData(int slave_addr, int func_code, const unsigned char *data, int datalen);
RequestData Function Parameters [5]
Station Address
Function Code
Modbus Data
Modbus Data Length'

RequestData function then returns the value to indicate whether the request sent is successful or not e.g.

RequestData Function Returned Value [5]
Value returned
Send data failed
Non zero
Total number of bytes sent will be returned

Function used to recive response form Modbus Data:
int ResponseData(int *slave_addr, int *func_code, unsigned char *data);
ResponseData Function Parameters [5]
Returned Station Address
Returned Function Code
Modbus Data (If error occurring, the Modbus Exception Code will returned)

ResponseData function then returns the value to indicate whether the response sent is successful or not e.g.

ResponseData Function Returned Value [5]
Value returned
Send data failed
Non zero
The Modbus data byte count will be returned

Communication status functions include acquiring the last serial error message & resetting the serial error message.e.g.

 Function used to acquiring the last serial error message:
int GetLastSerialErr();

GetLastSerialErr Function Returned Value[5]
No serial error
Invalid serial error code
Invalid baud rate
Buffer overflow error
Invalid character size
Invalid flow control
Cannot initialize serial device
Invalid initialization parameter
Cannot open serial device
Invalid parity
Serial device receive error
Invalid stop bit
Serial device transmit error

Function used to reset the last serial error message:
void ResetSerialErr();
Used to reset Last Serial Error

DVP14SS series MPU support Modbus ASCII/RTU communication format with speed of up to 115,200bps. and modification on data length (data bits, parity bits, stop bits).Modbus communication format ,CRC calculation ,Modbus addressing for various internal devices of PLC are the key factor in the  interface. Communication parameters for COM can be manipulated by writing ladder program. Here default protocol settings are used hence no need to alter PLC program. [4]

Following steps are implemented to obtain desired objective.

1.         Add DMT.bas module file into project (Figure 2).

Figure 2 DMT.bas Module

In DMT.bas module all functions are declared and defined in Modbus.dll
2.    Copy DMT.dll into project.
Copying the DMT.dll file into project directory.

3.         Declaring the Win32 API
Used to find serial port List from registry and shown in GUI.

4.         Declare variable parameters for communication port.

Following variables are declared.

Used to create Modbus protocol String to send command or request to PLC.
5.         Assign Modbus data

Function code 5 forces single coil M207 (Modbus address 08CF) ON state (Data FF00) [1][6].

6.         Converting Hex data to String

7.         Open Communication

Opens communication port with 9600 baud rate, even parity, 1 stop bit.

8.         Request Modbus Data

9.         Receive Response

10.     Close Communication.


Using VB and DMT.dll customised SCADA is developed for application for Remote operated X-Ray Machine.

Figure 3 GUI for X-Ray Machine
In this GUI seven stepper motor movements are controlled in both auto & manual mode. Current & set positions of each motor are also displayed on the GUI. In DMT Modbus.dll user an read four Modbus data registers simultaneously. Current positions of Stepper motor is calculated by the encoders connected to each motor. Stepper motor status is shown with the help of indicators.GUI also displays the current position of Collimator .Collimator can be opened or closed remotely with the help of buttons shown on GUI.
V. Conclusions

Visual Basic with industrial connections can be an alternative to costly proprietary automation Software’s. The main idea was to interface Visual Basic and Delta PLC DVP14SS for more effective and efficient process control.  This work evidences proper communication between two powerful technologies used in industries. Visual Basic provides a platform where new solutions or highly customized SCADA's can be created with a richer experience than those that may be provided by standard SCADA offerings.  By using Visual Basic that offers many advantages over   SCADA packages as it comes free and not expensive. Also SCADA packages cost depend on the tag count and runtime licenses needs to be purchased. Thus for OEM Visual Basic offers the optimum cost solution. The PLC- VB interface has been tested for several real time processes and can serve better for many applications in the industry.


[1]      DVP PLC communication Protocol,” Delta Electronics Inc, (1998).
[2]      Tahir Nizamuddin, Bilal Iqbal. “Design and Implementation of Locally Developed SCADA A Cost Effective Solution”. PCSIR, Institute of Industrial Electronics Engineering, (IIEE) Karachi 16(2010)
[3]      Tieyi Zhang, Yun Zhang, Xiaorong Zhou. “Development on Serial     Communication between Panasonic Electrical PLC and Computer based on    VB”. Guangxi University, Nanning , China. Applied Mechanics and Materials Vols, 170-173(2012)
[4]      S.S.Bidwai, V.B.Kumbhar. “Real Time Automated Control using PLC-VB Communication” International Journal of Engineering Research and Applications (IJERA) Vol. 3, Issue 3, pp.658-661 (Jun 2013).
[5]      DMT library Manual,” Delta Electronics Inc, .
[6]      Modbus  communication  Manual  MTL 8000  process  control  for  process  I/O  ,The MTL Instruments Group PLC, England 

Blog Widget by LinkWithin


Subscribe To Get FREE Tutorials! And More....


PLC Ladder PLC Practice Problem PLC Ladder Programming training & tutorials Free Training on PLC Ladder Programming training & tutorials PLC Ladder Logic PLC Timer SCADA Basic PLC Ladder Programming Examples Delta PLC PLC & Visual Basic Communication PLC Definition Introduction PLC Error PLC Error LED RSLinx Tutorial Types of Timers in PLC ladder logic Programming programmable Logic Controllers AB addressing ABB AC Drive AC Drive training cource Actuators Advantages and Disadvantages Addressing of Allen Bradley PLC Micrologix 1000 Addressing of Delta PLC DVP SS/ES/EX Addressing of Mitsubishi PLC FX2N Addressing of Modicon PLC Micro TSX 3722 Addressing of Siemens PLC S7 200 Advantages & Disadvantages of RTD Advantages & Disadvantages of all types Sensors Advantages of SCADA Allen Bradley PLC PWM (Pulse Width Modulation) error codes Allen Bradley SLC Controller Error Codes Ampere Voltage Ratings of circuit brakers Analog addressing Allen bradley Analog input in Allen Bradley PLC Applications of Sensors Capacitive Proximity Sensors blck diagram Capacitive proximity sensors Circuit brakers Circuit diagram of motor starter Communication Between two E1000 HMI and mitsubishi Fx2n PLC Communication between FX3U PLC and SCADA via RS485BD Configuring the DF1 Driver using RSLinx Configuring the Ethernet Driver Connection between 2 E-Terminals and FX2N PLC. DOL Motor Starter PLC logic DOP Series Human Machine Interface DVP14ss Delta HMI Delta HMI Program Download.Delta HMI Communication Cable Delta HMI and RS485 Communication Delta MMI Delta PLC Projects Delta PLC input output addressing Different types of Special motor Diffrence between PLC and DCS Ebook on Basics of Allen Bradley PLC pdf Ebook on Basics of Siemens PLC pdf Ebook on Basics of VFD PDF download Electrical maintenannce tips Electromagnetic relay Error Messages from RSLogix Emulate 500 Failsafe meaning Features of Delta HMI/MMI Following are the Free PLC Software's available from all leading brands such as Allen Bradley Free PLC Ebooks Free PLC SCADA TRAINNING & TUTORIAL Free PLC Training Full form of HART HART OSI reference model HART protocol structure HMI & ZIGBEE How Capacitive Proximity Sensors Works? How Inductive Proximity Sensor Works? How Ultrasonic Sensors Works? How to Select a Suitable Motor How to Select the Right VFD (Inverter) or AC Motor Drive Ladder Logic for AND Ladder Program for Automatic Door open close Ladder Programs for Gates List of Top Most Widely used PLC’s in the Industry List of Widley used PLC Companies. Low cost Wireless I/O’s using PLC Mitsubishi Mitsubishi PLC FX2N & HMI E1000 Networking using BDTP Technology Mitsubishi PLC input output addressing Modbus Communication Modbus Ethernet Modbus Serial Modbus.dll for Visual Basic Mormally open Contact Normally Close Contact Explained Motion Actuators Motor starter in control circuit NAND NO NC Explained NOR Gates with Truth Tables Nashik Nexgenie PLC Features Nexgenie PLC Port Nexgenie PLC input output OFF Delay Timer OLE for Process and Control ON Delay Timer OR Omron On line Ladder Program Editing for RSLogix 500 On line Ladder changes Online Editing Ladder Program Online Servo tuning PID Control Instruction PID PLC PID instruction in Allen Bradley PLC PLC & VB PLC Counter PLC Error Allen Bradley PLC Error messages in Allen Bradley PLC FBD PLC Fault PLC Industrial Automation Training Institute PLC ON Delay Timer PLC Run Led PLC SCADA Communication PLC SCADA DCS Training Centers PLC SCADA Driver PLC SCADA Training Chennai PLC and ZIGBEE PLC application PLC based Automated Guided Vehicle PLC based Final year Project PLC based Line follower robot PLC based Project Report PLC functional Block Diagram PLC input wiring PLC interview Question PLC interview questions PLC maiintence PLC power LED PLC program for star delta starter PLC retentive timer PLC training in Delhi PLC training in Mumbai PLC training in Pune PTO Allen Bradley PTO [Pulse Train Output] Instruction in Allen Bradley PLC Photoelectric Sensor Applications Photoelectric Sensor Applications in Automation industry Power cable Selection Proficy HMI/SCADA Cimplicity 8.1 Programming Languages for PLC Proximity sensor application Push to ON PUSH to OFF PLC program using NO NC and Coil Pwm RSLinx Tutorial | Configuring the DF1 Driver RSLinx Tutorial | Configuring the Ethernet Driver Scaling Analog Input using SCL Instruction in PLC [Scale Data] Schneider Schneider PLC addressing Selction of Servo Motor Selction of Stepper Motor Selection of AC Motor Selection of VFD Selection of stepper or Servo Motor Sensor applications Servo Motor Servo auto tuning Parameters Siemens Siemens input output addressing Signal Cables selection Simatic Wincc SCADA Single Push button to on and off motor Sinking and sourcing operations Softwares used in SCADA Solid State Relay construction Solid State Relay uses and Advantages Sourcing and Sinking Concept in PLC Standard Wiring Color Codes Stepper Motor Applications and Advantages Disadvantages Stepper application Stepper motor Selection Stepper motor and PLC Tag in SCADA Temperature sensors used with PLC Theory of Capacitive Proximity Sensors Theory of Ultrasonic Sensors Theory or Operation of Inductive Proximity Sensors Thermistor & Temp IC Sensors Thermocouple Trial Run of PLC Troubleshooting Allen Bradley PLC with RSLogix Emulate 500 Troubleshooting Tips for Electrical /Electronic Maintenance Tutorial on PLC Types of Actuators Types of Actuators used for Motion in Automation with Advantages & Disadvantages Types of Sensors Types of Timers in PLC | ON Delay Timer (TON) Typical circuit diagram of Star Delta starter Ultrasonic Sensor Applications Ultrasonic sensors Unitronics VB 6.0 and PLC VIsual Basic as SCADA What is HART What is SCADA (Supervisory Control And Data Acquisition) What is SMART Communication What is a PLC ? What is DCS? What is the difference between PLC and Microcontroller? XIO [Examine if Open] & XIC [Examine if Closed] Explained advantages & disadvantages of Servo Motors anlog input addressing DELTA PLC anlog input addressing Mitsubishi PLC anlog input addressing siemens automation training comparison of PLC and DCS connecting field devices to Programmable Logic Controllers contact reting of relay design of fail safe systems digital common ground connections distributed control system drawbacks of Servo Motor fail safe PLC Redundancy modbus examples noise in cables one input one output PLC program using NO NC logic opc overload relay operation photoelectric plc Response Time plc output wiring plc program for TV remote plc training programmable Logic Controllers List relay coil rating relay driving circuit relay isolation voltage selection of relay servo basics servo training star delta starter control wiring diagram types of Counter typical circuit diagram of Direct on line starter