RECIPE

Concept Link IconSee also Concept Link IconExample Concept Link IconFurther information

Recipe management.

WebVue support - Yes.

Mode Mnemonic Syntax
1 EXIST 1
2 SEND 1, 5
3 REALTIME 1, 2
4 READ 3
5 CREATE 4
6 SENDEVEN 1, 5
7 REALTIMEEVEN 1, 2
8 STARTWATCH 6, 7
9 STOPWATCH 1, 5, 10
10 REALTIMECREATE 5, 8
11 REALTIMECREATEEVEN 5, 8
12 REFRESH 9
14 NETWORKBROADCAST 11
15 NETWORKBROADCASTALL 12

The values for Recipe access rights are described in the topic Access Rights Weighting.

The maximum size for the recipe file for mode SEND is 128 Kb.
The maximum size for the recipe file for mode NETWORKBROADCAST is 64 Kb.

Syntax 1

IntVal = RECIPE(Mode, Identifier);

Return type: INTEGER.

Identifier

The identity of the recipe. This can be either its number or its title. See the topic 'Configuring Recipes'. Type STR.

Execution

Mode

Mnemonic

Action

1

EXIST

Test whether the recipe exists.

Return:

1 if the recipe number exists.
2 if the recipe title exists.
0 if the recipe does not exist.

2

SEND

Send a recipe. The restrictions, which are normally imposed when sending a recipe from an animation, apply, e.g. the user must have the correct rights and the enable bit must be set.

3

REALTIME

Modify the recipe by substituting the current (real time) value of each variable within its list.

6

SENDEVEN

The same as Mode 2 except that the recipe is sent even if some of the variables are invalid or out of limits.

7

REALTIMEEVEN

The same as Mode 3 except that the real time values are substituted even if some of them are invalid or out of limits.

9

STOPWATCH

Stop the refresh of variables in the recipe (as started with a STARTWATCH)

 

 

Return: 1 if successful, else 0, except for Mode 1 (EXIST).

Syntax 2

IntVal = RECIPE(Mode, Identifier, NewNum, NewTitle, Flag, File);

Return type: INTEGER.

Argument

Meaning

Identifier

The identity of the recipe. This can be either its number, or its title. See the topic 'Configuring Recipes'. Type STR.

NewNum

The number for the new recipe. Type STR.

NewTitle

The title for the new recipe. Type STR.

Flag

Save the new recipe in a file. (0 or 1).

File

The name of the file in which the recipe is to be saved.

Execution

Mode

Mnemonic

Action

3

REALTIME

A new recipe is created using the variable list from the recipe specified by the identifier, but with the current (real time) value for each of the variables. If a file is specified it will be saved. An existing recipe with the same identifier it will be overwritten.

7

REALTIMEEVEN

The same as Mode 3 except that the real time values are substituted even if some of them are invalid or out of limits.

 

 

Return: 1 if successful, else 0.

The name of the file in which the recipe is to be saved cannot be renamed by this command, i.e. the parameters NewNum, NewTitle and File should be kept unchanged.

Syntax 3

IntVal = RECIPE(Mode, Identifier, Handle, Size);

Return type: INTEGER.

Argument

Meaning

Identifier

The identity of the recipe. This can be either its number, or its title. See the topic 'Configuring Recipes'. Type STR.

Handle

The location of a memory buffer as returned by ALLOC_BUFFER. Type LONG.

Size

The size of the recipe file. This must be smaller than the buffer size or a run time error will occur.

Execution

Mode

Mnemonic

Action

4

READ

The contents of a recipe are read into a memory buffer.

Return: 1 if successful, else 0.

Syntax 4

IntVal = RECIPE(Mode, Handle, NewNum, NewTitle, Flag, File);

Return type: INTEGER.

Argument

Meaning

Handle

The location of a memory buffer as returned by ALLOC_BUFFER. Type LONG.

NewNum

The number for the new recipe. Type STR.

NewTitle

The title for the new recipe. Type STR.

Flag

Save the new recipe in a file. (0 or 1).

File

The name of the file in which the recipe is to be saved (if Flag = 1).

Execution

Mode

Mnemonic

Action

5

CREATE

A new recipe is created using the contents of a memory buffer. If File is specified the corresponding file will be saved. Any existing recipe with the same identifier will be overwritten.

Return: 1 if successful, else 0.

Syntax 5

IntVal = RECIPE(Mode, Identifier, Branch);

Return type: INTEGER.

Identifier

The identity of the recipe. This can be either its number, or its title. See the topic 'Configuring Recipes'. Type STR.

Branch

A branch that will be prefixed to all variable names in the recipe list. Type STR.

Execution

Mode

Mnemonic

Action

2

SEND

Send a recipe. The restrictions, which are normally imposed when sending a recipe from an animation, apply, e.g. the user must have the correct rights and the enable bit must be set.

6

SENDEVEN

Send a recipe. The same as Mode 2 except that the recipe is sent even if some of the variables have an invalid or out of limits value.

9

STOPWATCH

Stop the refresh of variables in the recipe (as started with a STARTWATCH)

10

REALTIMECREATE

Modify the recipe by substituting the current (real time) value of each variable within its list.

11

REALTIMECREATEEVEN

Modify the recipe by substituting the current (real time) value of each variable within its list, even if some of the variables have an invalid or out of limits value.

 

 

Return: 1 if successful, else 0.

Syntax 6

WatchID = RECIPE(Mode, Identifier, ResultVar, Status);

