To provide maximum flexibility, PLC Reports uses instruction lists when creating reports. Instructions are defined in clear text and are available for any task. For example, the task of archiving a variable value is done by the instruction “Archive Variable”. Automated printing of a report is handled by the instruction “Print Report”.
Detailed descriptions of all available instructions can be found in the document “Instructions Manual of PLC Reports”.
A unique index must be assigned to each instruction. Scheduling triggers will start the execution of the instruction list with the instruction having the specified index. To call varying blocks of instructions at different events, instruction lists can be separated into several blocks.
To report the energy consumption for every hour of a day, a daily report is created. The report shows the maximum consumption during each hour, thus 24 values.
The instruction has a block with the start index 1 containing the instructions for calculating and archiving the maximum values. The second block with the start index 100 contains the instructions for creating an hourly report.
The scheduling contains a trigger with a cycle of 10 seconds to measure and calculate the maximum consumption. The trigger starts the first block of the instruction list at index 1.
The scheduling contains a second trigger with a cycle of 1 hour which starts the second block at the instruction with index 100. This block creates the report, saves it as PDF and sends it to a printer.
The worksheet for instruction definitions has the fixed name “Instructions”. Instructions will always be executed in the order of their indexes. Index numbers may have gaps. For example, it is allowed to use the indexes 1, 2, 3, 8, 9, 20, 21, 30. When starting a report the start index is specified either manually or by schedule. PLC Reports then executes all instructions in the order of their indexes.
The execution of the instruction list ends if either an “End”-instruction is called or the end of the instruction list is reached.
“Go To”-instructions allow jumping to a defined position of the instruction list.
To edit and validate instruction definitions, a report template must be opened first by clicking “Open Report File” in section “2. Report File”.
Instruction definitions can be entered starting from row 6. Row 5 is reserved for the column headers. The header area (row 1-4) is not being interpreted.
14.1. Walk-Through: How to Edit Instruction Definitions
- Open a report file for editing.
- Select the worksheet “Instructions” in the Excel report template.
- Enter or change the desired instruction definitions in Excel.
- Navigate to section “6. Instructions” in PLC Reports.
- Click the button “Load and Check Instructions”.
- PLC Reports now reads and validates all instructions defined in the worksheet “Instructions”.
- Valid instructions will be shown in the section “Instructions”.
- If errors occur while loading or validating, corresponding messages will be shown in the message list.
- Error-free instruction definitions are marked with the icon in column “Def”.
- Error-prone instruction definitions are marked with the icon in column “Def”.
- By double clicking an error message you can directly jump to the error-prone cell in the Excel sheet.
- After editing the report template, save and close the workbook by using the corresponding commands in the Excel file menu.
14.2. Testing Instructions
14.3. Columns of the Worksheet „Instructions“
The worksheet “Instructions” contains the following columns:
14.3.1. Column A: Index
This column is used for defining a unique identification number (index) for each instruction.
Records will only be interpreted if column “Index” contains a valid numeric value. If the index cell is blank, all entries in the following columns of the same row will not be considered. This way, any comments can be added for documentation or description purposes. Empty rows will also not be considered.
14.3.2. Column B: Command
This column is used for selecting the desired instruction and to specify the belonging parameters. A list of available instructions can be found in the document “Instructions Manual of PLC Reports”.
22.214.171.124. Command Structure
A command always starts with the command name which is not case sensitive. Blanks inside the command can be used or be left out.
Valid styles on the example of the Instruction “Archive Variable”:
- Archive Variable (recommended style)
- archive variable
After the command name, the parameters are specified in brackets. If the command has no parameters, “()” must follow the command name.
- Instruction Name()
- Instruction Name(Parameter 1)
- Instruction Name(Parameter 1, Parameter 2)
14.3.3. Column C: Remarks
This column is used for documentation purposes and can contain any comments.