Overview

The TwinCAT software system is a complete automation system for PC-compatible computers, which is referred to as "The Windows Control and Automation Technology":

TwinCAT transforms every compatible PC into a real time control with multi-PLC, NC axis control, a programming environment and a control station.

TwinCAT substitutes PLC and NC controllers as well as control stations with:

  • open, compatible PC hardware,
  • programmed in accordance with the manufacturer-independent IEC61131-3 standard,
  • linking to all common field buses and PC interfaces for I/O signals,
  • embedding of PLC and NC systems in Windows NT,
  • data link to NT programs by means of open Microsoft standards (OLE, OCX, ActiveX, DCOM+, etc.).

TwinCAT unites the real time control capability with the open and world-wide largest software platform of Microsoft's Windows operating systems.

TwinCAT components

TwinCAT embraces a large number of system components which, together, constitute a complete solution for automation tasks:

Programming of PLC programs for sequential logic in conformity with IEC61131-3,

Programming of NC point-to-point (PTP) and interpolation (I) positioning in conformity with DIN66025,

Real time system for the execution of PLC and NC programs in an exactly timed (deterministic) fashion, regardless of how the PC is used for further tasks,

I/O linking for all widespread field buses and the PC interfaces and also for third-party interface cards,

Programming and data link with Windows applications ranging from visualisation to spreadsheet applications using OCX or DLL

TwinCAT real time system: Real time expansion for Windows NT

TwinCAT features a real time expansion for Windows NT for the execution of automation programs in cycles as from 1 ms timed deterministically exact with a very small timing fluctuation (jitter) of only a few microseconds. The TwinCAT real time expansion is a multitasking environment for the exactly timed control of "servers" that handle a very diverse range of tasks such as PLC, NC, PID and cam switching mechanisms etc. TwinCAT is integrated in Windows NT and, during the run time, it adds real time functions to it that are not intrinsically available in NT. The user does not modify NT for the operation of TwinCAT, i.e. it can be purchased, installed, used and maintained in the usual fashion. All properties of Windows NT are available without change during the operation of TwinCAT. The computing capacity that TwinCAT demands of the computer for real time tasks can be limited. This setting remains fixed under all circumstances. A load display facilitates adjustment for the user.

TwinCAT IEC61131-3 programming based on a manufacturer-independent standard

"TwinCAT PLC Control" is the programming environment for the PLC (PLC server) in the system: a powerful 32-bit programming environment for programs whose code size and data areas far exceed the possibilities of conventional PLC systems. TwinCAT PLC offers all languages defined in the IEC61131-3 standard. The programming environment makes it easy for programmers of conventional PLC systems to become acquainted with IEC61131-3 through the use of support tools. Its "object-oriented" structure suppresses side effects during analysis (online status display). Program and data changes are executed online in any code and the detection and remedying of errors (debugging) are supported with a very powerful link to the run time systems (servers) which, incidentally, is also network-compatible. Programs are compiled for PC and additionally for a number of mini PLC-hardware. All usual characteristics of a PLC are available.

TwinCAT PLC Server: up to 4 PLCs on one PC

The PLC server processes programs at fixed cycle times. TwinCAT starts the tasks of the run time systems in a deterministic fashion, i.e. up to 4 PLC run time systems can be run simultaneously on one PC. The run time systems, in turn, have multitasking abilities with 4 tasks each. Therefore, the PLC server offers 16 tasks in 4 run time systems, each task with its own priority and cycle time. In total, up to 32 Mbytes of program and 4 Mbytes of data can be used. The execution time on PC processors is extremely fast. I/O data is organised by the System Manager. Start and stop behaviour are identical to that of a "hardware" PLC (which, as we know, is also operated with software). PLC booting on PC startup and remanent data are supported; while Windows NT is executing a user change, the PLC continues to operate.

TwinCAT NC PTP and NC I axis control PTP on a PC

The NC server processes the motion control tasks for positioning of switched motors, stepper motors, frequency-controlled (FU) motors and servo-controlled (servo) motors. All widespread kinds of drive amplifiers (servo, FU, stepper motor controllers) and contactors can be integrated via the known interfaces. Position detection is absolute, incremental, by encoder or via the drive. The controller characteristic is defined precisely by way of the acceleration, deceleration and jerk: fine adjustment of the trapezoidal profile of PTP positioning is possible. Commissioning is supported by online menus and measurement tools help to determine the following error, for instance.

Contouring control to DIN66025

