Manufacturing Automation & Intelligence Archives | DMC, Inc. https://www.dmcinfo.com/blog/category/manufacturing-automation-intelligence/ Thu, 29 Jan 2026 21:18:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://cdn.dmcinfo.com/wp-content/uploads/2025/04/17193803/site-icon-150x150.png Manufacturing Automation & Intelligence Archives | DMC, Inc. https://www.dmcinfo.com/blog/category/manufacturing-automation-intelligence/ 32 32 A Beginner’s Guide to Scripting in Siemens WinCC Unified for Advanced HMI Control https://www.dmcinfo.com/blog/40902/siemens-wincc-unified-scripting/ Wed, 04 Feb 2026 13:00:00 +0000 https://www.dmcinfo.com/?p=40902 Industrial automation projects are always specialized in their application and industry, making flexibility and adaptability necessary in all forms of programming. This extends not just to PLC controls, but to the HMI screens and devices that operators interact with regularly.  Sometimes, the built-in functions of an HMI platform are not enough to accomplish the desired goal. When creating HMI screens for Unified Basic Panels […]

The post A Beginner’s Guide to Scripting in Siemens WinCC Unified for Advanced HMI Control appeared first on DMC, Inc..

]]>
Industrial automation projects are always specialized in their application and industry, making flexibility and adaptability necessary in all forms of programming. This extends not just to PLC controls, but to the HMI screens and devices that operators interact with regularly. 

Sometimes, the built-in functions of an HMI platform are not enough to accomplish the desired goal. When creating HMI screens for Unified Basic Panels or Unified Comfort Panels, the use of scripting within components can allow for additional functionality not found in the basic properties of components.

Scripts can allow for more information to be displayed without the addition of PLC logic, such as mathematical expressions involving more than one tag. Scripts can also be used as functions triggered by an event, such as a button press on the HMI. Siemens scripting uses JavaScript and object-oriented principles to allow engineers more flexibility by using an established language for ease of implementation. This blog reviews the basics of WinCC Unified Scripting. 

Accessing Scripts – Global Modules and Functions 

When developing an HMI program, scripts can be created for use in a variety of ways. To do so, first drill down to the “Scripts” folder in the project tree under the HMI device in your project. From there, select “Add a new global module” to create a container for one or more global functions. Once the global module is created, select “Add a new global function”, which will open the script editor. From here, users can create their own custom functions.  

Siemens WinCC Unified scripting interface

Triggering Global Functions 

Once a global function is created within a global module, it can be called in a variety of ways. One method is utilizing the “Scheduled Tasks” feature, which allows a function to run based on a specified condition.

For example, to run the script “Function” when the HMI tag “eStopPressed” changes value, a scheduled task must be created. Once it is created, the default trigger option is “Tags,” which triggers on the value change of an HMI tag. Other trigger options include cycle times ranging from 500ms to one year, as well as alarms. Note that selecting a short cycle time can cause overloads, and that a function triggered by a tag cannot write to the trigger tag.  

Siemens WinCC Unified scripting interface
Siemens WinCC Unified scripting interface

Once an HMI tag is selected, select the “Events” tab under the task to select the function to run upon trigger. Click the dropdown under the name column to open the menu as shown, and scroll to the bottom to find “Script functions”>”Global module”>”Global module.Function.”

Siemens WinCC Unified scripting interface

Once a function is selected, choose parameter values to input to the function for this specific run case. These parameters can be several data types, which can be selected using the dropdown in the “Value” column.  

Siemens WinCC Unified scripting interface

Accessing Scripts – HMI Components 

HMI components have two main ways to utilize scripts: Events and Dynamic Properties. To have an HMI event trigger a script, first navigate to the HMI component and then to the “Events” tab. Select the preferred trigger event, then click the button shown below to convert the function list to a script.  

Siemens WinCC Unified scripting interface

To use a script to define a component property, first navigate to the component in question and to “Properties.” In the “Dynamization” column, use the dropdown to select Script. This will open a script editor to allow for control of the desired property.

Siemens WinCC Unified scripting interface

The variable “value” refers to the state of the property scripting for. For example, if I created a script that resulted in “value = 5” for width, the component would display with a width of five pixels. Additional code should always be written between the declaration of the “value” variable and the return.  

Script Tools 

Siemens offers a few helpful tools as part of the script editor to make it easier to create working code. Some of these tools exist as buttons on the script editor, and some are built-in features, such as: 

  • Syntax highlighting 
  • Snippets (code templates) 
  • System functions 
  • Referencing HMI objects 
  • Tooltips 
  • Autocomplete 
  • Error marking and correction 
  • Find and replace 
Siemens WinCC Unified scripting interface
Credit: Siemens

Snippets 

Scripting in WinCC Unified component properties includes pre-built sections of code called “Snippets,” which are meant to accomplish a specific, common function without building the script from scratch.

To access snippets, right-click within the script editor to open the menu. From there, you can drill into the HMI Runtime or Logic snippets. HMI Runtime snippets include functions such as opening a faceplate as a pop-up window, writing parameter sets to the PLC, and user management options. Logic snippets include basic structure for if-else statements, for-loops, and more. 

Once a snippet is added, review the code block and add or change the items inside to accurately reflect your project. For advanced users, it is possible to create custom snippets following the steps here.  

Siemens WinCC Unified scripting interface

Ready to take your Manufacturing Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals. 

The post A Beginner’s Guide to Scripting in Siemens WinCC Unified for Advanced HMI Control appeared first on DMC, Inc..

]]>
MagneMotion Guide Part 11: Tuning https://www.dmcinfo.com/blog/40486/magnemotion-guide-part-11-tuning/ Wed, 28 Jan 2026 13:36:00 +0000 https://www.dmcinfo.com/?p=40486 In the previous article in this series, MagneMotion Guide Part 10: Moving Track, we discussed handling moving path nodes for MagneMotion Quickstick systems. In this article, we’ll discuss the advantages of tuning your MagneMotion system and general good practices for tuning MagneMotion.  MagneMotion Guide Series What is Tuning? Tuning is the process of adjusting the parameters of your system that control the motion profiles used to turn motion commands (i.e., move […]

The post MagneMotion Guide Part 11: Tuning appeared first on DMC, Inc..

]]>
In the previous article in this series, MagneMotion Guide Part 10: Moving Track, we discussed handling moving path nodes for MagneMotion Quickstick systems. In this article, we’ll discuss the advantages of tuning your MagneMotion system and general good practices for tuning MagneMotion. 

MagneMotion Guide Series

What is Tuning?

Tuning is the process of adjusting the parameters of your system that control the motion profiles used to turn motion commands (i.e., move this vehicle to this position) into mechanical movement. In the case of MagneMotion, tuning usually involves adjusting the Control Loop Parameters in the configuration file along with other advanced parameters that handle the system response to vehicles being out of position. 

While some systems have automatic tuning processes, MagneMotion tuning is a very iterative process. Typically, you’ll adjust tuning parameters before running your track, make observations about the current track behavior, and then iterate on the parameters again until system performance meets application requirements. 

Benefits of Tuning

There can be several different reasons why you would want to tune your system. The first is to ensure that vehicle motion is smooth. A properly tuned system will reduce vibrations and jerky movements from vehicle motion. 

Tuning can also be useful in increasing the overall throughput of your system. Mistuned vehicles can take longer to get up to speed or might slightly overshoot their targets, causing delays as they need to correct their positions. 

Similarly, tuning can also considerably reduce the current draw and thermal load on your MagneMotion motors. When a vehicle is moving smoothly and precisely, there is less need for the motors to draw an excessive amount of current to correct the vehicle’s positioning. 

Before you begin tuning your system, it is important to consider what your priorities are in tuning. A system tuned to optimize speed and responsiveness may look different from a system tuned to reduce thermal load. 

Configuration File Adjustments

See MagneMotion Guide Part 1: Creating Configuration Files for additional details.

The relevant parameters for MagneMotion tuning are found in the motor defaults section of the track. While you can adjust these parameters on a per motor basis, it’s usually a good idea to adjust them on a per path basis to keep vehicle motion consistent across your track. 

MagneMotion parameters interface

