Data Handling

You can set general settings for the package size for the recorded data in the Handling Data tab. Additional settings may be present, dependent on the given data format.

Data Handling 1:

Autostart Stream: Sets whether the stream should start automatically as soon as TwinCAT switches to Run mode. If this option is not chosen, the stream can be started via a PLC program.

Data size: This is a write-protected, automatically determined value that states the size of the given variable selection for this stream, i.e. the sample size.

Max ADS Buffer: You can set the number of buffered samples before writing to file or sending to Message Broker here. With a sample rate of 1 ms and 32 samples per buffer, the Analytics Logger needs 32 ms before it sends the buffer via MQTT or writes it to a file. This is an individual setting that is dependent on the system resources.

Sampling divider: This allows you to reduce the sampling rate, which can be determined by dividing the inverses of the task cycle time by the value specified here.

Data format: MQTT

If the data format is IOT_FORMAT_BINARY, an additional checkbox can be activated for queuing messages when the connection is broken.

Data Handling 2:

File Store: If this option is activated the queued messages will stored in a temporary file on the hard disk. Otherwise the data will be stored in the RAM when connection to the Message Broker is broken.

Queue Size: This is the number of the configured ADS Buffer which should be stored in the event of a lost connection.

Data format: File

If the IOT_FORMAT_FILE data format is selected, a number of other setting options are available.

Data Handling 3:

Max File Size: The maximum number of buffers that can be written to a file before a new file is started can be specified here. This results in a maximum file size. The files will be stored under C:\TwinCAT\3.1\Boot\Analytics.

File Directory: An Analytics subfolder is created by default in C:\TwinCAT\3.1\Boot\ (%TC_BOOTPRJPATH%) for each stream. A subfolder containing a .tas file (symbols) and the .tay files (data) is created for each stream. The path to the folder that the Analytics directory should be stored in can be defined here.

Max. unconfirmed: Specifies how many ADS requests may accumulate while writing files that do not have a corresponding ADS confirmation. This parameter enables flow control to prevent an overflow of the ADS router queues. It can usually remain at the pre-set value. However, if a large number of write operations occur in a short period of time and the router is also under further load at the same time, this can lead to overfilled queues, which is indicated by error messages.

Ring Buffer: Activates a ring buffer where the binary files are buffered. Each time TwinCAT is restarted, the current content is transferred to a backup folder and a new ring buffer is started, which overwrites the content of the backup folder.

File Count: The File Count parameter is used to state a number of files that should be part of the ring buffer. The ring buffer time depends on the given Max File Size.