Contouring control tasks are executed in groups of 3 drives in space. They are defined and run in conformity with DIN66025.They are integrated in the PLC in a form that is similar to plain language, i.e. by using function blocks: drive control is integrated in IEC61131-3.Up to 256 axes (depending only on the PC processor used) can be moved simultaneously. Thanks to PC technology, TwinCAT's performance capabilities are constantly increasing.

TwinCAT System Manager links the world with TwinCAT

The System Manger is the system's configuration centre. The number and programs of the PLC systems, configuration of axis control and the connected I/O channels are related to one another. The System Manager links all system components and their data relations with one another, and data areas and process images are exchanged synchronously or asynchronously. TwinCAT supports all widespread field buses - even simultaneously if necessary. Thus, Beckhoff Lightbus, Profibus DP, Interbus, CANopen, DeviceNet, ControlNet, Modbus, Sercos, RS485/232, Ethernet TCP/IP and USB with a series of master and slave interfaces are currently supported. The PC peripherals (parallel and serial interfaces) and third-party interface cards are becoming available. The System Manager allows a link between server process images and I/O channels in a bit-by-bit fashion and provides tools that consecutively connect 100 channels, for example, with only one command. At the field bus and process image levels of the servers, commissioning and maintenance are facilitated by online display and by "Write and Force". Watch windows show an individual selection of variables. Diagnostic data is offered in a standard representation for all I/O devices.

TwinCAT AdsOCX integrates TwinCAT in Windows NT

An OCX software or a DLL library provides the link to Windows NT applications (ranging from visualisation through SCADA to Office applications such as Excel). The data transfer methods are defined by the operating systems market leader (e.g. DCOM+, ActiveX, OCX, OLE), with the result that the integration of TwinCAT in Windows NT is based on a very wide-ranging standard. Data transport and method exchange are organised by means of AdsOCX: Windows users can access data and functions of the automation software directly, i.e. without any further driver implementation.


Software PLC and NC on PC systems

PC-based automation systems are currently used in the form of

  • PLCs, process computers or NC controllers combined with a PC,
  • Industrial PCs with a coprocessor card for PLC/NC tasks.

Typically, PCs are not entrusted directly with control tasks. Instead, these are executed by additional processors. This structure is disadvantageous. A new approach consists of a pure software solution. That is to say, a processor runs all automation tasks in a single-processor mode of operation. Contrary to the traditional approaches, with TwinCAT a separate processor system including memory and operating system is substituted by real time-compatible deterministic processing of functions for the PLC and NC with the PC processor and in its memory. The advantages of this solution are obvious: what is no longer there can also not produce any errors.

Comparison: structure of typical PLC /NC and PC control technology

Automation with four standard components

Thus, an automation system now only consists of 4 components:

  • Industrial PC,
  • Open field bus system for I/O links,
  • Standard Windows NT operating system for the user interface (HMI),
  • TwinCAT system software "IEC1131-PLC and NC on the PC"

The advantages of this solution are:

  • almost unrestricted memory space for programs and data, constant
  • performance development for the automation task and full
  • integration in the operating system: PC resources are accessed with methods of the operating system instead of with driver software and
  • a low number of components results in high system reliability.

Software PLC and NC on the PC: the PC executes the controller

In order for the PC to execute the control task, besides the programs for operator control the automation software must be executed in the usual fashion. A "classical" PLC runs programs cyclically. Input and output alternate with program execution:

Sketch 1: Real time operation of PLC software in the classical PLC

In a software PLC on the PC, programs are run in exactly the same way as in a conventional PLC / NC, i.e. in exactly timed (deterministic) cycles, which are executed with the same length and regardless of the program length. The user interface is executed in the cycle pauses, for which computing capacity can be reserved:

Sketch 2: Real time operation of PLC software on a PC with Windows NT

The PLC, NC and user interface are executed simultaneously by "overlaying" tasks for PLC, NC and operating system tasks with a multitasking sys-tem. Each task ("server") for a specific purpose operates with its own cycle time and priority. Sketch 3 shows overlaying of the PLC, the NC and the operating system. TwinCAT ensures the operation of Windows NT together with TwinCAT programs by a special implementation integrated into the operating system:

Sketch 3: Real time operation of a PLC program and NC control with a PC


Real time without additional hardware and as a system basis

TwinCAT Realtime Extension ensures real time capability

The Windows NT operating system for the PC is not capable of real time operation: it was designed for optimised performance and not for control purposes. Tasks are interrupted by various events or their calls are delayed. The diagram shows these interruptions in a high-priority, cyclic Windows NT task:

