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 SingleRecord.

Recipe Type

Set the Tag to Execute Recipe as Trigger.Value.

Enable Confirmation Tag as Confirmation.Value.

Enable Error Tag as Error Code.Value.

Recipe Configuration

Step 11

Select the Tags Tab

Tags Tab

With the Tags properties you can assign the database table fields to the Open Automation Software Tags to write to when the recipe executes. If the Data Source of the Open Automation Software Tag is defined to a device or IoT cloud it will automatically write the 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 C:\OPCSystemsDemo.

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 and set the Trigger 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 Execution Log found in the Error Log directly if there is an error.

Optionally create a Standard Windows application or WPF application with the following on a Form or Window to view recipe execution in a more interactive execution. If you are unfamiliar with the OPC .NET WinForm HMI .NET product you may want to follow the steps in this Training Guide on Add HMI Controls to Visual Studio.


Text = Trigger

SetValueOPCSystems_Tag = True

SetValueOPCSystems_Tag = Trigger.Value

BackColorOPCSystems_Tag = Trigger.Value


TextOPCSystems_Tag = Lot.Value


TextOPCSystems_Tag = Confirmation.Value


TextOPCSystems_Tag = Error Code.Value


TextOPCSystems_Tag = Value01.Value


TextOPCSystems_Tag = Value02.Value

Run the Recipe Example application and enter the Lot as A, B, or C and click on the Trigger Button to see the values being set.

Getting Started-Recipe 15

Step 16

When you execute a Recipe with Error Logging enabled under Configure-Options a log will be generated for the recipe execution in the same directory as the Error Log.

A Queued Recipe Type will delete the returned record with the recipe execution is successful.

A Multiple Record Recipe Type 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.

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 OPC Server if defined as an OPC Item 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.

To open a new window for Recipe modification, select Configure-Recipes or Alt-C-P.

Select a Windows Service to modify, the node with the green arrow is the current Service being modified.  Refer to Selecting Service for more information on selecting an OAS Service.