Getting Started – Recipe

View the following video for a step by step tutorial on setting up recipe executions:

Recipes are used to transfer values from a database to Open Automation Software Tags. If the Tags Data Source is set device data or IoT Cloud systems the values will also be written to the source the Tag is defined to. The most common implementation is to have a variable in a PLC trigger the recipe execution.

The PLC will then wait for either the Confirmation or Error Code to be written to the PLC to indicate if the recipe execution has completed. If in Error the PLC can then retry the Trigger.

Follow the steps listed below or view the video on defining recipes.

For a complete list of all Recipe properties refer to the Recipe Properties section in this help file.

Step 1

OASStart Configure OAS application if it is not already running.

Step 2

Select Configure Tags to add some Tags to use with the Recipe execution.

Configure Tags

Step 3

Select the Local OAS Service by selecting the Select button next to the Network Node dropdown.

Network Node

Step 4

If you are working on an existing Tag configuration you want to keep save it now.

Right Click on the Tags Group at the root level of the Tag Tree and select Delete All to clear all Tags.

Delete All

Step 5

Add the following Tags with the specific Data Types:

Trigger as a Boolean

Value01 as an Integer

Value02 as an Integer

Lot as a String with the Value A

Confirmation as a Boolean

Error Code as an Integer

Query String as a String with Data Source of Calculation
“WHERE Lot = ” & “‘” & [Lot.Value] & “‘”

Step 6

Select the Save button on the toolbar at the top and use the file name Recipe Tags.

Save Button

Step 7

Use Microsoft SQL Server, Oracle, Access, mySQL, PostgreSQL, Cassandra, or MongoDB to create the following Table.

Create a Database called OASDemoRecipes

Create a Table called RecipeValues with the following structure.


Enter the following values to the Table RecipeValues.


Step 8

With the Configure OAS application select Configure-Recipes.

Configure Recipes

Step 9

Select the Local OAS Service by selecting the Select button next to the Network Node dropdown.

Network Node

Step 10

Enter the Recipe Name Recipe 01.

Recipe Name

Set the Recipe Active.  You also have he option to Activate the Recipe with a Tag.  For this tutorial just check the Recipe Active box.

Recipe Active

Set the Recipe Type to Single Record.

Recipe Type

A Queued Single Recipe type will delete the top record if the recipe execution is successful.

A Multiple Records has only 2 fields, one for the Tag Name to set and one for the Value to write to the Tag.  Using this type you can define what Tags to write to in the database.

A Queue Multiple Records type will delete the records obtained if the recipe execution is successful.

Set the Tag to Execute Recipe as Trigger.Value.

Enable Confirmation Tag as Confirmation.Value.

Enable Error Tag as Error Code.Value.

Recipe Configuration

When a recipe is executed it will only write to Tags where the desired value from the database is different than the current value of the Tag.  For floating point values use the Float Deadband property under the Common tab to define what is the allowable range to determine if a value is the same or different.

The Timeout property is the amount of time the recipe execution will wait for all values to be returned from the Tags.  If one or more of the values does not read back from the data source the recipe execution will end with an Error Code of Timeout.

The property Write All Values Without Feedback will not wait for the values to be returned and will write all database values to all defined Tags.  This is preferred for a faster execution when using the Execution Type Continuous.

Step 11

Select the Tags Tab

Tags Tab

With the Tags properties you can assign the database table fields to Open Automation Software Tags to write to when the recipe executes.

All OAS Tag Variables that are write capable including configuration parameters can be updated.

If the Data Source of the Open Automation Software Tag is defined to a device or IoT cloud server a write to the Value variable will it will automatically write the database value to the source.

Select the Add Field button.

Add Tags

Select the Tag and Parameter Value01.Value.

Change the Field Name to Value01.

Change the Data Type to Integer.

Recipe Value01

Select OK.

Select the Add Field button.

Add Tags

Select the Tag and Parameter Value02.Value.

Change the Field Name to Value02.

Change the Data Type to Integer.

Recipe Value02

Select OK.

Step 12

Select the Database Tab.

Database Tab

Define the proper database connection.

Enable the property Set Query String with Tag and set to Query String.Value.

Recipe Database Configuration

Step 13

Select the Add button in the lower left to add the Recipe.

Add Recipe

Step 14

Select the Save button on the toolbar at the top.


Save the file RecipeExample.Recipes in the directory OASDemo.

Go to Configure-Options and select the Default Files tab and set the default Recipe Configuration file to the file you just saved.

To track details of recipe execution go to Configure-Options and select the System Logging tab to enable Log Recipe Transactions and specify where the recipe transactions will be save.

Step 15

At this point you are ready to execute the recipe which you can do with Configure-Tags to set the Lot to A, B, or C, then set the Trigger Value from False to True.

You can then see that the Confirmation Tag will be set to True and Value01 and Value02 update if the Recipe is successful or the Error Code Tag will be a positive number if there is an error. Review the Recipe Transaction Log for details of the transaction.