Adding a PLC to NI OPC Servers

Updated Sep 29, 2022

Environment

Software

  • OPC Servers

I have a PLC. How can I connect it with NI OPC Servers?

  1. Open NI OPC Servers by going to Start » All Programs » National Instruments » NI OPC Servers.
  2. Create a new .OPF file by selecting File»New.
  3. Create a new channel by left-clicking Click to add a channel. in the Channel Device Group Area.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  4. Designate a name for your channel and click Next.
  5. Select the appropriate device driver for your PLC and click Next
    • Use the Supported Device & Driver Plug-in List for NI OPC Servers  to determine which device driver is appropriate.                                                                                                                                                                                                                                         
  6. Configure the serial or network settings and other New Channel Wizard configuration settings. Click Next.                                                                                                               
  7. After finishing the wizard, you'll be able to add your specific device.  In the Channel Device Group Area, left-click Click to add device.                                                                                                                                                                                                                                                                                                                                                
  8. Name the device and click Next.
  9. Under Device model, select the model you are using from the list of available PLCs and click Next.
  • If you do not see the correct PLC model in this drop down go back to step five and double check the driver for your device.
  • Some devices are displayed as part of a device model family. For example, a ControlLogix 5570 is part of the 5500 family.                                                                                                                                                                                                                                                                                                                  
  1. Assign the Device ID and select Next.
  • The device ID syntax will depend on your device model. Consult the device driver manual for your model for information on the syntax of the device driver. This can be found in the NI OPC Servers Help menu >> Driver Help ... >> Select the driver you are using.
  1. Continue through the New Device Wizard, changing setting as needed for your hardware set up.
  • Note: If you are using an Allen Bradley SLC PLC, you will reach a Slot Configuration page where you can add the modules for your PLC.                                                                                                                                                                                                                                                                                                                             
  1. Finish the New Device Wizard.
  2. Enter your OPC tags in the tag area by either left-clicking Click to add a static tag or by right-clicking and selecting New Tag....  Tag addressing is specific to your PLC, so refer to its documentation for the correct syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
  3. In order to check the OPC tags for your device, select Tools»OPC Quick Client... or click the OPC Quick Client Launch button in the toolbar. From here, you should be able to see the tag values updating, along with the timestamps.
  4. Refer to the document Connect Any LabVIEW to any PLC  to learn how to view your tags as shared variables in your LabVIEW project.

Additional Information

If you are having issues adding tags to your PLC, step through the tutorial again to verify your settings for the Channel and the Device. For example, are you communicating using a specific Network Card? If so, select that specific NIC in the Network Adapter settings for the Channel.