Here you can set up different sets of control parameters. To make use of a new set simply fill out the parameters and click the Enable check box. When commanding a vehicle to move (through NC Host or a controller) you can set the command to run at one of the PID sets configured here. Typically, it is a good idea to have a PID set for unloaded vehicles and another for vehicles that are loaded. Additional PID sets can be added, either to account for different load types or different types of moves along the track. 

Below is a quick description of each parameter used in a control set: 

ParameterDescriptionIncrease EffectDecrease Effect
Mass (kg)This is the mass in kilograms of the vehicle. This mass should include the mass of the puck, and nest/fixture on the vehicle, and any load placed on the vehicle. 
KpThis is the proportional gain. This controls the amount of force applied to the vehicle in response to the position error.Can cause overshooting. Increases system responsiveness.Reduces overshoot. Reduces steady-state error. Slows system responsiveness. 
KiThis is the integral gain. This controls the amount of force applied based on past values of the position error.Can cause overshooting and oscillation. Makes the system more responsive to errors over time.Reduces overshoot and oscillation.
KdThis is the derivative gain. This controls the amount of force applied based on the velocity error of the vehicle.Reduces settling time. Decreases overshoot. Large values can cause stability issues.Increases settling time. Increases overshoot.
Kff(%)This is the feedforward scale. This controls the force used to achieve the desired acceleration based on the given mass.Increases from 100% can cause the system to excessively accelerate the vehicle.Decreases from 100% can cause the system to not accelerate quickly enough. 

Tuning Process

Using Virtual Scope

To properly tune a system, you will need to run a vehicle around your track while assessing whether the vehicle’s behavior is improved after each adjustment to the system’s control parameters 

While you can certainly do this by just monitoring the system, MagneMotion has created a tool to help gather more specific motion data called Virtual Scope.

MagneMotion Virtual Scope tool

The Virtual Scope tool gathers data about a vehicle’s position error, velocity, and current use as it moves along a motor of your track. 

To use Virtual Scope in your tuning process simply hit the setup button and input the IP address of your HLC controller along with the vehicle ID you are planning on tracking and the path and motor you are running your tuning tests over. 

Note that for a running system it can be tricky to line up a scope of a specific vehicle crossing a specific motor. Make use of NC Host’s ability to track vehicle positions to setup a trace before the vehicle approaches the motor you are monitoring. 

MagneMotion interface

When a profile is captured, you can select which parameters you wish to display. You can also choose to set up a data capture to record the data from the scope into a .csv file for additional analysis. 

Data Streams

The Virtual Scope tools make use of data stream files to determine which data it is capturing from the MagneMotion motor. By default, virtual scope uses a data set that includes information on the vehicle position, error, and velocity.  

The virtual scope tool can gather additional information on things like motor temperature, power specifics or other details if the scope tool is loaded with different data streams by going to “Advanced” -> “Load Data Stream.” Rockwell does not publish these data stream files, but you can reach Rockwell ICT’s support team for alternative data streams if needed. 

Using NC Host

While you can certainly run your tuning by setting up a PLC program to run tests, it is often easier to use NC Host to control a singular mover instead of spinning up a whole PLC program or modifying your production code. 

For more details on NC Host see MagneMotion Guide Part 2: Starting up and Commissioning a Track.

NC Host also has a tool that allows you to use a temporary set of PID parameters to reduce the number of times you’ll need to change the configuration file of your system. This means you can try out PID values without needing to restart your system. (Note that any parameters changed through NC Host will be reset the next time the system restarts or the relevant path is reset). 

Other Tuning Considerations

On top of the typical PID-based configuration adjustments, there are also several additional configuration modifications that can be made to improve your system’s behavior. 

Disable Control Thrust

 If a vehicle is having trouble settling into position, the configuration file can be adjusted to disable the control thrust on a vehicle when it is within a certain tolerance of its target. This comes at a cost to how closely the vehicle will hold to its destination but removes any oscillation or additional thrust from a vehicle that is within tolerance of its position. 

MagneMotion advanced parameters interface

Motion Limits

If you are having trouble ensuring smooth motion on your vehicles, configuring a stricter velocity limit or acceleration limit can prevent the vehicle motion from overshooting its target too aggressively at the cost of overall system speed. Importantly, this also is the easiest way to reduce temperature issues on a motor. 

MagneMotion motor parameters interface

Arrival Tolerance 

Similarly, if a station has too large of a settling time where vehicles are adjusting themselves to get into a station position, you can adjust the arrival position and velocity targets. This way, if on that particular path vehicle tolerance is not too strict, you can reduce the delay between when a vehicle arrives at its destination and when MagneMotion indicates that the vehicle is in position. 

MagneMotion motor parameters interface

This parameter only affects when MagneMotion considers a vehicle ‘in position’ and does not change the motion profile of a vehicle. 

Host Controller Communication 

You can also potentially reduce settling time by adjusting the system’s communication with its host controller. For high throughput systems, changing the Send Vehicle Status Period or the Vehicle Records/Status Period values can reduce the delay caused while waiting for the Node Controller to tell the host controller that the vehicle has arrived. Care should be taken when adjusting these values to ensure that you are not overloading the communication resources of the Node Controller or the Host Controller. 

On a host controller, this update frequency also depends on the cycle time of the MagneMotion device handler. 

Also note that these settings are specifically for systems that make use of Rockwell’s ICT library, see MagneMotion Guide Part 3: Controlling a System with a PLC

MagneMotion ethernet/ip interface

Learn more about DMC’s MagneMotion programming expertise and contact us today to get started on your next project. 

The post MagneMotion Guide Part 11: Tuning appeared first on DMC, Inc..

]]>
Siemens S7-1200 Web Server https://www.dmcinfo.com/blog/40637/siemens-s7-1200-web-server/ Mon, 19 Jan 2026 15:22:54 +0000 https://www.dmcinfo.com/?p=40637 In the 13 years since Tim wrote his blog post on the Siemens embedded web server on S7-1200 and S7-1500 PLCs, a lot has changed regarding PLC security and access control. In this blog post, we will be walking through creating a user-defined web page using the latest security features in TIA Portal V20 and […]

The post Siemens S7-1200 Web Server appeared first on DMC, Inc..

]]>
In the 13 years since Tim wrote his blog post on the Siemens embedded web server on S7-1200 and S7-1500 PLCs, a lot has changed regarding PLC security and access control. In this blog post, we will be walking through creating a user-defined web page using the latest security features in TIA Portal V20 and firmware v4.7.

Project Setup

We will start by creating a new project in TIA Portal, navigating to the “Devices & Networks” page, and adding our chosen PLC from the catalog. For this example, we will be using a `6ES7 212-1BE40-0XB0` more commonly known as a 1212C AC/DC/RLY.

Once the PLC is added, a pop-up will appear asking you to configure PLC security settings for the project. If you clicked cancel or had previously checked the box to prevent this pop-up from being shown, you can access it by clicking on the PLC in the Devices & networks page (the actual PLC, not the gray box around it), selecting the Properties and General tabs, selecting the Protection & Security dropdown, and clicking the Start security wizard button.

PLC CPU

The first step is creating a password to protect the PLC project and data on the PLC. Both DMC and Siemens recommend setting this password to improve OT security, and since we will be enabling a web server on this device (while presumably connecting it to a larger IT network), it is a critical step towards protecting the PLC. It is important to note that once applied, this password cannot be removed – make sure it is documented in a secure place like a password manager available to everyone on your team. A Post-it on your monitor is not a great place to store this password.

PLC

The next security setting is the mode for PG/PC and HMI communication. Unless you know you will be communicating with a legacy device, you should leave this at the default option to only allow secure communication.

PLC HMI Communication

The next setting will be for setting up access control. This should be enabled to restrict who can perform actions on the PLC, such as changing the run mode or accessing our user pages.

The “access levels” option is a legacy option that was the only security option before V20. If setting up a new project, it is recommended to leave this unchecked and use the new User Management and Access Control (UMAC) feature.

PLC access protection

In the next step, we will create one or more administrator users. This user will be able to perform all actions on a PLC that may be restricted, such as changing the mode between run/stop, updating safety settings (if available on your selected PLC model), changing drive parameters, or downloading new programs. It is important to store the login information in a secure place, and having a backup administrator user is a good idea.

PLC Administrator Setup

The next security setting is selecting whether anonymous access should be enabled. This could be useful to provide read-only access to any user without logging in, but it does reduce security slightly. For this demo, we will leave it disabled.

PLC Anonymous Access

The next page will need no changes as we are not using access control levels, and the last page will provide an overview of the settings you have chosen.

PLC Overview

At this point, we can click Finish and get started changing PLC settings for the web server.

Getting Started

Back in Devices & Networks, open up the PLC properties. Each section below will guide you through the settings that need to be changed specifically for the web server.

General

  • Here we can set the PLC name, plant information, and other designators.

PROFINET Interface [X1]

  • Here, we will need to set an IP address and Subnet Mask.
  • If this device will be accessible from an IT network, make sure the router address is set so that the PLC can be accessed outside the immediate local network.
  • If the PLC will be performing any tasks where the time of day needs to be known, or if you would like logs to have accurate timestamps, enable the time-of-day synchronization and enter NTP addresses. For this example, we will use several NIST servers located in different geographic regions.
NIST time-of-day synchronization
  • At the bottom of this tab, make sure to enable the web server on this interface (we will enable the web server module later).
Web Server Access
  • Note: if your PLC has multiple interfaces, one may be set up for connecting to local devices such as drives, remote IO, or local HMIs, and the other may be configured for connection to a larger IT network. The router address, NTP server, and web server access would only be needed on the interface used for IT network access.

Web Server

  • Check the box to enable the web server on all modules of the device and to permit access with HTTPS only.
Web Server general
  • Certificate Type: Hardware-generated
    • For this blog post, we will skip the differences between the two.
  • Further updates will be made here once we create an actual web page.

Time of Day

  • Set the time zone and daylight savings settings according to your location.

Adding Users and Web Server User Roles

Before we download and test our setup so far, we will need to configure user roles to allow access to the web server and create some non-administrator users who can access it.

User Roles

In the project tree, open Security settings > Users and roles and then select the Roles tab.

We will create two new roles: the first is a Web Server Admin, who can perform all tasks through the web server. The existing administrator users will be added to this.

PLC security settings user-roles

The second role will be a Web Server User role with permission to open only the user-defined pages we create.

Web server user role

Users

At this point, we can go back to the Users tab. The administrator users created during the project security setup should be added to the Web Server Admin role. We will “forget” to add the second administrator user to demonstrate what the web server looks like if these permissions are not given to the administrator.

PLC users

Clicking <Add a new user> lets you create a new non-administrator user with only the “Web Server User” role assigned, which we created earlier.

Creating a new non administrator user

Testing our Setup So Far

To confirm that all our security settings are working, we can download the hardware and software to the PLC and try accessing its webpage.

By entering the previously set IP address of our PLC in a browser window, we should be greeted by a Siemens landing page, and we can press Enter to view our PLC’s webpage. Make sure to enter `https://` before the IP address, and click your browser’s “accept the risk and continue” button if you’re prompted with a certificate warning.

PLC web page

By logging in with our first administrator login (dmcAdmin1) we can see that we can access all pages as well as change the run mode of the PLC.

PLC administration login

Logging out and back in as our “incorrectly configured” admin account shows that the user can log in, but because none of the web server runtime rights were granted, we cannot perform any actions that an authenticated user can.

Siemens S7 1200

Finally, by logging in as the standard user with permissions to only access the User Pages, we can see that the user can access the user defined pages tab, but is unable to perform administrator actions such as switching the PLC operating mode, downloading or backing up the program, etc.

S7 1200 Station standard user

Optimization

We have now shown that the Siemens PLC web server is enabled and secured, but if you spend any time navigating even the existing pages, you may notice that the web pages feel sluggish and slow to respond. There are two options that can be changed to speed up the pages.

Communication Load

By default, the PLC is set to spend no more than 20% of its CPU cycles performing communications. For some use cases, you may not have a large or complicated PLC project and would prefer a more responsive web server, at the cost of a slower scan time. By navigating to the PLC properties and increasing the limit from 20% to 50%, the project will become noticeably faster. During testing with one of my customers’ projects, web page loading time was approximately halved, while scan times went from 3-5ms to 4-11ms.

PLC communication load

Enabling HTTP Communications

During the web server setup process, we checked a box to enable only HTTPS (secured and encrypted) communications. Doing so requires the PLC to spend significantly more of the Communication Load time encrypting and decrypting web traffic and less time transferring web pages. Disabling this option will make the web pages load much faster. If your PLC is properly secured behind a VPN or is fully disconnected from the internet, then the decrease in security is not too severe, but keep in mind that anyone with access to the network could theoretically read the unencrypted HTTP information as it is transferred. This means that login information and everything displayed will be transferred in unsecured, plain text.

Enabling HTTP communications

Changing this setting had the most significant impact on page loading time, making the PLC-hosted web page feel almost as responsive as any site on the web, but comes with the cost of the greatest impact on security.

Next Steps

At this point, our PLC project and user permissions are correctly configured to enable user-defined pages. For more details on writing custom HTML pages that interface with the PLC program, check out Tim’s excellent write-up, which is mentioned at the start of this post.

Siemens S7 1200 Station

Ready to take your Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.

The post Siemens S7-1200 Web Server appeared first on DMC, Inc..

]]>
Memory Manipulation Tips For Mitsubishi PLCs using GxWorks3  https://www.dmcinfo.com/blog/40570/memory-manipulation-tips-for-mitsubishi-plcs-using-gxworks3/ Thu, 15 Jan 2026 13:00:00 +0000 https://www.dmcinfo.com/?p=40570 After working with GxWorks3 on several projects, I learned a few things about managing memory that were very helpful. I hope my tips on the following topics will help others as well when working with GxWorks3. Retained Memory It is straightforward to set non-device assigned labels such as local labels within a program or a global label that doesn’t have a device assignment to retain memory. Locate the label and within […]

The post Memory Manipulation Tips For Mitsubishi PLCs using GxWorks3  appeared first on DMC, Inc..

]]>
After working with GxWorks3 on several projects, I learned a few things about managing memory that were very helpful. I hope my tips on the following topics will help others as well when working with GxWorks3.

  1. How to set up retained memory for local labels, global labels with no device assignment, and global labels with device assignment 
  1. Adjusting the allotted device memory if you run out of a certain type of device memory 
  1. Minimizing program memory 

Retained Memory

It is straightforward to set non-device assigned labels such as local labels within a program or a global label that doesn’t have a device assignment to retain memory. Locate the label and within the class drop down select ‘VAR_RETAIN’ or ‘VAR_GLOBAL_RETAIN’ as shown below for the two types of labels.  

GxWorks3 Local Program Label
Figure 1: Local Program Label
GxWorks3 Unassigned Global Label
Figure 2: Unassigned Global Label

It takes a couple of extra steps to set a device assigned global label to retain. After you have decided on which device you want to use to assign to your label, you can assign the device to the label as normal, then select ‘VAR_GLOBAL_RETAIN.’

In the example below, I have assigned a trend array to a device section starting at D12000 up to D12399.  

GxWorks3 Tag Device Assignments
Figure 3: Tag Device Assignments

Next, the D memory registers D12000-D12399 must be designated as retain memory in the ‘Device/Label Memory Area Detailed Setting’ area. To navigate here using the navigation tree, double-click on ‘Parameter’ -> ‘CPU Parameter’ -> ‘Memory/Device Setting’ -> ‘Device/Label Memory Area Setting’ -> ‘<Detailed Settings>.’ 

GxWorks3 Device/Label Memory Area Detailed Settings
Figure 4: Device/Label Memory Area Detailed Settings

This will display the window shown below.

GxWorks3 Setting Devices to Retain Memory
Figure 5: Setting Devices to Retain Memory

From here, double-click on any of the cells circled in the screenshot above. This will open the Latch Range Setting, where we will set what memory registers should be retained or latched.  

GxWorks3 Latch Range Setting Screen
Figure 6.1: Latch Range Setting Screen

Here, we can see that I have a couple of ranges set for both M and D registers including the range D12000-D12999 to include the trend array from our example. After you have set the ranges you need for your project, press ‘OK’ and then you are done.  

Note, if you assign global labels that are not set to retain registers you defined in the Latch Range Setting or vice versa, you will receive a compile error reminding you to correct this.

GxWorks3 Latch Range Setting Compile Error
Figure 6.2: Latch Range Setting Compile Error

Adjusting Device Memory Allotment Size

Depending on the size of your PLC memory and the size of your project, there are times when you might run out of a particular device type. In this situation, if you are unable to upgrade your PLC memory, you can attempt to reallocate your device types if there are some device memory types that you are not using.  

To do this, navigate to the Device/Label Memory Area Setting Detail Settings screen as mentioned in the section above. Starting in the navigation tree, double-click on ‘Parameter’ -> ‘CPU Parameter’ -> ‘Memory/Device Setting’ -> ‘Device/Label Memory Area Setting’ -> ‘<Detailed Settings>.’ 

GxWorks3 Reallocating Device Points
Figure 7: Reallocating Device Points

Under the Device/Points column is where you can see the amount of points allocated to a given device. For example, for the D device, there are 20k points allocated which means the range of usable D devices spans from D0 – D20000. You can modify these allocations as needed as long as the total adds up to the ‘Total Device’ at the bottom as that is the limit of the PLC. After you are done, click on the ‘Check’ button at the bottom to verify that your new allocations are ok.  

Minimizing Program Memory

GxWorks3 Almost Out of Program Memory
Figure 8: Almost Out of Program Memory

The screenshot above was from a previous Mitsubishi GxWorks3 PLC project where we almost ran out of program memory. Since upgrading the PLC memory was not an option, we had to consider other ways to save memory.  

For this project, we were programming from scratch and adhering to DMC’s best practices by using named Global Labels and UDTs for maximum code clarity and ease of maintenance. However, we discovered that moving data directly between UDTs using its symbolic name used a lot of program memory compared to directly manipulating the data using its device memory address. In the screenshots below you can see the massive difference in program steps used between using the symbolic name vs. the direct device address in rung 17.  

GxWorks3 Using symbolic name, 881 steps used
Figure 9: Using symbolic name, 881 steps used
GxWorks3 Using memory address, 79 steps used
Figure 10: Using memory address, 79 steps used

Due to the project hardware constraints, we had to sacrifice some code readability to fit the entire program within the allotted memory available. We used the instructions, BMOV (Transferring 16 – bit block data) and BLKMOV (Transferring n-bit data) on some of the bigger data transfers to help us achieve this. In the end, we were able to fit our program onto the PLC.  

I hope that you find these tips for setting up retained memory, adjusting the allotted device memory, and minimizing program memory helpful when working with GxWorks3. 

Contact us today to learn more about our Mitsubishi PLC expertise and how we can help your team achieve its goals.

The post Memory Manipulation Tips For Mitsubishi PLCs using GxWorks3  appeared first on DMC, Inc..

]]>
Beckhoff TwinCAT HMI – Tips and Tricks https://www.dmcinfo.com/blog/40448/beckhoff-twincat-hmi-tips-and-tricks/ Fri, 09 Jan 2026 13:00:00 +0000 https://www.dmcinfo.com/?p=40448 There are several TwinCAT HMI ‘getting started’ resources out there – maybe you’ve found one and gotten started. But as you’re designing your HMI, you might be missing out on a few easy-to-miss things that are really nice to have in your toolbox. Interface and Editing You Can Select Multiple Controls and Change the Same […]

The post Beckhoff TwinCAT HMI – Tips and Tricks appeared first on DMC, Inc..

]]>
There are several TwinCAT HMI ‘getting started’ resources out there – maybe you’ve found one and gotten started. But as you’re designing your HMI, you might be missing out on a few easy-to-miss things that are really nice to have in your toolbox.

Interface and Editing

You Can Select Multiple Controls and Change the Same Parameter for all Controls at Once

Have a bunch of items in a grid, each one with the same 5% margin from the left, and suddenly you decide 3% looks much nicer? No need to click through each one nor find and replace in the HTML source files! Just select all controls and change the parameter in the properties tab. The property you changed is now changed for every control you selected.

The Document Outline is a Great Help When Working on a Screen

Having trouble selecting a control, or is a control lost behind another? As great as the main WYSIWYG (what-you-see-is-what-you-get) editor screen is, the Document Outline provides greater visibility into nested controls (when using Grids and Containers) and invisible controls. I almost always have this pinned to my XAE layouts when developing with TwinCAT HMI.

TwinCAT HMI

Symbols and Parameters

Symbol just refers to a tag or variable, in TwinCAT HMI. There are variations:

  • Server Symbols are symbols saved in the TwinCAT HMI server. Most notably Mapped Symbols are a type of server symbol which comes from the PLC.
  • Internal Symbol are symbols which are limited to a single browser instance.
  • Symbol Expression refers to the text

You Can Double Click on a Symbol to Pop Up a Nifty Binding Details Window

When you have a symbol in a data binding or function binding, you can double click on it to pop up a ‘Edit Binding’ window. This can show you some details on modes and settings and can also be used to quickly edit the symbol name. In the screenshot below, I might have a similar ‘IsAlarmLowEnabled’, and I can switch this symbol binding to that symbol more quickly than reopening the Create Data Binding window

creating binding

When Making a Parameter for a User Control, Comments are Very Underrated

User controls are great for creating reusable custom controls, but they’re even better when you comment any parameters you make. Now, not only can developers that use your control (including future you, probably) hover to see your comment, they’ll also be able to hover to see the datatype!

Function Bindings and Scripting

Function Bindings are Basically Javascript

Consider a function binding as a continually evaluating single JS expression where symbol expressions get evaluated as their value and the result of the JS expression is what the parameter sees.

Remember that the function binding accepts and evaluates only a single JS expression. With that in mind…

“IIFE”s are incredibly useful when you want multiple expressions in a function binding but don’t want to write a full TwinCAT HMI function

Custom Javascript or Typescript functions in TwinCAT HMI are an excellent tool, especially when you will need to run the same snippet in multiple places. But sometimes you want to have a few expressions together in a one-off function binding. Ordinarily, one can’t do the following in a function binding:

let a = 1;

let b = 2;

return(a+b);

Well, you could write that in a function binding, but you won’t get anything useful back. Instead, you can write this:

(function (){

  let a = 1;

  let b = 2;

  return(a+b);

})();

I’ve grown to really love TwinCAT HMI for its power and extensibility, for industrial HMI applications from simple to complex. I hope these tips are useful as you create your design.

Contact us today to learn more about how we can help you achieve your goals, and our range of Automation solutions – including TwinCAT HMI services.

The post Beckhoff TwinCAT HMI – Tips and Tricks appeared first on DMC, Inc..

]]>
Siemens MQTT Setup with AWS IoT Core https://www.dmcinfo.com/blog/40387/siemens-mqtt-setup-with-aws-iot-core/ Mon, 22 Dec 2025 15:00:00 +0000 https://www.dmcinfo.com/?p=40387 As technology advances and security standards improve, clients in the automation industry are transitioning to newer communications standards for both future-proofing and improved plant security. This blog covers the implementation of the MQTT standard, which is known for being simple, secure, and lightweight, with the AWS IoT Core service and the Siemens LMQTT library. The primary […]

The post Siemens MQTT Setup with AWS IoT Core appeared first on DMC, Inc..

]]>
As technology advances and security standards improve, clients in the automation industry are transitioning to newer communications standards for both future-proofing and improved plant security. This blog covers the implementation of the MQTT standard, which is known for being simple, secure, and lightweight, with the AWS IoT Core service and the Siemens LMQTT library. The primary goal of this blog is to provide a centralized resource to demystify the setup process.

Note: This blog uses a Siemens S71214 G2 PLC and TIA Portal V20 Update 3, with version 2.3.0 the Siemens “Libraries for Communication”.

Why Certificates?

Instead of user credentials, which can be easily compromised, the industry is slowly shifting towards more secure certificate-based security. Certificates are authorized and signed by a “Certificate Authority” (CA) and come with a public and private key.

A public key is shared openly to encrypt data or verify signatures, while the private key is stored locally by the certificate owner to decrypt data and create signatures, enabling secure communications.

