Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Beckhoff TC3.1 und Interfaces

seehma
2013-09-02
2013-09-09
  • seehma - 2013-09-02

    Hallo Leute,

    Wir setzen seit einiger Zeit auf das Produktspektrum von Beckhoff (TC2 und jetzt TC3) und sind jetzt auf die neue 64Bit Variante von Twincat 3.1 umgestiegen. Um hier auch alle Möglichkeiten des Sprachumfangs auszunutzen haben wir uns ein Basissystem aus einigen Librarys mit OOP Ansatz gebaut und dieses wird jetzt in einer ersten Maschine eingesetzt.

    Das Problem ist folgendes: Wir haben eine Art Achsenlibrary gebaut mit der wir dem Programmierer ein einheitliches Interface auf eine motorische Achse geben wollen. Er soll sich nicht mehr darum kümmern müssen ob im Hintergrund ein Rexroth Antrieb oder ein Schrittmotor fährt, sondern greift nur über dieses Interface auf die Methoden zu und lässt die Achse fahren.

    Unser erster umgesetzter Motor ist von Bosch Rexroth. Dh. es gibt nun die Mutterklasse mit dem Standardinterface auf die Achse und über ein Hardwareinterface wird nun der Motor dazugeladen. Darunter sind wiederum einige Funktionen (Zugriff auf Kommandos, usw...) in Klassen abgebilded.

    Um diesen Aufbau auch sauber zu trennen haben wir das alles mit Interfaces abstrahiert...

    Achsenobjekt
    -- Hardwareinterface => Rexroth Motor
    ----CommandoInterface => Commando Absolutmaß setzen
    ----CommandoInterface => Commando Fehlerreset
    ----... uvm ...

    Je mehr wir solche Interfaces verschalteln umso länger hat der Compiler (von Beckhoff, Codesys?) gebraucht um die Applikation zu bauen. Wenn ich diese Auftrennung mit den Interfaces rausnehme und die Objekte unterhalb des Achsenobjekts direkt instanziere dann baut der Compiler schnell. Im Fall der Interfaces braucht er gut um 5 Minuten länger..

    Funktionieren tun beide Versionen jedoch dauert die eine halt ewig zum Bauen. Der Compiler hängt da immer im Schritt "generate relocations ..." fest.

    Wie ist dies bei Beckhoff eigentlich gelöst? Kommt der Compiler von Beckhoff oder von Codesys? Wie genau kann man sich diesen Aufbau vorstellen? Kann man sich bei dem Compiler irgendwie detailiertere Angaben ausgeben lassen (so wie bei den C-Compilern o.ä.?)

    Mfg & jetzt schon mal danke für die Antworten

    Matthias

     
  • shooter - 2013-09-05

    machen sie bitte diesen text in english und bin mir sicher das du ein antwort aus holland bekomst von timvH

     
  • seehma - 2013-09-09

    Hi guys,
    i got a tip to translate my posting in english, maybe then i get more answers for my problem...

    We have worked a lot with the beckhoff system twincat 2 and now we are currently changing to the new version twincat 3.1 with 64 Bit support. We want to use the new possibilities of object oriented programming and so our new base system, which contains many libs for actuators and axis will be made with the new language options.

    But we have a little problem... We have an axis library, which will give the application engineer an standardized interface to all kinds of axes. He doesn't have to know if there is a Rexroth Servo drive behind the interface or a Simotion drive, he only has the standard methods to control the axis.

    Our first drive we will support, is from Bosch Rexroth. This means there is a mother object with a standard interface to the axis and in this mother object we will add a hardware interface for the drive. behind the hardware class there are many other classes for all the commandos and other functions of the drive.

    We also wanted to abstract all classes we have made with interfaces to get better automated testing conditions of our objects. Here is a sample object:

    axis-object
    -- hardware interface => Rexroth Drive
    ---- commando interface => set absolute position
    ---- commando interface => reset class 1 diagnostics
    ---- ... and many more ...

    But the problem now is, the more interfaces we include in the hardware interface, the longer does the compiler need to build the application. The current build time is about 8 minutes on a Intel core i7 and 5 minutes on a Intel Xenon processor. If i remove the interfaces and have all objects directly instanced in the hardware object i have no problem and the build time is short as usuall. Both versions which are build out of the compiler are working...

    The compiler hangs at the step "generate relocations ..." (for this 8 minutes)...

    So whats the problem? Who is making the compiler, Codesys or Beckhoff? Who is making the target and the interpreter, Codesys or Beckhoff? Can i get more informations out of the compiler so that i can see where he is working for this long time? I know some tricks in C, where i can parameterize the compile as i like, are there any possibilities with the codesys compiler?

    So i hope you guys understand my "beginner" english...

    Best Regards

    Matthias

     
  • TimvH

    TimvH - 2013-09-09

    I am not sure, but my guess is that it is Beckhoff related.
    Over the last couple of years, the compile time of CODESYS applications has improved significantly. I have worked with many customers on applications, but up to now I have never seen compile times of 8 minutes.

    "generate relocations" is also not a familiar term. This also seems Beckhoff specific.

    I think you should contact Beckhoff to get the details of their compiler.

     
  • seehma - 2013-09-09

    Hi,

    thank you for your answer. Today i got an answer of Beckhoff... They are currently testing a new version (TC 3.1.4011 Beta) with a new Codesys Compiler and there it seems that my problem is solved...

    I got this version for testing purposes and what i have seen is that the code size of the axis library is a tenth of the one with the old compiler. Also the compile time is now normal with 2 seconds...

    So it seems that they have fixed the problems with the interfaces...

    But what i wanted to know is, if i can parameterize the compiler so that i can get more output... Maybe i can see if i have a specific problem in one of my objects!?

    Matthias

     
  • TimvH

    TimvH - 2013-09-09

    See the following topic which hopefully answers your question sufficiently. Please ask Beckhoff if they also support static analysis in TwinCAT 3.
    http://forum.codesys.com/viewtopic.php?f=11&t=5384

     
  • seehma - 2013-09-09

    Thanks for this Entry... it helped ...

    I'm asking Beckhoff about such an analyzing tool... maybe they have one!

    Thanks for all your help...

     

Log in to post a comment.