-

Recipe Files: Background Information and File Structure

The maximum number of recipe files that can be stored depends on the controller type. The number of data sets per file depends on the Safety PLC involved. For a SPLC 3000 class each recipe file may contain up to 128 data sets (file sections) each with a maximum of 64 bytes of recipe data.

The following table lists the amount of recipe data for two Safety PLC types:

Safety PLC typeNo. of recipe filesTotal amount of recipe data
SPLC 3000 class864 Kbytes
(8 files * 128 data sets * 64 bytes)
SPLC 1000 class81 Kbyte
(8 files * 2 data sets * 64 bytes)

The file names for recipe files are rcp_00x.svv with x = 0 to 8.

Recipe files contain safety validated values (svv) with various checksums (see following section "File structure").

Recipe file structure

A recipe file is structured as follows:

At the beginning of the file there is a file header followed by up to 128 data sets (sections) with stored recipe data. Each section has its own CRC for data protection (DataSetCRC). At the end of the file there are a file checksum (FileCRC) and a total CRC which are both described below. The number of data sets per file is variable (configurable) and depends on the Safety PLC type.

The following graphic shows the maximum file size with 128 data sets:

Recipe file header

The file header has the following structure:

File sections data sets with CRC

Each file section (data set) in a recipe file is composed as follows:

File checksum (FileCRC) and internal total CRC

At the penultimate position of the recipe file, the FileCRC with the size of 4 bytes is inserted which is calculated over the file header and all DataSetCRCs in the file sections.

When reading recipe data with the SF_RecipeRead function block, a validation of the FileCRC can be activated by switching the CheckFileCRC input of this FB to SAFETRUE. If the checksum is not as expected, the read data is considered as invalid. See section "Fault avoidance" of the SF_RecipeRead FB for details.
This configurable validation helps ensure that exactly the right file is read.

Independently of this configurable validation, the FB always checks the file consistency by recalculating and comparing the total CRC which is stored at the end of the recipe file. This checksum is calculated over the entire data in the file including the above-mentioned FileCRC. This CRC is not visible in the application and is used for internal data validations of the FB.