Typically, an MQTT connection is secured through TLS and leverages a unique certificate per device. Devices can share the same certificate, but if one of the certificates is compromised, all devices will need to have their certificates updated.

What’s the Catch?

One way that certificates are more secure is that they have limited lifespans. Each certificate has a specified time frame (usually a decade or more, up to a limit) where it is valid. Upon expiration, communications relying on the certificate will fail until a new certificate is signed by the CA and manually rotated on the device. For Siemens PLCs, this is a manual process that requires a hardware download and downtime.

A similar lifespan issue arises for the CA. The current Amazon Root CA 1 at the time of writing expires January 2038 and has a lifespan of 10-20 years.

However, AWS helps with mitigating this issue by allowing users to remotely monitor and even revoke certificates.

Configuring AWS IoT Core

In AWS IoT Core, every device is registered as a Thing and has associated certificates to secure the communications and “Policies” to determine the permissions a certificate is allowed to have. Before the PLC can communicate with AWS, it must first be configured in the IoT Core with at least one of each (Thing, Certificate, Policy).

Note: It is possible to use user credentials with AWS, but this is less secure and requires the configuration of a custom authorizer and downloading the Amazon Root Certificate to the PLC. More information can be found here: Use API Gateway Lambda authorizers – Amazon API Gateway.

Creating a Thing

A Thing can be created under the “Manage > All devices > Things” menu. Creating a Thing will prompt the user to assign a certificate and a policy. In this example, an auto-generated AWS certificate was used.

creating a thing

Creating a Policy

As part of the steps to create a Thing, you can also create a Policy. Policies are used to Allow/Deny actions that a device can perform when connected using the attached certificate. A policy can be reused across multiple certificates, and a certificate can have multiple attached policies, allowing for flexible configuration.

For testing basic communications and setup, it is recommended that an unrestricted policy be used to allow all policy actions and resources to be accessed (notated by the wildcard character, *). Policies can be updated at any time to remotely modify the permissions of any device.

Creating a Policy

Note: For more information regarding policy configuration, see AWS IoT Core policy examples – AWS IoT Core.

Creating your Certificates

Once a Thing has been created, a pop-up will appear with download links to the generated certificates. Click the “Download All” button to download a copy of the certificate, keys, and root CA certificates. Don’t close the dialog box without downloading a copy of the certificate and keys, as this is the only time they are available for security reasons!

creating certificates

Configuring the Siemens PLC

Configuring the PLC to communicate via MQTT requires 3 steps. First, the LMQTT library must be added to the project and configured for the connection. Next, project security must be enabled to allow the user to access the “Certificate Manager” and import the certificates to the project.

Note: More information and a detailed guide of each step can be found here: Use the SIMATIC controller as an MQTT client – ID: 109748872 – Industry Support Siemens.

Adding the Library to the Project

The LMQTT Library and documentation can be found as part of the communications library here: SIMATIC S7-1500/S7-1200 Libraries for Communication (LCommSuite) – ID: 109780503 – Industry Support Siemens

After downloading the Siemens Libraries for Communication, unzip the file and move the resulting folder to a permanent location. Then, import the “Libraries_Comm_Controller.al20” as a global library into your project.

Adding the library to the project

The communications library will then appear. For this blog, only the LMQTT library objects are used. Drag and drop the “LMQTT_Client” object from the Global Library into the “Program blocks” folder of your PLC. All dependencies will automatically be imported into the project along with the library block.

library block

Creating a Data Block

Next, create a Global Data Block to hold the tag values of the LMQTT Client. This can be done by expanding the “Program blocks” folder in the Project tree and clicking “Add new block”. From the dialog box, select “Data Block”, name the block, and choose “Global DB”.

creating a data block

The Data Block used by our example project is shown below. Some notes on our implementation:

  • Outgoing and Received message have a constant defining the length of the message byte-array.
  • The error struct is used to log a history of errors and record the status of the system and are not mandatory.
dbMQTT

Configuring Connection Parameters

The connection parameters in our example are configured as follows:

Configuring connection parameters

Some notes on our configuration:

  • “hwId” is best left as 0, as this will allow the library to select a suitable hardware interface automatically. To specify it directly, Hardware IDs can be found by going to the “Device Configuration > Properties > System constants” tab of your PLC.
Configuration notes
  • “connId” must be unique for each connected device.
  • “broker” will be your unique AWS IoT Data Endpoint. This can be found in the AWS Portal under the “Settings” menu.
  • “port” for our application will be 8883 (certificate authenticated pub/sub). A list of standard AWS ports are found here: Device communication protocols – AWS IoT Core.
  • The “tls” settings enable encryption. The important settings here are that the broker certificate and client certificate numbers match the certificates in the Certificate Manager (covered later in the blog).

Connecting the LMQTT Client Function Block

An instance of the LMQTT Client function block can be created by dragging an instance of “LMQTT_Client” into any LAD block on the PLC and linking the corresponding tags in the database. An example of how the tags can be linked is shown below:

connecting the LMGTT client function block

Enabling Project Security & Importing Certificates

To enable project security, navigate to the PLC’s “Properties > General > Certificate manager” menu and enable the “Use global security settings for certificate manager” setting.

certificate manager

Next, enable project security by navigating in the Project Tree to “Security settings > Settings > Project protection” and password-protect the program. This is necessary to enable the project “Certificate manager” menu under “Security Settings > Security features.”

Before the certificate is imported into TIA Portal, the AWS client certificate and private key must be merged using a text editor. This can be done by opening both the *.pem certificate and the private.key file and pasting the private key in the line below the certificate. After doing so, your certificate file should look like the one below:

Root certificates

To import a certificate, navigate to the “Trusted Certificates and root certificates” menu in the project “Certificate Manager”, right-click the table and select import. The two files that will be needed are the:

  1. Amazon Root CA1 (SHA-256)
  2. AWS IoT Certificate (Modified with key appended to certificate)

Once complete, the two certificates should appear as follows:

  • The ID of the “Amazon Root CA 1” MUST correspond to the “brokerCert” in the connection parameters.
  • The ID of the “AWS IoT Certificate” MUST correspond to the “clientCert” in the connection parameters.
trusted certificates

Next, return to the PLC “Properties > Certificate manager” and add the IoT Certificate under “Device certificates” and the Root CA1 certificate as a “Certificates of partner device.”

Finally, the IP, gateway, and time settings of the PLC need to be configured before downloading to the PLC.

Operation of LMQTT Client

The LMQTT Client can be directly controlled by monitoring the runtime values of the Data Block. To start a connection, bring the “connect” input on the Client high and wait for the block to connect.

The status of the block can be seen by monitoring the “output > diagnostics > status” tag. A tag value of 16#7004 indicates a successful connection.

The publish/subscribe/unsubscribe signals are level-triggered, and only a single command is allowed to be active at any given moment, or else an error will occur.

A message can be published to a topic by setting the topic, populating the byte array and setting the data length, and setting the “publish” control signal. Any MQTT client subscribed to the same topic and connected to the AWS Endpoint will be able to see your published message.

Troubleshooting Common Errors

Note: An additional guide accompanying the LMQTT library is the Cloud connection – simple and secure with SIMATIC S7-1200/S7-1500 – ID: 109772284 – Industry Siemens Support by Siemens, which provides more detail about configuring an AWS broker and setting up the PLC project from scratch.

The LMQTT Client is timing out when trying to connect

This is most likely caused by an incorrect connection parameter or improper network configuration on the PLC. Some steps to try to remedy this error:

  1. Check that the AWS IoT Data Endpoint is pingable from the device network.
AWS IoT data end point
  1. A known issue of older versions of the LMQTT library is that the broker string needed to be terminated with a period, but this is resolved in current versions of the library.
  2. Check your PLC network configuration. Since the PLC needs an internet connection to reach the AWS Endpoint, the correct router address is mandatory. To find the router address, run a “ipconfig” command in Command Prompt and look for the “Gateway” setting for your network adapter while connected to the PLC network.
profinet interface

