LabVIEW is graphical programming software developed by National Instruments (NI) that provides engineers and scientists with a fast, efficient, and intuitive way to design and deploy industrial automation systems. A PLC (Programmable Logic Controller) is a specialized controller-or, in other words, an industrial electronic computing device-primarily used to control industrial processes, machines, and mechanical equipment.
In practical applications, PLCs typically work in conjunction with other devices in industrial automation and control systems, such as sensors and actuators. LabVIEW programs can control industrial machines and processes by collaborating with PLCs.
The primary programming languages for PLCs include Ladder Diagrams, while LabVIEW uses G-code for programming. Although G-code differs slightly from Ladder Diagrams in form and syntax, learning G-code is relatively easy for many users because it is based on the concept of graphical programming and uses numerous icons to represent different program functions and control logic.
Below, we will explain how to write PLC programs directly within the LabVIEW environment:
1. Preparations
Before beginning to program, we need to prepare the equipment to be controlled and the corresponding interface hardware. Typically, a PLC is connected to other industrial automation devices via a set of digital input/output (DI/DO) interfaces. Fortunately, National Instruments (NI) provides suitable hardware solutions for such applications, such as NI CompactDAQ and NI CompactRIO. This hardware can be connected to a computer via communication interfaces such as USB or Ethernet.
2. Creating a LabVIEW Program
Create a new LabVIEW program. Next, we'll use the "NI-DAQmx" software package provided by NI, which is an extensible, versatile data acquisition and control software suite. This package supports everything from simple I/O read/write operations to strategic signaling, as well as various other custom applications.
3. Selecting the Appropriate LabVIEW Template
NI also provides several commonly used LabVIEW templates that offer a variety of useful tools. These tools include different types of input/output interfaces, start buttons, stop switches, motor drivers, and switches. These templates can help you quickly establish a basic control logic framework before you begin designing your PLC program.
4. Add PLC Icons to the Design Panel
You can find various PLC icons in the template control library provided by NI and drag and drop them onto the design panel. Any PLC icon can be directly connected to other controls and I/O interfaces to control different aspects of the equipment.
5. Program the Control Logic
Connect the various control icons and begin programming the control logic. These icons can be connected to form simple combinations of circuit logic. Apply your expertise as an engineer or scientist to write the logic rules into the program.
6. Test the Program
Once the program is written, you need to perform software testing using the NI-DAQmx software package. This can be used to simulate the input and output of electrical signals to ensure the program meets the expected requirements. Once the program passes testing, it can be uploaded to the PLC device for actual hardware testing.
Summary
Writing PLC programs directly in the LabVIEW environment is relatively straightforward. National Instruments provides extensive resources, support, and control libraries to help engineers and scientists develop industrial automation and control systems quickly and efficiently. LabVIEW's ease of use and the graphical programming concept of G-code make programming intuitive and efficient.




