Operating the Application
(Original Document)
At a Glance
The TE_UPLOADDRIVEPARAM and TE_DOWNLOADDRIVEPARAM blocks are used to manage the production recipes.
An example of the procedure for creating and managing recipes is described in this section.
NOTE: for flexible machines, it is possible to manage several parameter recipes.
Creating and backing up the recipes
The table describes the procedure for creating recipes:
Step
Action
1
Create the recipes using the Axis_Z directory.
Result: new recipe variables (Recipe_0, Recipe_1, etc.) are automatically created in the Data Editor.
2
Create a variable corresponding to the type of recipe variables.
This variable is named in the Recipe_Z tutorial example.
Recipe_Z acts as a buffer when backing up or transferring data.
Note: it is essential to check Allow dynamic arrays [ANY_ARRAY_XXX] located in Tools → Project options → Tab: Language extensions → Zone: Data type to be able to use table type variables such as the recipes.
3
Configure the servodrive’s parameters using Powersuite.
These initial settings are used to configure a recipe.
4
Perform a backup of the parameters using the TE_UPLOADDRIVEPARAM block in the buffer variable Recipe_Z.
The backup was successful if the bits of the MC_READSTATUS block are as follows:
5
Transfer the data backed up in the Recipe_Z buffer variable to the Recipe_0 variable.
6
Repeat steps 3 and 4 to transfer the data backed up in the Recipe_Z buffer variable to the Recipe_1 variable.
The following programming presents a data transfer example based on the value of PRODUCTION:
IF UPLOAD_Z.DONE AND PRODUCTION=0 THEN
Recipe_0:=Recipe_Z;
END_IF;
IF UPLOAD_Z.DONE AND PRODUCTION=1 THEN
Recipe_1:=Recipe_Z;
END_IF;
Transfer Data from the Recipes
The table describes the procedure to transfer recipe data to the servodrive (for a production change, for example):
Step
Action
1
Reload the Recipe_Z buffer variable based on the value of PRODUCTION (type of production requested).
IF Cmd_Download_Z AND PRODUCTION=0 THEN
Recipe_Z:=Recipe_0;
END_IF;
IF Cmd_Download_Z AND PRODUCTION=1 THEN
Recipe_Z:=Recipe_1;
END_IF;
2
Transfer the parameter data, using the Recipe_Zbuffer variable’s TE_DOWNLOADDRIVEPARAM block, to the servodrive.
3
The transfer was successful if the bits of the MC_READSTATUS block are as follows: