Case Studies

PLC-LabVIEW Industrial Communication

Posted in Allen Bradley PLC, Consumer Goods, Food and Beverage, LabVIEW, Machine Vision, Manufacturing Automation and Intelligence, PLC Programming, Siemens PLC, Test & Measurement Automation

Summary

DMC has extensive experience connecting PLCs to LabVIEW on Windows and Real-Time targets. PLC-controlled assembly lines often require testing for quality. Many applications have the need to incorporate high-speed DAQ and complicated processing into end-of-line (EOL) testers. Because PLCs are ill-equipped to handle large arrays of data or run complex algorithms, it is common to augment a PLC-controlled operation with a more powerful and intelligent DAQ controller. This is also a great opportunity to augment a manufacturing line with a vision inspection system. DMC has implemented solutions employing LabVIEW Real-Time targets and/or industrial PCs. 

Solution

National Instruments provides extensive DAQ devices suitable for a wide range of applications and are a clear hardware choice. LabVIEW's DAQmx drivers quickly and easily extract data from the card, module or chassis. The challenge is then bridging the gap between a LabVIEW application and the Logic Controller on an industrial network. A crude form of communication involves utilizing DO on a DAQ card. This works in a pinch to quickly send test commands to the LV application, but is extremely rudimentary. 


OPC Client Setup Through LabVIEW I/O Server

There are several more advanced solutions to this problem. One common method is to add an OPC client to the LabVIEW project and rely on network published shared variables to ferry data back and forth between the PLC and LV application. Although, after setup, this method is easy, it is not an elegant, fast or reliable way to communicate.


Network Published Variable View

Two other methods are available, each catering to a specific line of PLCs. NI provides an EthernetIP Driver Set that configures any Ethernet port to communicate via EIP. Allen Bradley PLCs commonly use this protocol. Once the add-on is purchased from NI, the developer has the option and flexibility to alter and read individual tags on the PLC. The LV application can also be set up as a remote I/O device and can read-write to a large Assembly Data Block. This method is fast and extremely reliable, allowing the PLC to send commands and receive a long list of reduced data directly from the PLC.

Ethernet IP Development Package                                     Profibus Development Package

For systems set up on a Profibus network, NI provides a PCI, PXI and cRIO Profibus card and corresponding driver set. Profibus is prominent in systems controlled by Siemens PLCs. After a short initialization sequence, the card can be set up as either a Master or Slave on the network, each with their own software API. Data can then be written or read from device to device robustly and at high baud rates.

Once all components can easily communicate, the focus shifts to the actual application software. DMC has an extensive and flexible state machine template that can easily adapt to a wide array of different communication modes. Receiving commands from the PLC, the application gathered high-speed data and ran custom algorithms, often involving peak detection or slope recognition, to parse a signal into different sections for analysis. The client was able to leverage LabVIEW’s graphing features to display raw data, highlight important points and monitor part trends.


Advanced Custom Graphing in LabVIEW

DMC worked closely with clients to understand their governing parameters, exposing these values as user-editable fields on the User Interface instead of hardcoding them. DMC trained the engineering staff how to correctly modify the test parameters in order to adapt to different parts and materials.

Snapshots of high-speed data were saved and loaded again for possible further review. This allowed quality to view old data and post-process again using different criteria. DMC also built a custom calibration screen to re-calibrate torque transducers with a single click.


User-editable Testing Threshold Parameters

Learn more about DMC's PLC programming services and LabVIEW expertise.

Customer Benefits

  • Increased capability for complex evaluations
  • Ease of analysis 
  • Increased rate and accuracy of data
  • More informed engineering decisions
  • Reduced cycle time

Technologies

  • LabVIEW for Windows
  • LabVIEW Real-Time (RT)
  • LabVIEW Data Logging and Supervisory Control Module (DSC)
  • NI data acquisition hardware; PCI, PCIe, USB, cDAQ
  • NI Real-Time (RT) Controllers; cRIO, PXI, FPGA
  • NI vision platforms
  • PLC; Allen Bradley, Compact Logix and Siemens S7