Windows NT is not real time-compatible

Diagram: Windows NT task is not executed deterministically

Windows NT and Beckhoff Realtime Kernel Extension

As Windows NT is not real time-compatible, the operating system is extended for automation tasks: such a real time extension is the basis for TwinCAT. With a background of more than ten years of experience with PC software solutions for the PLC/NC and more than ten thousand installations under DOS, Beckhoff has developed a proven and independent real time extension for Windows NT as the basis of TwinCAT and has harmonised it with Microsoft as a system partner. In a cyclic mode of operation, 64 tasks are executed with priority control, preemptively and deterministically with a maximum of +/- 15 µs jitter.

TwinCAT is real time-compatible

With this Kernel Extension, TwinCAT has an exact time basis which executes programs with maximum priority, and independently of other processor tasks. To demonstrate this, launching of a TwinCAT task was recorded over a period of time in order to measure time deviations of the system. During this time, in which 1 million PLC cycles run, the PC is loaded with diverse tasks such as network operation, hard disk access, video display and mouse movements. The diagram shows a rising signal edge, triggered by a task, in an integrating representation that shows the time deviations (jitter). TwinCAT tasks are called up deterministically (timed exactly in 100 % of all cases) with slight fluctuations (jitter) of only a few µs (in this case: +/-12 µs), which are negligible for general applications:

Diagram: 1 million cycle starts of TwinCAT jitter by around +/- 15 µs

TwinCAT offers a compatible real time basis

The Beckhoff implementation operates without a second operating system thanks to the fact that the real time tasks have been integrated completely in Windows NT:

  • It does not require any hardware in addition to that of a standard PC (currently: Intel single-processor architectures) or a second operating system,
  • Windows NT can be purchased, installed and used without modification throughout the world, i.e. it does not require any modifications ("patches") or replacement of its parts,
  • The user does not require a knowledge of the operating system or its programming in order to run automation tasks,
  • The implementation is also compatible with future releases of NT (e.g. NT 5.0),
  • It permits the reservation of a remaining CPU capacity for Windows NT, which is observed under all circumstances,
  • Even under a high real time load, it guarantees that important NT tasks are executed and so no characteristics of NT are restricted or influenced,
  • It offers a load display indicating CPU utilisation by the automation tasks,
  • It displays the current and maximum real time jitter online and generates messages in the event of violation.

Automation solutions for practical applications

At the same time, TwinCAT does not focus on the real time implementation. Instead, it represents a complete application solution for the editing, analysis and execution of control programs in real time: no one needs to be an operating system expert to only use real time on a PC. The focus is on practical application in the field of automation.

Open programming Open I/O link Open Windows interfaces

An easy-to-use environment permits:

  • Creation of real time programs to IEC1131,
  • Execution on the same PC or remotely,
  • Analysis with modern methods,
  • Integrated interfacing to programs, e.g. visualisation applications,
  • Integrated, open and cross-manufacturer I/O link for field buses and PC hardware.


Single-processor operation: the system grows along with requirements

PLC on the PC: programming, run time and field bus as an I/O system

A PC-based software PLC has a programming system, one or several run time environments and an I/O link that is established by a field bus. A user interface is realised with visualisation programs, SCADA etc. or with a Visual Basic / Visual C program.

PLC as software on the PC

Single-processor solutions - growing system performance

The performance of software solutions for the PLC has long exceeded the performance of hardware PLCs and the measured speed has increasingly dropped with every new PC processor. For example, now only 15 µs is needed to execute 1,000 PLC commands on an Pentium III 600, thus "undercutting" a high-speed hardware PLC CPU by more than four.

Comparison: Execution times of hardware PLC and TwinCAT PLC

Very wide system boundaries

However, not only speed, but also system boundaries, no longer pose a restriction on the PC: in practice, program size, flag memory and the process image size no longer leave any wishes unfulfilled. The practical boundaries of PC technology are far wider than those of previous PLC hardware: In the 32-bit world of PC technology, PLC programs with a length of 32 Mbytes and with 4 Mbytes flag memory, combined with 64,000 inputs and outputs, are easily possible.

NC on the PC: Positioning on the PC and field bus as an I/O system

A PC-based software NC features a positioning capability (setpoint generation, position controller), an integrated PLC with NC interface, operator control programs for commissioning and an I/O link for axes that is established by a field bus. Data for the position controller is exchanged during the cycle via the field bus to the drives and from the measuring systems; the position controller is computer in the PC's processor. As in the case of PC PLC system, a user interface is realised with visualisation applications and SCADA, etc. or with a Visual Basic / Visual C program.

