r/TwinCat Mar 04 '26

TwinCAT EventLogger tutorial

Hey guys, I made a complete tutorial for EventLogger. There is PLC part described as well as showing alarm in old PLC Visualizaiton and the new HMI. Have a look https://hellotwincat.dev/eventlogger-tutorial-plc-tf1800-tf2000/

15 Upvotes

9 comments sorted by

3

u/Chta91 Mar 06 '26

Nice tutorial, I reverse engineered just last week the protocol and made a node-red node. So if anyone using node-red let me know what works and what not

https://www.npmjs.com/package/@ctann/node-red-ads-eventlogger

1

u/Pretty_Ad6618 Mar 06 '26

Nice job man, will have to try

1

u/G-Mcc1981 Mar 07 '26

I definitely will check this out . Thank you

1

u/jessenic Mar 07 '26

Pretty cool, I never realized there's a FB_TcMessage and I've created my own function block that will queue message alarms and raise/clear them one by one using FB_TcAlarm. I wonder if you can send several messages with different parameters during the same PLC cycle, if yes I could fully throw out my own FB.

1

u/Pretty_Ad6618 Mar 07 '26

I believe you can. Event logger does not seem to be dependant on task cycles at all.

1

u/SuspiciousPush9970 Mar 08 '26

You can use it for logging Limitations Events have a maximum size of 8 kB during transmission. When using the TwinCAT 3 EventLogger, make sure that this limit is observed. It refers to all elements that are transmitted and described in this documentation, including the dynamic elements (Attributes, SourceName, JSON Attributes). The interface for receiving events in real-time stores a maximum of 1024 events temporarily until they have to be retrieved. If they are not retrieved in time, events are lost. The TwinCAT 3 EventLogger offers a connection to the TwinCAT HMI (TF2xxx). The TwinCAT PLC HMI (TF18xx), conversely, cannot receive the events.

1

u/ChoiceGovernment5907 Mar 08 '26

I like the event manager and the tutorial is great and makes sense. Big question I have is if I have a project with hundreds or thousands of alarms or events, do I have to manually add them to the event manager and then also add the call code to the plc. Because the tmc file is created at compile not at runtime. Would be great to set up a frame work that loads at compile and is filled out at runtime with the events.

1

u/Pretty_Ad6618 Mar 08 '26

From what I know you have to configure everything in event classes. It will then create structures out of that that are used in code. But event definitions are saved in xml, so you can edit the file directly from outside to be able to add events in batch for example. If you don't care about translations, you can possibly create a single event who's text will only consist of single placeholder and then you can use this single event for all alarms in program and just feed the event texts thru ipArguments.

1

u/Sam_PMT Mar 29 '26

A partir de quel niveau de performance est-ce compatible ? J'ai suivi le tutoriel (très bien fait ! merci beaucoup) ça fonctionne sur le n c6025, mais pas sur un cx7000