| View previous topic :: View next topic |
| Author |
Message |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 11/01/2016 16:14 Post subject: Delete Recipe in FT View SE v8.0 |
|
|
Dear All!!!
Please tell me the way how can i delete recipe from Runtime.
There are only save and restore options in the inbuild recipe function.
I am using inbuild recipe function.
Factory Talk View SE v8.0 (all the patches till date are installed) |
|
| Back to top |
|
 |
zwang Junior 2

Joined: 30 Jul 2015 Posts: 42 Location: China
|
Posted: 11/01/2016 18:53 Post subject: Re: Delete Recipe in FT View SE v8.0 |
|
|
| sachincool786 wrote: | Dear All!!!
Please tell me the way how can i delete recipe from Runtime.
There are only save and restore options in the inbuild recipe function.
I am using inbuild recipe function.
Factory Talk View SE v8.0 (all the patches till date are installed) |
From FactoryTalk View Machine Edition 5.00 upward this is available
RecipePlus - Delete and Rename functions have been added to the RecipePlus button's actions. Users can now delete and rename a recipe unit selected in the selector object.
https://rockwellautomation.custhelp.com/ci/fattach/get/12635/MEproj.chm::/Project/PROJECT_Product_Support.htm |
|
| Back to top |
|
 |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 11/01/2016 19:15 Post subject: |
|
|
Dear !!!
I am using SE application not ME. |
|
| Back to top |
|
 |
zwang Junior 2

Joined: 30 Jul 2015 Posts: 42 Location: China
|
Posted: 11/01/2016 19:23 Post subject: |
|
|
| sachincool786 wrote: | Dear !!!
I am using SE application not ME. |
REcipePlus is for the Me edition not the SE.
IN SE Edition is not available.
Just write VBA for this because is not available.
Unfortunately just now I have not a writed code available. |
|
| Back to top |
|
 |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 11/01/2016 19:26 Post subject: |
|
|
| Please give me a sample if you have one. |
|
| Back to top |
|
 |
zwang Junior 2

Joined: 30 Jul 2015 Posts: 42 Location: China
|
Posted: 11/01/2016 19:26 Post subject: |
|
|
Here is a code finded for RSView if you can adapt
| Code: |
'initialize the listbox with all the existing recipe file names
Private Sub UserForm_Initialize()
Dim sRecipes As StringList
Dim vRecipe As Variant
On Error GoTo ErrHandler
Set sRecipes = gProject.GetComponents("recipe;files")
For Each vRecipe In sRecipes
LstRecipeNames.AddItem vRecipe
Next vRecipe
ErrHandler:
If Err.Number Then
gActivity.Log Err.Description
Err.Clear
End If
Set sRecipes = Nothing
Set vEachRecipe = Nothing
End Sub
'user selects the recipe name in the list box, and then presses delete button
Private Sub cmdDeleteRcp_Click()
On Error GoTo ErrHandler
If LstRecipeNames.ListIndex = -1 Then
MsgBox "Select a recipe to delete"
Else
'delete the recipe file, and remove from the project
gProject.DeleteComponent "Recipe;files", LstRecipeNames.Text
'remove the item from the listbox
LstRecipeNames.RemoveItem LstRecipeNames.ListIndex
End If
ErrHandler:
If Err.Number Then
gActivity.Log Err.Description
Err.Clear
End If
End Sub |
|
|
| Back to top |
|
 |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 11/01/2016 19:28 Post subject: |
|
|
Dear!!!
used this code already but not able to make it working.
What i did is:
I made a button named "cmdDeleteRcp" as per the code saying and made to it VBA exposed.
Now I made a Listbox from Microsoft form 2.0 activeX control with the name of "LstRecipeNames" as per the code saying and made to it VBA exposed.
Now when i run the runtime, i could not see any recipe in listbox
and one thing more i am getting error on the step
gActivity.Log Err.Description
but i bypassed ut by make it comment |
|
| Back to top |
|
 |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 12/01/2016 07:46 Post subject: |
|
|
Private Sub Display_AnimationStart()
Dim sRecipes As StringList
Dim vRecipe As Variant
On Error GoTo ErrHandler
Set sRecipes = gProject.GetComponents("Recipes;files")
For Each vRecipe In sRecipes
LstRecipeNames.AddItem vRecipe
Next vRecipe
ErrHandler:
If Err.Number Then
'gActivity.Log Err.Description
Err.Clear
End If
Set sRecipes = Nothing
Set vEachRecipe = Nothing
'Set vRecipe = Nothing
End Sub
'user selects the recipe name in the list box, and then presses delete button
Private Sub cmdDeleteRcp_Press()
On Error GoTo ErrHandler
If LstRecipeNames.ListIndex = -1 Then
MsgBox "Select a recipe to delete"
Else
'delete the recipe file, and remove from the project
gProject.DeleteComponent "Recipes;files", LstRecipeNames.Text
'remove the item from the listbox
LstRecipeNames.RemoveItem LstRecipeNames.ListIndex
End If
ErrHandler:
If Err.Number Then
'gActivity.Log Err.Description
Err.Clear
End If
End Sub |
|
| Back to top |
|
 |
sachincool786 Junior 2

Joined: 21 Jun 2015 Posts: 28
|
Posted: 12/01/2016 07:48 Post subject: |
|
|
THis above code i am using.
Please tell me what is wrong in it???
The listbox is not picking list of recipes from Recipe function |
|
| Back to top |
|
 |
|