NC as software on the PC

Central NC positioning in the PC processor

Thanks to the performance of the PC, it is possible to move drives with a PC simultaneously to the PLC task and, in doing so, the position controller is computed in the PC's processor: with computing times of less than 25 µs per axis (with a Pentium 200), a few dozen axes can easily be positioned simultaneously.

Depending on the number of axes and the chosen cycle time, TwinCAT is capable of executing the operating control programs, the PLC and the NC simultaneously. TwinCAT supports system load design with load display tools.

System boundaries are constantly expanding

The most important item of news, however, is that these boundaries are constantly expanding, i.e. "the controller is growing along with requirements" by virtue of the fact that it is simply realised as software on a standard PC and automatically undergoes the same performance developments.


PLC and NC as software devices

PLC and NC as devices in the form of software

Thanks to TwinCAT's system architecture, the individual parts of the software can be looked upon as representing independent devices, i.e. there is one software module (a "server" or a "client") for each task. The servers in the system are the working "devices" in the form of software which, as far as their operating behaviour is concerned, correspond to precisely one hardware device. Therefore, we can speak of "virtual" devices in the form of software. The "Clients" are programs that request services from the "Servers", e.g. a visualisation application or a "Programmer" in the form of a program. In this way, TwinCAT is able to grow by virtue of the fact that increasingly new servers and clients come into being for tasks such as the cam switching mechanism, the oscilloscope or the PID controller etc.

TwinCAT architecture

The TwinCAT system consists of servers (run time systems) for the real time execution of programs and the program parts for programming, analysis and configuration of the system. All Windows programs, for example visualisation applications or Office products, can access TwinCAT data or can control servers via Microsoft interfaces.

Diagram: TwinCAT software structure


Operating response for practice

TwinCAT is "suitable for practical applications"

Against a background of more than ten years of experience with PC software solutions for the PLC and the NC and more than ten thousand installations under DOS, Beckhoff has placed value on a proven and practically suitable behaviour of TwinCAT. Thus, a series of characteristics is available which, in total, ensures that this software solution can be used to completely substitute a hardware solution. Many of its properties are self-evident and indispensable for users and it is particularly for this reason that users must be sure that these features are also available in software solutions.

Start / stop response

Depending on the setting, TwinCAT starts and stops by manual operation or automatically. As TwinCAT is integrated as a service in NT, no operator is needed for starting: it suffices to activate the power.

The PLC can be stopped

  • manually,
  • automatically when Windows NT is stopped or
  • by user programs.

For data backup reasons and to ensure correct termination of Windows NT, it is advisable to use a UPS (uninterruptible power supply) with a short backup time of a few minutes to shut down the PC control.

Restart with program

Just like a conventional programmable controller, TwinCAT is able to load and start programs after restart. These programs ("boot programs") are started before user programs to ensure that they always find an initialised and operable PLC and NC controller. It goes without saying that programs can also be loaded via a network.

Remanent data

With the boot programs, remanent (persistent) data can be loaded automatically on restart. This data is automatically backed up to the hard disk when the system has stopped. The programming environment supports easy use of remanent data at the click of a mouse or with a key word for a variable.

System status by flag

The TwinCAT severs for PLC and NC have system flags to represent and query their status (restart or number of PLC cycles etc.), which can be used for system control and to program startup behaviour.

System statuses are documented in the event logger

The system status and all status and error messages are documented in the Windows NT event display. Thanks to TwinCAT integration in Windows NT, access to these is easily possible using NT management tools.

Cycle time and system load

The execution times of the programs on a PC are set with the programming system, thus achieving a defined operating response. The TwinCAT system displays the system load for executed programs. A load limit can be set so as to ensure that a defined computing capacity is available for the operator control programs and Windows NT. A system message is generated if this limit is exceeded.

TwinCAT continues to operate even after user profile changes

The Windows NT user can change while the TwinCAT servers are operating, thus ensuring that operators and service personnel have different access to programming systems and maintenance programs. TwinCAT integration permits user management with the Windows NT mechanisms and security standard.

TwinCAT support system analysis

Thanks to large-scale integration of components and more than adequate performance of the processors, the PC architecture fundamentally offers a platform that is suitable for general automation tasks. On suitable hardware, stable real time and Windows NT operation can be guaranteed. The price for the openness of the PC world, however, is that this criterion has to be checked when using hardware (example: graphics cards) or drivers. This restriction does not apply to Windows or TwinCAT, but to all operating systems. That is to say, owing to the use of unallowed methods, unsuitable hardware and software can cause problems for the operating system. This is why all operating systems restrict the installation of critical (kernel mode) drivers. Beckhoff integrates a practical display of real time jitter into its product to provide an administrator with a simple means of evaluating hardware and software. During operation, a system message can draw attention to error states.


