///// START OF VIDEO SCHEMA ///// ///// END OF VIDEO SCHEMA /////

How to Automate Tasks with the Logix Designer SDK

Automate tasks in Studio 5000 Logix Designer using Logix Designer SDK.
Automating With the Logix Designer SDK
Listen to this article

Engineers are generally smart and expensive resources. Because of this, their time should not be wasted doing boring, repetitive tasks.

One of the easiest ways to relieve engineers of boring, repetitive tasks is to automate them. This frees up engineers to work on interesting, complex problems.

In this article, I’ll show you how to use the Logix Designer SDK to write applications that automate common tasks in Studio 5000 Logix Designer.

Studio 5000 Logix Designer is a programming software for Allen-Bradley PLCs. If you want to learn more, check out the course Learn How to Program Allen Bradley PLCs Using Studio 5000.

What is an SDK?

Before I explain how we can use the Logix Designer SDK to automate tasks, I want to explain what an SDK is.

An SDK, or Software Development Kit, is a set of tools that can be used to speed up the development of an application.

The Studio 5000 Logix Designer includes an SDK that lets you automate tasks programmatically. The Studio 5000 Logix Designer SDK contains an API, or Application Programming Interface, and documentation.

The API is a set of software functions that can be used to interact with Studio 5000 Logix Designer, and the documentation is a set of examples that explain how to use the API.

You can use the Logix Designer SDK to create applications that automate repetitive, boring, and low-value work.

Let’s switch over to Visual Studio to see an example of an application built with the Logix Designer SDK.

Example workflow

In Visual Studio, I have created an example application that uses the Logix Designer SDK to automate the process of upgrading a project and performing regression tests on the project to make sure that it still works after the update.

Let’s step through the project to see what’s happening.

In the first region, I am converting an existing Logix Designer project to a newer version using the ConvertAsync method.

In the next region, I am building the converted project using the BuildAsync method. This compiles the project to a binary file and verifies that there are no errors in the project.

In the next region, I set the communication path for the controller using the SetCommunicationPathAsync method.

Code example demonstrating how to automate project conversion, build, and communication setup in Logix Designer SDK.

In the next region, I download the project to the controller using the DownloadAsync method.

After downloading, I put the controller into run mode using the ChangeControllerModeAsync method.

Code example showing how to download a project, set controller mode, and test values in Logix Designer SDK.

Finally, I test the project by writing values to tags and reading values from tags using the SetTagValueBOOLAsync and GetTagValueBOOLAsync methods. In this case, I am verifying that if the start button is pressed, the motor starts running.

Code example showing how to test tag values and verify controller mode in Logix Designer SDK.

Result

Let’s run the project to see how it works.

We can see that the project has been converted to a newer version.

Then the updated project is built successfully.

Next, the communication path to the controller is set.

Example of converting, building, and downloading projects with Logix Designer SDK, displayed in a terminal and Visual Studio.

Now the project has been downloaded and is in Remote Program mode.

Now the PLC has been put into Remote Run mode and is executing the code.

Terminal output showing the controller mode change and project download process using Logix Designer SDK in Visual Studio.

Finally, the test is executed and the result is displayed. The test has passed, and we do not have a regression in the code.

This is a simple example, but you could imagine that you could scale this up to automate complex testing on a fleet of controllers quite easily.

Wrap-Up

In this article, I have demonstrated how you can use the Logix Designer SDK to automate tasks and free up engineering time to work on interesting, complex projects or to develop their skills using RealPars Business.

Visit realpars.com/business and add your contact information. Our team will quickly get in touch to discuss how we can support your team's development.

FAQS

Frequently asked questions

What is the Logix Designer SDK?
How can the Logix Designer SDK help engineers?
Can the Logix Designer SDK automate testing for PLC projects?
Do I need programming knowledge to use the Logix Designer SDK?
Is the Logix Designer SDK free to download?

Learn from Industry Experts

Start your learning journey today!
With a 7-day trial, then 35/month
Start Learning for Free