Return type: LONG.

Argument

Meaning

Identifier

The identity of the recipe. This can be either its number, or its title. See the topic 'Configuring Recipes'. Type STR.

ResultVar

Name of a bit variable. Type STR.

ResultVar status:

1 values are refreshed.

0 the Id could not be found or the bit variable is of an incorrect type.

Status

Either 0 or 1.

Execution

Mode

Mnemonic

Action

8

STARTWATCH

This mode is used to refresh any variables in a recipe that are not scanned permanently. The bit ResultVar is set to the value in Status when the function is executed.

 

 

Return: The Id of the STARTWATCH request. This Id is to be reused when calling STOPWATCH.

Syntax 7

WatchID = RECIPE(Mode, Identifier, ResultVar, Status, Branch);

Return type: LONG.

Argument

Meaning

Identifier

The identity of the recipe. This can be either its number, or its title. Type STR.

Varname

Name of a bit variable. Type STR.

ResultVar status:

1 values are refreshed.

0 the Id could not be found or the bit variable is of an incorrect type.

Status

Either 0 or 1.

Branch

A branch that will be prefixed to all variable names in the recipe list. Type STR.

Execution

Mode

Mnemonic

Action

8

STARTWATCH

This mode is used to refresh any variables in a recipe that are not scanned permanently. The bit ResultVar is set to the value in 'Status' when the function is executed.

 

 

Return: The Id of the STARTWATCH request. This Id is to be reused when calling STOPWATCH.

Syntax 8

IntVal = RECIPE(Mode, Identifier, Branch, NewNum, NewTitle, File);

Return type: INTEGER.

Identifier

The identity of the recipe. This can be either its number, or its title. See the topic 'Configuring Recipes'. Type STR.

Branch

A branch that will be prefixed to all variable names in the recipe list. Type STR.

NewNum

The number for the new recipe. Type STR.

NewTitle

The title for the new recipe. Type STR.

File

The name of the file in which the recipe is to be saved.

Execution

Mode

Mnemonic

Action

10

REALTIMECREATE

A new recipe is created using the variable list from the recipe specified by the identifier, but with the current (real time) value for each of the variables. If a file is specified it will be saved. An existing recipe with the same identifier it will be overwritten.

11

REALTIMECREATEEVEN

Identical to Mode 10 except that the action will be performed even if some of the variable values are out of limits or invalid.

 

 

Return: 1 if successful, else 0.

The name of the file in which the recipe is to be saved cannot be renamed by this command, i.e. the parameters NewNum, NewTitle and File should be kept unchanged.

Syntax 9

IntVal = RECIPE(Mode);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

12

REFRESH

Force a reload of the recipe configuration from the configuration files in the project's \R folder. This is to allow the recipe configuration to be regenerated after the recipe source files have been modified by program or application external to PcVue.

 

 

Return: 1 if successful, else 0.

Syntax 10

IntVal = RECIPE(Mode, WatchID);

Return type: INTEGER.

WatchID

The id of a previously issued STARTWATCH function. Type LONG.

Execution

Mode

Mnemonic

Action

9

STOPWATCH

Stop the refresh of variables in the recipe started with the STARTWATCH function identified with the WatchID.

Return: 1 if successful, else 0.

Syntax 11

IntVal =RECIPE(Mode, RecipeID, List, HStatus, EventVar, LocalRemote);

Return type: INTEGER.

Argument

Meaning

RecipeID

The name or number of a recipe. Type STR.

List

The name of the list containing the names of the network stations to receive modifications (as created from the Configure.Communication.Network Stations command). Type STR.

The list must be of type Modification client list.

HStatus

The handle of a buffer allocated by ALLOC_BUFFER. After the instruction has been executed the buffer will contain a list of stations and their update status in the format:

StaNum,Status,...;.,...;...;

where StaNum is the number of the station and Status is 1 if successful, else 0.

EventVar

The name of a database bit variable that will be set to 1 when the instruction has been executed. If an event variable is not required a null string ("") must be used as this argument cannot be omitted. Type STR.

LocalRemote

A flag to determine where the changed recipe configuration is applied:

1: All stations (including the local station).
0: Remote stations only (default).

Execution

Mode

Mnemonic

Action

14

NETWORKBROADCAST

Sends the configuration of the selected recipe to all the stations contained in the station list.

Return: 1 successful, else 0.

Syntax 12

IntVal =RECIPE(Mode, List, HStatus, EventVar, LocalRemote);

Return type: INTEGER.

Argument

Meaning

List

The name of the list containing the names of the network stations to receive modifications (as created from the Configure.Communication.Network Stations command). Type STR.

The list must be of type Modification client list.

HStatus

The handle of a buffer allocated by ALLOC_BUFFER. After the instruction has been executed the buffer will contain a list of stations and their update status in the format:

StaNum,Status, etc.;

where StaNum is the number of the station and Status is 1 if successful, else 0. Type LONG.

EventVar

The name of a database bit variable that will be set to 1 when the instruction has been executed. If an event variable is not required a null string ("") must be used as this argument cannot be omitted. Type STR.

LocalRemote

A flag to determine where the changed recipe configuration is applied:

1: All stations (including the local station).
0: Remote stations only (default).

Execution

Mode

Mnemonic

Action

15

NETWORKBROADCASTALL

Sends the configuration of all recipes to all the stations contained in the station list.

Return: 1 successful, else 0.

Example

For an example, select the Example link above.