Taking the time out of Function Blocks

22 February 2021

Charlie Walker explains how software tools are speeding up the creation of IO-Link Function Blocks to enable the capture of more valuable process data from machine controllers. 

Problem-solving is an almost daily activity on any food manufacturing line and the ultimate enemy of this task is time. While an engineer’s focus may well be on maintaining product quality, avoiding waste and keeping the machinery running, all of these things depend on having the agility to fix problems quickly, or, better still, to stop them happening in the first place.

Food production and packaging halls are sometimes imperfect places – sensors must be wiped periodically; a roll of packaging artwork may need to be changed; contrast marks can stray out of alignment; multi-coloured or transparent films can require frequent device resetting.

This is why so many engineers are seeing the benefits of switching to using IO-Link sensors – sometimes teamed with integration gateways to open up a window to a wealth of diagnostic data –set pre-warnings or to enable acceptable limits that avoid unnecessary stoppages.

Capsules of code
Anyone looking to configure IO-Link devices into their applications in this way will need to use Function Blocks. These useful tools are capsules of code that simplify PLC programming and can even replace hardwired physical components for common tasks like timers or counters. Using Function Blocks makes it easy to auto-configure all your sensors at once – for example to switch to new settings when a new batch is detected coming onto the line.  Instead of having to teach each sensor separately, the PLC is set up to communicate with every device in the same, streamlined way.  

Then, your system can be more easily set up to adjust on the fly to contamination on the sensor, and to send out an alert well before there is any reduction in detection reliability.  It could adapt automatically to variations in colour or contrast marks on packaging artwork.  It can also alert to a badly-printed roll, before a large amount of product is wasted.

However, for most engineers, especially when programming is not their full-time job, creating Function Blocks is tedious and time-consuming but unavoidable. To create a Function Block, an engineer will write some code and specify the inputs and outputs to that set of instructions. This may include some other functions that already exist within the programming environment.  Then, the whole thing is compiled into a library, along with any other supporting files that help it to work. Once it has been fully tested, the function can be called on repeatedly by the PLC without needing to repeat the base code.  

The Function Block must be fully documented so that anyone who uses it later also understands its purpose and how it works. You might invest many hours, and even days, depending on the task in hand and the complexity, to write and test Function Block functionality.  Even then, you still need to create the library and document the block.

The good news is that software tools are now being developed that can quite literally ‘manufacture’ Function Blocks in a matter of minutes. IO-Link Function Blocks and device data can be integrated into a wide range of common PLC control systems. As a result, the scope for introducing new IO-Link integrations is opening up on food production lines – all without the possibilities of errors creeping in and being repeated.   

You don’t need to be experienced in IO-Link and there’s no need to start searching for parameters, indexes and data formats. You can follow a step-by-step process in a web-browser dashboard and create a fully-tested function block ready to use in your code. You can download a library with all the software you need to install the Function Block as well as the full supporting documentation.  

Imagine a production line, where there is a conveyor system with hundreds of diverter stations. You may want the sensors at each station to be used in very similar ways. Using a function block ‘factory’ gives us a chance to create the control code very quickly for all the sensors, while still having the ability to tweak each one’s exact operation, depending on the inputs selected. 

Function Block factory
SICK’s Function Block Factory is believed to be the first web-based service of its type that enables users to create function blocks automatically for most common PLCs.  It will work for any IO-link device with an I/O device description (IODD), no matter what the device type or its manufacturer.

To create a Function Block, users simply sign into the web service, select the IODD file for the IO-link device and the chosen PLC system. The name of the Function Block can be edited to suit your naming conventions. Then, the IO-Link parameters and key features of the Function Block are selected. With a click to finish, and an easy e-cart payment, the Function Block is ready to go.

The function block created can be used to read and write parameters and service data for any IO-Link device. It handles the entire acyclic IO-Link communication including data interpretation, index and sub-index resolution as well as byte-swapping, if required. 

As part of the library provided, the data structure already contains all required variables, so the need for manual variable declaration is eliminated.  The scope and content of libraries can be defined individually through free selection of the available device parameters and can be adjusted at any time.

In addition, process data parser functions can be generated, simplifying and speeding up PLC programming considerably, as well as helping to avoid errors. The process data parser function makes it possible to systematically access any individual piece of information in the IO-Link process data, without having been previously informed of its structure and contents from manuals. 

New horizons
The ability to create Function Blocks quickly and reliably invites food and beverage manufacturers to widen their automation horizons with IO-Link.  Time is no longer a barrier to building in more monitoring, pre-warnings and alarms into existing machinery. With the ability to release a host of useful maintenance and service data, the machinery keeps running while you to get on with your real job. 

Charlie Walker is a smart sensor specialist at SICK (UK).

Contact Details and Archive...

Print this page | E-mail this page