Blog

Building an Ignition v8.0 Perspective Module Application to Control a Model Railroad

Building an Ignition v8.0 Perspective Module Application to Control a Model Railroad

Every year or so, DMC hosts a FedEx Day, where employees work on fun internal projects and deliver them in a day. In 2019, Inductive Automation released the newest version of their Ignition HMI/SCADA platform, Ignition 8, and with it came a new module called the Perspective Module. This module adds a lot of great new features to Ignition’s already powerful HMI screens, and we thought FedEx Day was the perfect time to test it out and work with the new, exciting platform. 

The team for this project consisted of Jay and Zack from DMC’s Denver office, and Paul from DMC’s New York office, all of us DMC systems engineers and Ignition developers. When planning the project, we knew we wanted to have a physical system to control, and because Paul grew up as a model train nerd, we thought it would be fun to build a train layout, add some useful inputs and outputs, connect them to a PLC (we are an industrial automation company after all), and control the entire system from Ignition.

Ignition Perspective train layout
Bird’s-eye view of the train layout and four reed switch locations

Building the Railroad

We started out with a simple train set we found online consisting of a DC power supply, a loop of track, a steam locomotive, and some freight cars attached. We then put on our engineering caps and added some extra functions that you can’t get out of the box, including:

  • A speed controller to vary the track voltage (and the train speed) that was supplied by the train set’s DC power supply
  • Relays to invert the track power polarity and reverse the train
  • Magnetic reed switches embedded in the track to provide position feedback from the train
  • A magnet on the locomotive’s tender to trip the reed switches as the train moves around the layout
  • A flashing crossing signal near the grade crossing

Once that was installed in the track, we were ready to wire all of our IO into the PLC and really crank up the nerdiness (coolness) on this train set.

Controls for Ignition Perspective Train

Ignition Perspective rain Set Elements

Automation Controller (Siemens S7-1200)

To control the system, we chose a Siemens S7-1200 series PLC, a simple and powerful controller that had all the digital and analog IO we would need right out of the box, along with a programming environment that DMC is very familiar with, Siemens TIA Portal v15.

Since we were using hobby-level hardware with an industrial controller, we used an optically-isolated signal converter to step down the 24v signal voltage from the PLC to the 5V that the relays expected. Once we had all our circuits wired up, we were ready to get started!

We then wrote some PLC code using Portal v15 to control the train. The code had three modes for train operation, as well as some parameters for the crossing signal and some setup to make it easier to interface our controller with Ignition.

Control Modes
1. Manual Mode: The user specifies the train's direction and speed, and then selects start/stop.
2. Auto Loop Mode: The train stops at selected stops along the track for user-selectable durations of time.
3. Go-To Mode: The system moves the train to the selected location, stops the train, and returns manual control to the user.

Crossing Signal
1. Timed Mode: The signal stays on for a user-selectable amount of time after approaching the signal.
2. Absolute Mode: The signal turns on as the train approaches and waits for the train to clear the crossing before turning off the signal.

SCADA Interface Considerations
1. All the tags needed to control or communicate feedback to/from the system are stored in a single data block on the PLC that Ignition can be pointed at.
2. This data block is buffered to our actual control and status variables at the start and end of every scan to avoid changing control values mid-scan.

Ignition Perspective Module

In 2019, Inductive Automation released a new version of its Ignition SCADA platform, Ignition 8, which included a number of new features. Notably, the Perspective Module provides browser-based clients for interacting with Ignition. This new module allows for flexible clients that can be built for a variety of screens and require no additional software other than a web browser. We wanted to give this new module a try, and thought that this demo would be a great way to explore and demonstrate one of the newest features from one of the leading SCADA applications.

Ignition Perspective Railroad Control Panel

By taking advantage of Perspective’s built-in components, we were able to put together the entire screen in only a few hours. The screen is comprised of four basic views: Train Control, Automatic Control, Flasher Control, and a view to display feedback from the most recently pinged stop on the track. Without much configuration, these views scale well on a normal HD monitor, and by default, the sizes flex to fit a number of screen widths.

Ignition Perspective Train Set Control PanelWe were also to create a more mobile-friendly screen in a matter of minutes by taking the views we had developed for our desktop-oriented client and adding them to a carousel (one of the new components added to the Perspective module). The Carousel allows users to quickly swipe through the same control screens we already designed in an easy, intuitive way.

GIF of Ignition Carousel

In Manual Mode, the user can select the train’s direction and speed, as well as start/stop the train. We were able to put this screen together with only a few simple components: Multi-state buttons, labels, a slider, and an LED Display.

GIF of Manual Mode in Ignition Perspective

The Automatic Mode View allows the user to select stations for the train to stop at as well as how long to dwell at those stops for. Additionally, the user can tell the train to go to a position and then stop there from that screen. That screen is also built simply and quickly using Perspective’s built-in components.

Ignition Perspective Automatic Control

The Train Control screen also features a readout for the mode of the train, which updates in real time to reflect the operating mode of the train. Building components is made simple by using one of Ignition’s core, foundational features: a powerful and flexible tag and property binding structure. In this case, we used a simple expression binding to map the Control Mode tag from our PLC to a series of string values. 

Ignition Perspective String Values
 A simple switch statement that allows the user to quickly turn a status integer into a string value to display the operating mode

This could also have been accomplished using another new feature built into Ignition 8, Transforms. Transforms give developers added capabilities to turn a value from a binding into any number of useful properties, and make it even simpler and quicker to make components dynamic in your Ignition Project. We used a Map Transform to change the background color on our Mode Display.

Ignition Perspective Tag Binding
A simple Map Transform to map the operating mode of the train to the background color of the mode display component. Notice that when the Output Type is set to Color, Ignition automatically provides a series of color selection tools.

GIF of Auto Mode in Ignition Perspective

Whenever the train is in motion, there is also a status view that shows the most recently pinged stop along the train track. To build this display, we spun up a couple of quick custom images to display the location of the train. Since Perspective also allows custom images, we were able to quickly build a simple animation using our own graphics of our system. This feature is also useful for building specialized displays. For example, if you had a complex graphic of a custom system component or piece of hardware, you could easily drop it into Ignition Perspective and animate it using the powerful image tools.

GIP of Status on Ignition Perspective Railroad

Conclusion

Overall, using the Ignition Perspective module, we were able to quickly and easily create a set of powerful and good-looking HMI screens for our model railroad. Ignition Perspective provided us a full catalog of visual components, a powerful binding system to connect them to our PLC tags, and a thoughtful new set of tools to arrange the components to be flexible and compatible with a wide array of screens and devices. Additionally, because Perspective is browser-based, we were able to run the control panel without installing any additional software, and share the page easily to peers in our office by just sending them a web link.

Learn more about DMC's Ignition expertise

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts