Open Automation Software
Moving Data From Anywhere to Anywhere
1-303-679-0898

Getting Started – Recipe

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

Direct link: https://www.openautomationsoftware.com/videos/#databases

Recipes are used to transfer values from a database to Open Automation Software Tags. If the Tags Data Source is set to OPC Item the values will also be written to the OPC Item 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

Getting Started-Tags 1Start Configure OAS application if it is not already running.

 

Step 2

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

Getting Started-Recipe 1

Step 3

Select the Local OAS Service by selecting the Select button or the Local node in the service tree to the left.

Getting Started-Tags 3

Getting Started-Tags 4

Step 4

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

Right Click in the Tag Window and select Delete All to clear all Tags.

Getting Started-Tags 6

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] & “‘”

Getting Started-Recipe 2

Step 6

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

Getting Started-Tags 19

Step 7

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

Create a Database called OPCSystemsRecipes

Create a Table called RecipeValues with the following structure.

Getting Started-Recipe 3

Enter the following values to the Table RecipeValues.

Getting Started-Recipe 4

Step 8

With the Configure OAS application select Configure-Recipes.

Getting Started-Recipe 5

Step 9

Select the Local OAS Service by selecting the Select button or the Local node in the service tree to the left.

Getting Started-Tags 3

Step 10

Enter the Recipe Name Recipe 01.

Getting Started-Recipe 6

Set the Recipe Active.

Getting Started-Recipe 7

Set the Recipe Type to SingleRecord.

Getting Started-Recipe 8

Set the Tag to Execute Recipe as Trigger.Value.

Enable Confirmation Tag as Confirmation.Value.

Enable Error Tag as Error Code.Value.

Getting Started-Recipe 9

Step 11

Select the Tags Tab

Getting Started-Alarm Notification 7

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 as an OPC Item it will automatically write the value to the OPC Item.

You could also optionally use the DirectOPC selection to connect directly to OPC Items on OPC Servers instead of Open Automation Software Tags.

Select the Add Field button.

Getting Started-Data Logging 4

Select the Tag and Parameter Value01.Value.

Change the Field Name to Value01.

Change the Data Type to Integer.

Getting Started-Recipe 11

Select OK.

Select the Add Field button.

Getting Started-Data Logging 4

Select the Tag and Parameter Value02.Value.

Change the Field Name to Value02.

Change the Data Type to Integer.

Getting Started-Recipe 12

Select OK.

Step 12

Select the Database Tab.

Getting Started-Data Logging 15

Define the proper database connection.

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

Getting Started-Recipe 13

Step 13

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

Getting Started-Recipe 14

Step 14

Select the Save button on the toolbar at the top.

Getting Started-Tags 19

 

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.

OPCControlsButton

Text = Trigger

SetValueOPCSystems_Tag = True

SetValueOPCSystems_Tag = Trigger.Value

BackColorOPCSystems_Tag = Trigger.Value

 

OPCControlsTextBox

TextOPCSystems_Tag = Lot.Value

 

OPCControlLabel

TextOPCSystems_Tag = Confirmation.Value

 

OPCControlLabel

TextOPCSystems_Tag = Error Code.Value

 

OPCControlLabel

TextOPCSystems_Tag = Value01.Value

 

OPCControlLabel

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.