Connection by message routing

"Remote" connection is system-immanent

TwinCAT's software devices can be distributed to equipment depending on requirements: TwinCAT PLC programs are capable of running on PCs and of Beckhoff Bus Controllers (mini PLC). A message router manages and distributes all messages in the system and via TCP/IP links. The internal protocol is based on TCP and operates in accordance with the "Automation Message Specification" AMS. PC systems can be linked in this way- Bus Controllers are linked via serial interfaces and field buses (Beckhoff Lightbus, Profibus DP). Thus, all TwinCAT server and client programs are able to exchange commands and data, to send messages and to communicate status information etc..

Worldwide access

As NT uses the TCP/IP services, this exchange of data can take place throughout the world and so a centralised and decentralised architecture can be realised for all automation tasks (see sketch).

Hierarchical control architecture: centralised or decentralised

Sketch: Distributed control architecture with TwinCAT on the PC and bus controllers

A PC is determined by means of its TCP/IP address and the message router's "AMS Net Identifier":

Message routing via TCP/IPCOM PortField bus

Thanks to the message routing system, centralised or decentralised systems can be addressed for both PC systems and bus controllers. The transmission circuits consist of TCP/IP links, serial channels or field bus systems. The system offers scaleable communication performance and timeouts for monitoring communication events.


Interface to Windows applications

Data connection based on Microsoft standards

TwinCAT integration in Microsoft operating systems allows the use of PC resources (hard disk, network, graphics and interfaces, etc.) with the methods and through the interfaces of the operating system. At the same time, the exchange of data between real time software for automation purposes has to perform certain tasks

  • Synchronisation with the operating system,
  • Adaption of data representation (data alignment),
  • Guaranteeing data consistency in the event of access.

A data interface must above all

  • fulfill the requirements of automation,
  • ensure full integration into the operating system.

Full integration allows the use of standards

With the approach of full integration into operating system methods, compatibility for the use of automation software by all Windows programs is guaranteed, i.e. a typical Windows application can be linked directly with automation programs.

OLE, DCOM+, OCX: Microsoft standards

The modern methods for the use of software technology go by the names of COM, DCOM, OLE, OCX and ActiveX. Describing them fully would fill volumes. On the basis of OLE (Object Linking and Embedding) technology, with COM (Component Object Model), a tool was introduced to enable an exchange of data objects between programs in a standard fashion, i.e.: OLE allows a Word application to display an Excel table. The improvements in OLE lead to a solution to the general problem of how to use data of an external program and its representation methods (in this case tables, for example) in another program (COM). COM-based data exchange allows access to objects and their data through defined software interfaces and methods. With DCOM (Distributed COM), this also functions between computers in a network. To enable the use of these technologies in controls (applications), OCX (OLE Controls) and ActiveX (OCX with Web expansions) were introduced to expand the existing concepts of COM technology and to reformulate them. OCX and ActiveX are components that are installed very easily and which then offer data and methods for programs. Therefore, there is no need to write drivers.

OCX automates linking of programs

Nowadays, most programs use OCX interfaces, which enable wide ranging automation of software linking. A large software market for OCX and ActiveX components, which can be integrated into users' own software applications, exists.

TwinCAT interface also available as a DLL

For other applications, the TwinCAT interfaces are also available in the form of a DLL (Dynamic Link Library) and can be integrated.

TwinCAT OCX interface operates via message router

The data link to TwinCAT servers is always established via the message system. In this way, Windows applications can not only operate with local servers, but can also exchange data worldwide with all logged-in TwinCAT servers. The message router ensures an exchange of data even with re-mote servers on other PCs or field devices.

Windows applications access TwinCAT via the message router

Interface for program applications

To be able to use Beckhoff TwinCAT technology, it does not suffice to simply establish a simple data link to visualisation applications: A complete interface for programming languages (Visual Basic, Visual C, Delphi, Java...) not only offers "simple" tags to I/O data, but also full access to methods of the PLC / NC one time servers (starting and stopping and program loading etc.)

Beckhoff ADS OCX offers access to data and methods of the servers

TwinCAT OCX organises the exchange of data

