Table of Contents

Creating a Demo Solution with one Unit

In order to be able to test some things with the Zeugwerk Framework, the most common and fastest way is to create a Demo solution with one Unit and integrate there the Equipment or Sequences you want to test.

This tutorial will guide you through the basic steps on how to create one simple solution with one unit and will show you some of the key concepts how to use this.

Later on, there are more tutorials where you can see how to integrate equipment into this Test-Application like inputs, outputs, actuators or axes.

Create an empty solution

The first thing we have to do is, to start the TcXaeShell and create a new Solution. We name this solution TestSolution and add a new PLC project with the Zeugwerk Application Template which we also call TestSolution.

Now lets install the latest libraries. This feature is available for Zeugwerk Creator Pro and Community Edition (CE).

Create a Unit with Creator Pro

After a successful installation lets add a Unit where we can add the equipment which we want to test. We name this Unit TestUnit and want to create an Instance directly. By clicking on OK, the Unit is created and all necessary communication structures, data structures and function blocks are created.

There are mainly 4 important folders which have the following contents:

  • _Com: Here are all necessary communication structures placed which are used inside the unit to communicate or get commanded by the outside world. Every equipment object (input, output, actuator, ...) has a separate entry here which can easily be read or written by a HMI or in online mode. It is very important to differentiate between actual working code inside your PLC and communication structures. If someone wants to add some communication things they should be placed/instantiated here
  • _Data: Several data structures which are used inside the unit. It is hierarchial structured and those three structs (Calibration, Config and Machine) are a first glance of how this can be done
  • _Equipment: Here are all function blocks placed which have equipment objects instantiated. Main equipment types are inputs and outputs, actuators, axes and fieldbus. Also the initialisation is done here
  • _States: Every Unit has its standard statemachine instantiated and for every active state there is one sequence created here. Read through this documentation in order to get a deeper insight on how this statemachine works.

There is also the Unit function block itself where all the things which we discussed above are instantiated and a interface which can internally be used by the application to command the unit.

To test if all is working till now lets try to Build this solution by right clicking on the PLC node and select Rebuild.

In order to be able to test all next steps lets check if the Application is already running and ready for further steps. Open ZModuleProgram PRG and look for a logger instance. Under filePath enter a valid location where the logfile should be created and select a target where it should be written. For Twincat Runtimes it is necessary to have a valid AMS-Route to this target in order to let the logger work properly. Now select a valid target where we can start this test application (also here, it is necessary to have a valid route to this target). Activate the PLC and log in and click on Run PLC. To be able to see what is happening, start LogExpert and open the log file which should now be created.

In our sample configuration we have an industrial PC in the local network where the runtime is running and the logfile is created locally on the engineering PC. Another method to run test solutions on Twincat is to start a Usermode Runtime, for this look at our tutorial here.

This Unit does not do anything than booting till now, which can be seen in the logfile. It starts the boot sequence which is initializing the empty equipment function blocks and then switches to Init state.

From this point on you can switch to our next tutorials like:

  • How to integrate a Stepper axis (Creator Pro)
  • Integrate Inputs, Outputs and similar objects (Creator CE)
  • Integrate Actuators (Creator CE)