Tia Portal v17 - Data Log that overwrites over itself

marko18

Member
Join Date
Nov 2021
Location
USA
Posts
47
Hi all,

I am working on a project in Tia Portal v17, and I have a function block that is responsible for data logging. This data log begins once a certain switch is flipped in the system, and then records an entry every time the boolean state of a system failsafe changes.

Currently I have the log set to record 10 entries - that is, once 10 different failsafe state changes are detected/logged, the log will not record any more entries. However, I want the log to overwrite itself after this 10th entry, so that the 11th failsafe change will be at the top of the log, and the next 9 will fill in below it, etc. But I want it to be uninterrupted and on the same file without opening/closing the file or making a new file. Currently this data log does not have a close condition, it is open perpetually after it is created/opened. Does anyone know how I could loop the logging of data onto this data log? Thanks
 
What PLC ?
What HMI ?
Where is the logging taking place ?
- In PLC RAM memory ?
- In PLC flash card memory ?
- In an HMI archive file ?
- or ?

Sorry, forgot the details! It is an S7-1200 PLC, KTP400 HMI. I'm not really sure what you mean by the last questions but I am currently having the data log to a CSV file that gets automatically uploaded/updated to a web server that the PLC is connected to. I believe it is being processed in the PLC's RAM
 
I am guessing you are using the integrated functions, i.e. DatalogCreate, DatalogOpen, DatalogWrite etc.
This creates a logfile that can be reached externally if you enable the webserver on the CPU.

This is from the online help in TIA:
Properties of the data log

Writing of the data records of a data log is carried out in accordance with the principle of a ring buffer. New data records are added until the maximum number of data records is reached (RECORD parameter). The next data record then overwrites the "oldest" data record of the data log.
In other words, it should already work as you intend it to.

If not, then please provide some more info on how you have created the logging of data.

In TIA online help, there is also an example code on data logging via the integrated functions.
 
Maybe what goes wrong in your code is that your timestamp is not correct. Have you considered this quote from the online help:
A data record is composed later from the following entries:
The data record number (assigned automatically)
The date (assigned automatically when "1" is used for DataLogCreate at the TIMESTAMP parameter).
The time of day (assigned automatically when "1" is used for DataLogCreate at the TIMESTAMP parameter).
 

Similar Topics

Hello forum, I wanted to install Step 7 TIA Portal V17 on my laptop (Win10 64 Bit). Unfortunately, I am getting this (error:14667)...
Replies
0
Views
613
Hi everybody, I have this variable (Activate1) that should be set when I activate a button from the hmi, but instead is only set as long as the...
Replies
6
Views
1,232
Hello all, I am working on a project using an s7-1200 and tia portal v17. The project is for stepper motor control for a SMD23E2 motor. I am...
Replies
3
Views
5,289
Hi all, I am starting a project with motion control and currently have a few stepper motors that I want to get working with a S7-1200 CPU. The...
Replies
15
Views
4,195
Hello all, I'm very new to PLCs, and I'm working on a system utilizing an S7-1200 PLC with a KTP400 Basic HMI, and it was programmed in Tia...
Replies
7
Views
2,032
Back
Top Bottom