Beckhoff OCX organises the exchange of data between TwinCAT and Windows applications. It includes:

  • Access by variable name,
  • Timing synchronisation with the operating system,
  • Adaption of the various data types,
  • Blocking of data to enhance system effectiveness,
  • Adaption of data representation (data alignment),
  • Guaranteed data consistency during accesses.

Access methods:

- synchronous- asynchronous- cyclic

The access methods allow synchronous access by Windows applications to TwinCAT servers: Windows applications "wait" for the result of a query. Alternatively, asynchronous or cyclic access is also possible.

Access methods:

notify on change is the optimum

The generally most advantageous method of data exchange is the "Notify on change" method: it forms a generic set of asynchronous and cyclic links and only generates activities when a data item really changes. To limit the system load for data exchange, it is possible to set a minimum data transfer cycle time.

Integration in NT: new applications become possible

Thanks to integration and complete use of the Microsoft data interfaces, the Windows software application is becoming available for automation technology. New applications will arise from the fusing of information technology with automation technology. Solutions for users can be combined easily. TwinCAT supports these new applications by complete integration of the interfaces in the COM model and its enhancements.


General questions regarding PC control

Are PCs as reliable as PLCs?

In comparison with PLCs, PCs are now manufactured with a very much smaller number of components and connectors. That is to say, PC systems feature very much larger scale integration than PLCs. The number of components detrimentally influences reliability in a linear fashion, which is measured by way of the MTBF (Mean Time Between Failures). Therefore, PCs can basically be just as reliable or even more reliable than PLCs. PC systems must be manufactured so as to ensure that their application areas and their ambient conditions are specified. Specified industrial PCs are now available for a very large number of environments.

Hard disk as a rotating medium - marginal conditions?