The DNS server might not be properly configured. This will prevent the PLC from resolving the Endpoint. DNS servers can be configured in the PLC “Properties > Advanced Configuration” menu. The DNS addresses can be your router gateway or a trusted server such as Google (8.8.8.8).

advanced configuration

The LMQTT Client is stuck in a reconnection loop

A connection loop is a sign that the certificate authentication or AWS policy is configured incorrectly. Ensure that the certificate is set up properly and that the Client block is not attempting to connect with a denied Publish topic for the Will topic for the active AWS Policy.

I want to test my MQTT connection without the PLC

There are many free downloadable MQTT clients that can be set up on your computer, such as MQTTx or MQTT Explorer.

Conclusion

Although the setup process is more complex than traditional methods, secure MQTT communications from a PLC to the cloud can allow remote communications that would cause security risks with traditional methods. At its core, MQTT is a secure and lightweight protocol that is versatile and can suit the needs of hobbyists and industry alike.

Ready to take your Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.

The post Siemens MQTT Setup with AWS IoT Core appeared first on DMC, Inc..

]]>
Using Cognex Barcode Scanners with TwinCAT https://www.dmcinfo.com/blog/39913/using-cognex-barcode-scanners-with-twincat/ Thu, 04 Dec 2025 14:00:00 +0000 https://www.dmcinfo.com/?p=39913 When working with clients in the biotech industry, barcode scanners and robust data tracking systems are key to ensuring accurate, traceable, and efficient workflows. Cognex’s line of fixed-mount barcode scanners, designed to withstand harsh conditions, pairs elegantly with Beckhoff’s IPCs, which boast high-speed computing and comprehensive data analysis capabilities. This blog will detail how to […]

The post Using Cognex Barcode Scanners with TwinCAT appeared first on DMC, Inc..

]]>
When working with clients in the biotech industry, barcode scanners and robust data tracking systems are key to ensuring accurate, traceable, and efficient workflows. Cognex’s line of fixed-mount barcode scanners, designed to withstand harsh conditions, pairs elegantly with Beckhoff’s IPCs, which boast high-speed computing and comprehensive data analysis capabilities. This blog will detail how to integrate an out-of-the-box Cognex barcode scanner (focusing on the DataMan 390 Series) into TwinCAT, Beckhoff’s automation software.

Note: This blog uses a DataMan 395X barcode scanner and a C6015-0010 IPC. Beckhoff’s EL6652 module is used to connect to DataMan over EtherNet/IP. The programming laptop is running TwinCAT 3.1.4024.67.

DataMan Setup Tool

Cognex’s DataMan Setup Tool is a useful standalone app to configure the settings of your barcode scanner and train the vision model with straightforward installation and UI. However, key changes must be made to ensure a seamless network interface with your IPC.

DataMan Networking

To begin, navigate to Cognex’s website and download the latest version of the DataMan Setup tool on your programming computer. This blog will use version 25.3.2. Upon installation, you will land on the “Connect” page, where all valid network devices will populate.

Cognex's Dataman Connect Page

To ensure that you can view the barcode scanner within the setup tool, your computer must be on the same subnet as the barcode scanner. New inbound rules in your operating system’s firewall settings, allowing TCP/UDP communication through the DataMan Setup Tool, may also need to be enabled.

ip addess of Cognex's dataman 390 series model

By default, the IP address of a DataMan 390 series model is 192.168.0.200. If you have trouble detecting it or the IP address was previously configured, you can download another standalone Cognex app – Cognex Device Discovery Utility. This allows detection and configuration of network settings based on the serial number or MAC address of your product and can be downloaded from Cognex’s website.

If you successfully detected your barcode scanner in the DataMan Setup Tool, change to the “Communications” tab. Here, you can set the static IP address to whatever is desired. Keep in mind that this IP address will ultimately need to be on the same subnet as your IPC.

If you have discovered the barcode scanner over UDP, it is then recommended to connect to your device securely.  This can be done with an Ethernet to USB-C adapter, for example, plugged directly into your programming computer. I changed my scanner’s IP address to one that my adapter could detect, but also one that is on my IPC’s subnet, which we’ll get to later.

Cognex's DataMan

DataMan Configuration

After securely connecting to your DataMan device and discovering it on the “Connect” page of the DataMan Setup Tool, double-click on your barcode scanner. You will be met with the “Introduction” screen shown earlier and can step through the setup wizard.

Calibration of the vision model, unique delimiters characters, partial results, and other settings can be configured here.

For integration with TwinCAT, the most important tab is the “Communications”, and again, verify that the IP address is on the same network as your IPC. The EtherNet/IP industrial protocol box must also be checked to allow detection by the EL6652 module.

Cognex's DataMan Configuration

TwinCAT Integration

I/O Setup

For this example, we’ll start with a blank TwinCAT XAE Project. I’ve added the I/O to match with my PLC hardware setup, which includes an EK1100 bus coupler, connected via RJ45 to the I/O port on my C6015-0010, and the EL6652 EtherCAT terminal.

I/O Setup

             
Now, we must add a new device by right-clicking the root of our device tree and selecting type EtherNet/IP Scanner (EL6652).

Adding a new device EtherNet/IP Scanner (EL6652)

At this point, you’ll want to load the input/output mapping of our DataMan 395X from a configuration file. By navigating to Cognex’s website, you can find and download the necessary file pertaining to your specific DataMan series, with extension “.eds”.

Dataman 390 EDS and GDS Files

Then, back in TwinCAT, we can import the .eds file by browsing our file explorer.

TwinCAT

Next, right-click on the EIP Scanner and select ‘Add New Item’, which will allow you to select the .eds file corresponding to the DataMan model you have.

EIP scanner

Now, double-click on your new DataMan Box under the EIP Scanner, and set the IP address to what you had previously configured in the DataMan setup tool.

Setup IP address in Cognex's dataman setup tool

Now, there are just a couple more settings to configure! One of them is to install the RealTime Ethernet Driver on the IPC, and the other is to create an IP address of the EIP Scanner itself. These are detailed in the “Task 2: Configure LAN Port for Ethernet/IP” of this DMC blog.

Ready to take your Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.

The post Using Cognex Barcode Scanners with TwinCAT appeared first on DMC, Inc..

]]>
A Quick Start Guide to Robot Programming with RCX-Studio 2020 https://www.dmcinfo.com/blog/39521/a-quick-start-guide-to-robot-programming-with-rcx-studio-2020/ Wed, 12 Nov 2025 13:00:00 +0000 https://www.dmcinfo.com/?p=39521 RCX-Studio 2020 is the required environment for configuring, teaching, and managing Yamaha robots.   If your current automation project requires the use of the Yamaha RCX-Studio 2020 software for the RCX3 Series controllers, this guide is designed to minimize your ramp-up time. This blog assumes you have a general understanding of robot programming and Robot-PLC integration […]

The post A Quick Start Guide to Robot Programming with RCX-Studio 2020 appeared first on DMC, Inc..

]]>
RCX-Studio 2020 is the required environment for configuring, teaching, and managing Yamaha robots.  

If your current automation project requires the use of the Yamaha RCX-Studio 2020 software for the RCX3 Series controllers, this guide is designed to minimize your ramp-up time. This blog assumes you have a general understanding of robot programming and Robot-PLC integration knowledge. It is not designed to be a comprehensive guide on robot programming or to go through every single feature of Yamaha robots. We will cover the essential topics: connecting to the controller, defining IO, defining/teaching points, building a basic routine, and jogging so you can quickly move to development and commissioning your robot program.  

Important

RCX-Studio 2020 is free to download. However, to create, save, archive, and deploy custom programs to a controller, you will need a USB license dongle directly plugged into your PC.  

This link from Yamaha’s website includes the download link for RCX-Studio and information on the USB license dongle.

Starting a Project (File Structure Overview)

This is the initial screen upon opening up the software.  

RCX-Studio 2020 display window

The files under the folder ‘Controller’ are unarchived robot files. When opened, these can be used directly to go online with the robot controller and jog and monitor the robot. The files under the folder ‘File’ with the .all extension are archived files and are generally used for source control. These files require a USB license key to open and edit. You can’t go online with the robot controller and jog/monitor the robot with an .all file but you can view the program contents.  

Starting With No Reference File/Backing up From Controller

If starting from scratch, create a new Controller file by double-clicking on ‘New Controller.’ The following window will appear. 

RCX-Studio 2020 display window

Give your new controller a name. Then, you can select between starting in offline mode or online mode. To work offline with no existing robot program, you can either select a robot model number to add or start with a file with no existing robot if you just want to work on development and do not have an exact model number yet.  

To start in online mode, you need to be physically connected to a controller either by Ethernet cable or RS232 cable. You will need either the IP address or the RS232C connection information for the controller. You can pull all the data currently on the controller with this method.   

Working With a .All File

To convert an archived .all file to a regular robot program file, click on ‘Tool’ in the tool ribbon, then in the drop-down menu, click on ‘Data Transfer…’ 

RCX-Studio 2020 display window

Next, in the source file section of the window, select ‘File’ and browse for the location of your .all file. Then, make sure all the data is checked in the ‘Transfer Data’ area, and make sure the boxes directly below are all unchecked.  

Specifically, if you are looking to download the file back onto the existing robot after making programming changes, DO NOT SKIP the ‘Robot Specific Parameters’ as these include encoder hardware information and other hardware setup information important to the specific robot, which are set up at the factory. In almost all cases, you would want to transfer all the data. Otherwise, there is a risk of OVERWRITING this data on the controller when you download your updated program file to the controller if you didn’t originally transfer it to the controller file.  

After that, select a blank controller file that you want to put the data in or create a new controller file to store the data, then press ‘OK’.  

RCX-Studio 2020 display window

Program Overview

For the remainder of this guide, we will review programming and commissioning with the controller file interface. Here is a general overview of the important components of the controller file UI. 

RCX-Studio 2020 display window

Next, we will shift our focus to the ‘Window Tree’. Through the window tree, you can navigate to all the main functions needed for programming and commissioning the robot. We will go through a couple of important items here to get you started. 

Operation Folder

This folder includes the following items: Servo, Origin(All), Origin(Selected Robot), Jog, and Point Trace, which are all important for initial commissioning. 

RCX-Studio 2020 display window

Servo

Double-clicking on ‘Servo’ brings up the following window.  

RCX-Studio 2020 display window

Here you can manually turn on and off motor power and free servos for each individual axis. This can be useful if you need to turn off power to manually move the robot by hand during commissioning.  

Origin(All) and Origin(Selected Robot)

RCX-Studio 2020 display window

Sending a robot to origin will command the robot to move to the origin position of the encoder set at the factory and not a custom user “home” location. This does not need to be done regularly. It only needs to be done if the servos lose track of their current position.  

Typically, controllers will come with special batteries installed to ensure these positions are always remembered, even when the main power supply is off. Since these are factory settings, when there is a need to send the robot to origin, be aware of any objects surrounding the robot to prevent collisions, as it will move each axis directly to the origin location, disregarding any programmed moves.  

Jog

RCX-Studio 2020 display window

The jog window is key for teaching positions and commissioning. Here you can select between three jog modes in the ‘Unit’ drop-down: ‘pulse’, ‘mm,’ and ‘tool’, and the buttons will change accordingly to those options. The ‘mm’ setting is millimeters in Cartesian coordinates and is the simplest one to use for general jogging purposes. You can adjust the jogging speed in percentage units and the jogging distance with the ‘Inch Dist.’ field. After changing the value, press “set” to apply it. If it hasn’t been set, the value will be highlighted red.   

Point Trace

RCX-Studio 2020 display window

The point trace window is used for verifying motions between points that are safe and optimizing robot pathing. Here you can select the type of move (linear, arc, joint), the movement speed, and the point number you want to move to. You can also only move selected joints to a particular point. Press “Trace” to start moving to the current selected point.  

Program Folder

This is where your main robot program and subroutine/functions will live.

RCX-Studio 2020 display window

Double-click ‘New Program’ to create a new program. You can choose from starting with an empty file or one of the templates included. The paper icon with the ‘M’ indicates that it is your main program and will begin executing when you start the robot. To adjust the main program, right-click on the program you want to change to the main and click ‘Setting Main Program’. 

RCX-Studio 2020 display window

Below is the programming window for a given program. Here you can start, stop, and step through your program. You can also reset the program and have it execute again from the top. When online, clicking on the yellow ‘Exec Line’ button will toggle the view to follow which line is currently being executed.  

RCX-Studio 2020 display window

For specific programming syntax information, refer to the Programming Manual. The remaining items in the program folder are not essential to review in a quick start guide, so we will move on.  

Coordinate System Folder

This is where your point definitions are stored. Double-click on ‘Point’ to bring up the Point window.

RCX-Studio 2020 display window

In RCX-Studio, points can be referenced in the program as the point number, ex. P5, or their Name, ex. ‘NavHome’. Refer to the manual mentioned in the programming section for the exact syntax.

The Point window is also where you can teach and modify points manually. To teach a point, move the robot to the point you’d like to teach and then click on a point number where you would like to save the data and press ‘Teach(mm)’ to teach with Cartesian data or ‘Teach(pls)’ with encoder pulse data. You can manually modify any saved point by clicking on the cell with data you’d like to modify, changing the data, and then pressing ‘Enter’ on your keyboard. You can also add any additional helpful comments in the ‘Comment’ column.  

The remaining items in the Coordinate System folder are not essential to review in a quick start guide, so we will move on.   

Parameter Folder

The parameter folder holds robot-specific hardware settings and general settings related to the specific selected robot.  

RCX-Studio 2020 display window

These are the ‘Robot Specific Parameters’ mentioned earlier in the guide to not skip during the data transfer.  

In the Controller window, note that there are some execution and program settings that you can modify. Click on them to display their descriptions.  

You can view which option communication boards are installed in your controller to communicate with the PLC. Locate them in the Board Enable/Parameter windows under the Option drop-down. 

RCX-Studio 2020 display window
RCX-Studio 2020 display window
RCX-Studio 2020 display window

System Folder

The system folder includes a couple of troubleshooting items that are helpful during commissioning, including ‘Warning History’ and ‘Alarm History’. You can also click on ‘System Check’ to see if the overall system is ok.  

Monitor Folder

This folder is very important for commissioning, as it contains access to all monitoring windows for the robot’s current position and the controller IO. We will only focus on the main ones DI, DO, SI, SO, SIW, and SOW. We will also review a couple of significant IO points in this section.  

RCX-Studio 2020 display window

Current Position

Clicking on ‘Current Position’ will open the current position window, where you can view the robot’s current position in Cartesian coordinates and encoder pulse values.  

RCX-Studio 2020 display window

DI/DO

These windows show the current state and available digital inputs and outputs going to the controller. A bright green LED means it is on/true, and a dark green LED means it is off/false.

RCX-Studio 2020 display window

Within a program, you can reference these points using the system name (e.g., DO0(0)) or a user-given name if allowed.  

SI/SO

These are IO points coming over Ethernet or other communication protocols based on the optional communication boards installed in your controller. These are typically used to communicate with the PLC.  

Here is the default list of SI: 

RCX-Studio 2020 display window

The first 16 bits are reserved and have a dedicated purpose based on their comments. A couple of important ones include the following:  

  • SI0(0) – E-Stop input for the robot, ON= E-Stop OK 
  • SI0(1) – Command to turn on robot servos 
  • SI0(6) – Stop robot program execution, OFF = Stop Active, ON = Stop Inactive 
  • SI1(2) – Start automatic robot program execution 
  • SI1(5) – Resets the robot program and forces it to execute from the first line (useful for recovery during handshakes) 
  • SI1(6) – Robot controller alarm reset for any controller alarms 

The remaining can be named and used for custom functionality.  

Here is the default list of SO: 

RCX-Studio 2020 display window

The first 16 bits are reserved and are used to report a status based on their comments. The remaining can be named and used for custom functionality.  

SIW/SOW

These are registers used to send words between the robot controller and the PLC. These cannot be renamed by the user. You can display their values in Hex or Dec with the radio buttons at the top. You can reference these IO in the robot program using their system name (e.g., SIW(0), SIW(4)). You can find more information on programming syntax in the programming manual linked above in the Programming Folder section.  

RCX-Studio 2020 display window
RCX-Studio 2020 display window

Ready to take your Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.

The post A Quick Start Guide to Robot Programming with RCX-Studio 2020 appeared first on DMC, Inc..

]]>
Using The Siemens Extended Modbus Library https://www.dmcinfo.com/blog/39393/using-the-siemens-extended-modbus-library/ Tue, 11 Nov 2025 13:00:00 +0000 https://www.dmcinfo.com/?p=39393 The Extended Modbus Library was developed by Ola Bjørnli and published on GitHub. It has since been incorporated into the Siemens Open Library, which is maintained by DMC.  This library extends and simplifies the built-in Modbus functionality within Siemens TIA Portal, giving developers a more flexible and user-friendly way to work with Modbus devices. Ola […]

The post Using The Siemens Extended Modbus Library appeared first on DMC, Inc..

]]>
The Extended Modbus Library was developed by Ola Bjørnli and published on GitHub. It has since been incorporated into the Siemens Open Library, which is maintained by DMC. 

This library extends and simplifies the built-in Modbus functionality within Siemens TIA Portal, giving developers a more flexible and user-friendly way to work with Modbus devices. Ola Bjørnli’s provided examples and documentation, found on GitHub, do a great job breaking down how to use the library. 

How the Extended Modbus Library Works With Modbus TCP 

Here is an example of how to set up a Modbus TCP client. 

Block Interface 

To maximize reusability, we have set up our inputs to include: 

  • Connection ID – Unique identifier for each Modbus Client instance 
  • Hardware interface The hardware interface to which the Modbus Server is networked 
  • TCP port – Typically 502  
  • IP address – The IP address of the Modbus Sever 

This allows the block to be reused for multiple field devices, provided they have the same Modbus interface. 

The static data elements are: 

  • mb_query – This is used to define the Modbus queries; one instance can be reused multiple times 
  • mb_tcp_ctrl – The function block that establishes connection runs and sequences queries 
  • mb_delay_between_queries – Spaces out queries to avoid overloading the server 
  • modbusRegisters –  A custom UDT containing the data to be read from and written to the Modbus server. 

The only constant we have defined is the clientNumber, which is the station address. This is usually 0 or 255.  

Modbus TCP interface
Modbus TCP interface

The Code 

This is taken almost exactly from Ola Bjørnli’s example, but it is broken up so we can walk through each step.  

The initial setup is straightforward: 

  • Call the mb_tcp_ctrl block  
    • Map in the interface, connection ID, IP address, and TCP defined in inputs
    • Set your timeout to whatever is needed for your application  
    • Point mb_query to mb_query we set in the static memory 
  • Call mb_delay_between_queries  
    • Tie in the same mb_query from static memory 
    • Set the delay needed for your application 
Modbus TCP code

After this initial setup, we need to build our queries. First, looking at the read queries, below are reads for all four types of Modbus registers. Again, the Extended Modbus Library makes this very straightforward: 

  • Call mb_query for each query you want to run; there is no limit 
    • data_addr corresponds to the register of the address you are trying to read from 
    • Data_ptr should point to where you want the data to be stored in 
      • Here we have a custom UDT in the static memory, this can either be an array of data points or to an individual point 
    • Mb_addr is the station address we defined as a constant earlier 
    • Mode is used to tell the query what kind of operation we are performing 
      • These modes are defined as constants within the static memory of the mb_query we are calling 
Modbus TCP code

To write to either the output coils or the analog output holding registers, you set up your query calls as shown below. The only difference is that mode is pointed to the “c.write” struct in mb_query instead of “c.read”, and the data_ptr points to the data on your PLC that you want to write to the Modbus device. 

Modbus TCP code

With just these three sections, your code can read and write to any register on a Modbus TCP device! 

How It Works With Modbus RTU 

Using this library, the code to connect to a Modbus RTU device is almost the exact same as a Modbus TCP device.  The only difference is: 

  • Call mb_rtu1200_ctrl or mb_rtu1500_ctrl instead of mb_tcp_ctrl 
    • Choose the FB that matches your PLC 
    • hardware_id should be connected to the port your device is connected to 
    • buad_rate should be set to match your RTU device’s baud rate 
    • operating mode should be set based on the table shown below taken from the Siemens information system 
Modbus TCP code
Modbus TCP code

Tips, Tricks, and Troubleshooting

Fun With Pointers 

When passing data to and from mb_query as shown above, the data is passed by a pointer. The function block then finds the start and the length of the data you pass in, meaning the data types passed in do not matter. For example, you don’t need to just have 16-bit integers used to read from input registers.

This is especially useful when: 

  • Multiple statuses are bitmapped into a single register 
    • Can automatically splice it into 16 bools 
  • A 32-bit datapoint is passed out over two registers 
    • For example, this can be passed into a single real

These can be handled with custom UDTs, like the one shown below. You must ensure proper alignment with the actual register indexes and account for byte-swapping as needed. 

Modbus TCP interface

Queries Less Than 16-Bit

If reading fewer than 16 bits (for example, discrete inputs or outputs), use mb_query_bits. While the standard mb_query may still work in some instances, this function is the recommended route to read smaller datasets. 

Troubleshooting Overview

The extended Modbus Library uses the Siemens communication blocks (TCON,  TDISCON, TSEND, TRECEIVE), meaning you can leverage their error codes for troubleshooting.  

Within your function block’s instance memory: 

  • Navigate within your “ctrl” block and open “MB_CLIENT” to view error codes 
  • You can dig into the individual T-blocks as needed 
Modbus TCP interface

Troubleshooting Queries 

It is important to note that each query is executed independently, and if a query fails from a configuration issue, an invalid register, or anything else, it will be skipped, and the next query will be executed.  

The error codes for that query will only be displayed until the next query is run. To debug: 

  • Comment out all but one query at a time 
  • Troubleshoot until no errors are present and the data is being populated or sent as expected 

Ready to take your automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals. 

The post Using The Siemens Extended Modbus Library appeared first on DMC, Inc..

]]>
DMC is Competing in the 2025 ROKathon! https://www.dmcinfo.com/blog/39611/dmc-is-competing-in-the-2025-rokathon/ Wed, 05 Nov 2025 16:13:26 +0000 https://www.dmcinfo.com/?p=39611 DMC is excited to be participating in the first-ever ROKathon coding competition at Rockwell’s Automation Fair 2025! The competition will take place over a day and a half, Monday and Tuesday of Automation Fair week, with the winning team announced on Wednesday at 2:30 PM on the Discovery Theater stage. DMC’s team of experts will […]

The post DMC is Competing in the 2025 ROKathon! appeared first on DMC, Inc..

]]>
DMC is excited to be participating in the first-ever ROKathon coding competition at Rockwell’s Automation Fair 2025!

The competition will take place over a day and a half, Monday and Tuesday of Automation Fair week, with the winning team announced on Wednesday at 2:30 PM on the Discovery Theater stage.

DMC’s team of experts will be competing against six other teams for honor and glory in a coding challenge that incorporates FactoryTalk Optix, FactoryTalk DataMosaix, FactoryTalk Analytics LogixAI, Studio 5000 Logix Designer, FactoryTalk Historian Site Edition, and Plex.

DMC ROKathon Team

Good luck to all the teams competing!

Exploring the Expo? Visit us in Booth #752

Stop by our booth to connect with our team, explore our latest automation solutions, and see our custom-built “Drop Bot” in action.

Test your skills against Drop Bot in a life-sized game of Connect Four or challenge your colleagues to a game.

Will we see you at the show? Let us know!

DMC Drop Bot
dmc rockwell automation fair 2024

DMC is a Rockwell Automation Gold System Integrator

DMC has been a proud Rockwell Automation partner since 2011 and is recognized as a Rockwell Gold System Integrator, a designation awarded to top-tier integrators with demonstrated expertise in delivering Rockwell-based solutions.

By combining Rockwell’s industry-leading platforms with DMC’s engineering excellence, we help clients achieve greater efficiency, productivity, and long-term growth.

Don’t miss the chance to connect with the DMC team at Automation Fair 2025. Register today and meet with us in Chicago at Booth #752.

The post DMC is Competing in the 2025 ROKathon! appeared first on DMC, Inc..

]]>