Recipe view
The recipe view is the operator’s Recipes page placed on the screen, next to the equipment. Pick a grade, check it against what the controller has now, and load it. It works like the Recipe view in WinCC.
“Recipe” is a project recipe (the Recipes section in the editor). The view has two parts:
- Records on the left (“Record list”). Without the list, the record is chosen in a drop-down.
- Parameters on the right, each with:
- its value in the record;
- its current value in the controller (“In controller” column, with differences highlighted);
- its units and allowed range.
Buttons:
- “New”, “Save” and “Delete”;
- “Read from PLC” puts the current values into the record fields;
- “Load to PLC”.
Without “Record editing”, only record selection and loading remain. This suits operators who must not change grades.
Editing and loading need the “Write parameters” right. Deleting and loading ask for confirmation. Records are kept on the server, so every client sees them.
Each recipe view has its own copy, so its selection and unsaved edits do not change the Recipes page or other views.
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
Recipe |
text | Recipe | |
ShowRecords |
true / false |
true |
Record list. Recipe records on the left; without it the record is chosen in a drop-down list |
ShowCurrent |
true / false |
true |
“In controller” column. Current tag values next to the record values; differences are highlighted |
AllowEdit |
true / false |
true |
Record editing. New, Save, Delete buttons and value editing; without it — only selection and loading |
FontSize |
number | 12 |
Font size |
From scripts
Section titled “From scripts”Item.Type = RecipeView. Any property is read and changed by name: Item.FontSize = 10. The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Actions of this element:
| Member | Description |
|---|---|
Records() |
Record names |
SelectedRecord |
Name of the selected record |
Select(record name) |
Select a record, like the operator in the list |
Values() |
Record values — Parameter, Value, Current, Unit |
ReadFromController() |
Current values from the controller into the record fields |
Save() |
Save the record on the server |
LoadToController() |
Load the record into the controller, with a question, like the button |
Events
Section titled “Events”Mouse, hover, focus and keyboard — as for any element (see Events and functions).
Examples
Section titled “Examples”Load a grade from a button: select a record and load it into the controller (the operator confirms).
var r = Screen.Items("Recipe");r.Select("Grade B");r.LoadToController();Save what the controller has now into the selected record.
var r = Screen.Items("Recipe");r.ReadFromController();r.Save();Compare the record with the controller.
var diff = Screen.Items("Recipe").Values().filter(function (v) { return v.Value != v.Current; });HMI.ShowMessage(diff.length == 0 ? "The controller runs the record" : "Different: " + diff.map(function (v) { return v.Parameter; }).join(", "));