Rotating mass storage units are nowadays very reliable: the failure rate of robust models in practical use is very low. In special applications, for example in vibrating environments, use can be made of flash RAM disks. Versions of Windows NT are also available for the RAM disk. Beckhoff offers corresponding versions. Is Windows suitable for automation? Windows NT is not deterministic and, in this sense, is not suitable for automation. Nevertheless, the reliability of NT is good and its architecture and capabilities are a good basis for applications in the area of automation (NT's developers had experience with DEC - VMS). The GUI (Graphical User Interface), information processing and communication in automation can be processed very well with Windows NT. On the basis of Windows, users have a choice from the largest available software platform in the world, and applications can be tailored very swiftly on this basis. Excel, Visual Basic, C++ or Windows applications are linked to TwinCAT real time applications via OLE links.

Can PC technology guarantee 10 years replacement?

The "PC standard" has already been existence for a very long time and old programs can still be used today. Contrary to conventional technology, where individual manufacturers had to guarantee 10 years delivery, and whenever manufacturers were not able to deliver, investments were lost. Users can now purchase from a whole series of sources. As the PC standard is used by a large number of companies, not only is delivery a sure thing, but also rapid enhancement of the technology in the form of compatible devices. Function compatibility can be guaranteed. Software investments are protected in the long term. Nevertheless, users can only be sure provided they are not dependent, e.g. on a special add-on card. Only the pure single-processor solution realises all functions in the form of software, thus ensuring that fundamentally any compatible hardware can be used.

What happens if the PLC stops?

As with every usual hardware PLC also, the I/O system used determines how the outputs behave: Beckhoff I/O features watchdogs for control of the bus nodes to ensure that they assume a failsafe state. Nevertheless, for every programmable controller involving software intervention (i.e. for PLCs just as much as for PCs), it is important to ensure that functions that are relevant to safety be safeguarded with independent facilities that conform to the usual technical specifications (emergency stop and access control).

Is NT real time-capable?

Within the meaning of "hard" real time (deterministic within the µs range): no. NT was designed for optimum performance and not for deterministic processing. The typical latency times of the NT Scheduler are real time-capable for slow processes, but not for typical automation and drive solutions (cf.: Realtime Systems with Windows NT, Technology Brief, Microsoft Developers Network, 1995)."Hard" real time capability in the µs range which is adequate for the aforementioned applications, is achieved by means of a second scheduler. This scheduler is an extension of the kernel, with the result that TwinCAT programs are integrated fully in NT and its interfaces.

Is NT modified when TwinCAT is installed?

No: TwinCAT's architecture allows integration in the form of a kernel mode driver (.sys) without modifying NT. This is particularly advantageous because NT does not have to be modified here (patched). The latest respective version of NT can be purchased worldwide from a Microsoft sales channel and can be used throughout the world.

Why is a PLC deterministic and can a PC also achieve this?

A PLC is none other than a microprocessor system with a proprietary operating system that operates in a deterministic fashion. In any case, a PC's performance is high enough to process a deterministic "kernel" together with the operating system, and the technology lies in neat implementation.

Does a TwinCAT PC operate as reliably and deterministically as PLC?

Yes: the PLC task call by TwinCAT's NT Kernel Extension is just as deterministic as in the case of a PLC. The reliability of the system is guaranteed by stable and industrially suitable hardware.

What happens if NT is "starved" by a load?"

The processor's computing capacity is shared by TwinCAT and NT, and the limit is adjustable. Nevertheless, TwinCAT only occupies the imperatively required capacity and returns free capacity to NT: In this way, neither NT nor TwinCAT can occupy 100 % of the processor, thus forcing the other respective system to its knees.

How is the real time setting adjusted and how are load violations noticed?

In the system settings via the task bar, it is possible to set the real time load limit and this is where the current load is also displayed. Violations of the load limit lead to a situation in which the PLC programs are not completed in good time before the next call, the result being that a cycle call is executed with a "delay", and the cycle timeout is indicated by names of a system flag, and a reaction can be programmed. A message can be generated for Windows applications. Additionally, any PLC program may need an execution time longer than the configured cycle time (see task settings): the cycles will be executed in a time cycle longer than the configured one: The missing of the scheduled cycle is indicated in the system flag memory: a reaction can be programmed, a message for windows programs may be generated.

Can the real time display and setting be deactivated?

Yes: in the Registry, there is an entry that influences the system popup menu.
[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\System]"SysPopupMenuType"=dword:00000000
When SysPopupMenuType = dword: 0000 0000 is set, the user has a restricted menu.

Can the PC interfaces be used in TwinCAT?

Yes, but not simultaneously with the operating system.

Can existing field bus I/O be linked? How?

Existing field bus systems can be linked easily: TwinCAT is linked to the field bus system by means of a master card for the field bus in the PC. TwinCAT currently supports a whole series of field buses and master cards.

Can position control and PLC and an operator control program be operated on one CPU?

Yes, TwinCAT organises both task processing for position control and also for PLC and Windows NT processing simultaneously. The power of PC processors permits processing of all tasks in one CPU and the system load display provides an indication of CPU loading by the PLC and axis control.

Do users have to bother about task synchronisation and communication?

TwinCAT organises the exchange of data between tasks consistently and both synchronously and asynchronously. The System Manager is the tool for setting the exchange of data between tasks.

How are real time programs debugged?

The TwinCAT IEC1131-3 compiler permits a powerful analysis of programs in 5 different programming languages with sequence control and variable analysis and a data trace is also available. It is possible to integrate C functions whose I/O data can be analysed by variable analysis and a data trace.

Are there are hardware or software incompatibilities?

No hardware incompatibility between TwinCAT and compatible single-processor boards is currently known. Nevertheless, defective kernel mode drivers that have a detrimental influence on Windows NT may also have a detrimental influence on TwinCAT, one typical example being graphics card drivers. Kernel mode drivers can only be installed by the administrator. TwinCAT also offers a jitter display to identify such drivers.

When does the PLC execute a cold start and when does it execute a warm start?

As in the case of a conventional PLC, TwinCAT can execute a cold start with variable initialisation or a warm start (stop -> start) without initialising variables. When the computer is switched on, the start program is loaded and is started automatically when the "Boot" option is selected. If variables are to be backed up, they can be created as remanent data.

Are dynamic variables available?

First of all, local variables can be created which are only available in one instance. PLCopen is considering the introduction of dynamic variables. Variable configuration for I/O addresses that have been specified completely is available. There are (still) no pointers.

What are VAR_IN_OUT variables?

VAR_IN_OUT variables are communicated as pointers and so there is no need to recopy data into and out of an instance. Located boolean variables cannot be passed on as VAR_IN_OUT.

A 5000 x 10 array has been created. Only around 16,000 values have been indicated in the status display?

The debugger system has data analysis limits and the monitoring buffer size has been exceeded.

Are there limits to the size of variables, e.g. arrays?

There is a restriction to 64,000 bytes per variable, but this will be dispensed with in the future.

IEC1131 does not mention pointers. Are there nevertheless pointers? If no, what are the alternatives?

There are currently still no pointers. With Release 3.0 of TwinCAT, pointers will be available in ST. With the use of pointers, no guarantee can be pro-vided for correct operation of program compilers and users bear responsibility themselves.

Is there a possibility of structuring the validity of variables ?

Local and global variables can be created.

What language can be used for what purposes?

There is no clear approach, but recommendations can be made, i.e.:· ST for algorithmic calculations,· FBD for program calls,· LD for interlocks, for example,· SFC for step-by-step sequences. The typical applications for language elements depend on the common language element usage patterns.

What programming language is the fastest in execution?

Test results were:100,000 times And combination in STL = 76ms100,000 times And combination in ST = 74ms1,000 times FOR loop 0 to 99 in STL = 38ms1,000 times FOR loop 0 to 99 in ST = 40msST is slightly (but only negligibly) faster than STL because no additional code needs to be generated here for sequence control. Code generation is very good and it can be expected that no faster code can be generated with C. Moreover, code written in C cannot be analysed in the PLC control. SFC and LAD are not very much slower than ST.

Can variables of the PLC be accessed via OCX? What does such an access look like?

The variables can be accessed with a diverse range of mechanisms (synchronous, asynchronous or on change etc.). A collection of examples with TwinCAT can be installed. Here, all functions are shown by way of example (visual basic only).

Is every part of the programming system accessible via OCX?

OCX provides access to variables and methods of the servers. All variables (local and global) and all types (elementary and structured) are accessed, and all of these can also be accessed symbolically or by an address.

Is there a possibility of indexed editing of direct addresses (MW)?

Bits of a word or byte can be accessed. For example, %MW1 has the bits %MX1.0 to %MX1.15.

The data trace functions as a ring buffer with pre and post triggers. What can be set?

Currently, 500 or more entries are possible for each variable (depending on the variables to be traced). The ring buffer is no longer written when a trigger event has occurred. The buffer can then be read out and can be saved as a binary or ASCII file. During recording, no new variables can be traced, but the display can be changed over at any time (up to 20 variables, including 8 in the display). The shortest sampling time is the cycle time of the task, i.e. recording is cycle-synchronous. It is possible to define what percentage of the maximum possible data before and after the trigger event is to be in the ring buffer.

FB status display: How can an FB (multiply used) be displayed in the status for a special call?

You can analyse an instance of an FB under 'Project', 'Open instance'. TO do this, the cursor must be on FB in the object directory (left window). When the instance is selected, the call hierarchy is also displayed.

After what program changes is a cold / warm start necessary? When a cold start is run, VAR_RETAIN are deleted. How can setpoints in the PLC nevertheless be saved?

A cold start with new code generation is necessary after modifications in the task configuration or following a modification in the library manager (adding or deletion of libraries). Retain data is not saved until after the TwinCAT system has been stopped and is only loaded again when Twin-CAT is started (when a boot project is run). In the event of a cold start without a restart of the TwinCAT system, the system continues working with initial data. Setpoints can be withdrawn from the PLC by means of a watch list (better: recipe list) and can be loaded back into the PLC at the push of a key.

Are there partial compilations or does the whole program always have to be compiled?

When "Rebuild all" is selected, the complete project is recompiled. If an online exchange takes place, only the modified code is generated and loaded. After Rebuild all, online exchange is no longer possible. The code must be loaded completely and the system must be cold started.

What happens if the PLC program does not finish within the set task time?

There is a system flag area in which the status of the system is repre-sented. Violations of the load limit lead to a situation in which the PLC programs are not completed in good time before the next call: a cycle call is executed with a "delay". The cycle timeout is indicated by a system flag and a reaction can be programmed. A message can be generated for Windows applications.

The 'additional task 's' is located under the I/O configuration.

These tasks are used by customers who want to scan fieldbus I/O without using programmable logic control.

What does a time-optimised, calculable data exchange between TwinCAT systems and two PCs look like?

Data can be exchanged between two TwinCAT systems on two PCs using TCP/IP. The exchange takes place asynchronously with respect to the cycle and depends on the network load - a local area network is advantageous for this purpose. For TCP/IP links, there are the ADSWrite and ADSRead function blocks for the exchange of data. An exchange via a field bus is also possible, in which case one PC is the master and the other is the slave.

Can NT with TwinCAT on a multiprocessor system be split up over 4 processors?

This is basically possible, but is currently not supported.

What precisely happens in the event of online changes? What program is changed?

This method allows changes while the PLC is running. In the event of on-line changes, the delta code - i.e. the last changes - is generated and this code is loaded into the controller (into the run time system) after login and is stored there. If you now wish to activate the changes, the code is "appended" at the end of the currently running cycle. As the code now exists twice, the memory is reorganised during the next cycles (garbage collection).