You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 4th, 2017, 07:35 AM   #1
Rob S.
Member
United States

Rob S. is offline
 
Join Date: Sep 2008
Location: Maryland
Posts: 632
Dog Could you please explain Recipe Extraction using ControlLogix , RS Linx , and Excel ?

Good Morning ,

We had an equipment manufacture in last week. He always giving us a thumbdrive with the machine recipes . They are neatly in catagories with all the recipe settings in this machine. I understand that you go into RS Linx , select DDE / OPC , Topic Configuration , Drill down into your processor , Go into the Topic List and select PLC1 , then select Apply . The laptop I was using did not have Excel on it so I was not able to finish the process.

The real question is , I don't know how this works , and what all these processes are doing. All the recipes are so neatly in tabs , and discriptions
in excel. I imagine that the manufacture created this excel sheet before ,
but I don't see any data or paths in the cells , indicating a Controller Tag
or Program Tag.

Could you guys please explain this process , and technique . I would love to understand this so I can use it all over the plant.

Thanks so much for your help , like always.
  Reply With Quote
Old December 4th, 2017, 07:45 AM   #2
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,045
I would assume there is some VBA in the background that is handling the actual data exchange and building tags and such. Can you open the VBA editor in Excel? or is it locked?
  Reply With Quote
Old December 4th, 2017, 08:34 AM   #3
Rob S.
Member
United States

Rob S. is offline
 
Join Date: Sep 2008
Location: Maryland
Posts: 632
Can you open the VBA editor in Excel? or is it locked?

I'm sorry. I once knew , but I forgot. Where in Excel do you try to open the VBA Editor ?
  Reply With Quote
Old December 4th, 2017, 09:44 AM   #4
cwal61
Member
United States

cwal61 is online now
 
Join Date: Jan 2011
Location: NC
Posts: 980
Quote:
Originally Posted by Rob S. View Post
Can you open the VBA editor in Excel? or is it locked?

I'm sorry. I once knew , but I forgot. Where in Excel do you try to open the VBA Editor ?
Look under View>Toolbars>Visual Basic
  Reply With Quote
Old December 4th, 2017, 09:57 AM   #5
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,045
You'll have to enable the developer tab, it's not enabled by default.

File -> Options -> Customize Ribbon -> (Right side) check the "Developer" box.

Then go to Developer -> Visual Basic
  Reply With Quote
Old December 4th, 2017, 11:12 AM   #6
Rob S.
Member
United States

Rob S. is offline
 
Join Date: Sep 2008
Location: Maryland
Posts: 632
Thanks for the information. Yes. there is Visual Basic code . Below is it. I don't really see any code that describes which tag values grab .
----------------------------------------------------------------------------------------
Sub GetRecipes_Click()

'Display message box to confirm action.
Dim response As Integer
response = MsgBox(prompt:="Cancel to abort, OK to continue.", Buttons:=vbOKCancel)
'If 'Cancel' is selected, action terminates.
If response = vbCancel Then End
'Opens DDE link and continues routine of 'OK' is selected.
If response = vbOK Then RSIChan = DDEInitiate("RSLinx", "plc1")

'Change cursor to hourglass.
Application.Cursor = xlWait

'Clears Recipe Index on Controls page.
ClearIndex

'Uploads Recipe data from PLC.
GetRcpData



'Writes system date to Controls sheet.
GetDate

'Close dde link.
DDETerminate (RSIChan)

'Change mouse back to pointer.
Application.Cursor = xlDefault

Sheets("Controls").Cells(13, 2).Select

response = MsgBox(prompt:="Upload Complete.")

End Sub

Sub SendRecipes_Click()

'Display message box to confirm action.
Dim response As Integer
response = MsgBox(prompt:="Are you sure? Current PLC values will be overwritten.", Buttons:=vbOKCancel)

If response = vbCancel Then End
'If 'Cancel' is selected, action terminates.

If response = vbOK Then RSIChan = RSIChan = DDEInitiate("RSLinx", "PLC1")
'Opens DDE link and continues routine of 'OK' is selected.

Application.Cursor = xlWait
'Change cursor to hourglass.

'Clears Recipe Index on Controls page.
'Use Recipe name from Spreadsheet to re-populate Index.
ClearIndex

SendRcpData
'Writes Recipe data to PLC.

Application.DDETerminate (RSIChan)
'Close dde link.

Application.Cursor = xlDefault
'Change mouse back to pointer.

response = MsgBox(prompt:="Download Complete.")

End Sub

Sub SendSingleRecipe_Click()
'Display message box to confirm action.
Dim response As Integer
response = MsgBox(prompt:="Are you sure? Current PLC values will be overwritten.", Buttons:=vbOKCancel)

If response = vbCancel Then End
'If 'Cancel' is selected, action terminates.

If response = vbOK Then

Dim message, title As String
Dim response1 As Variant
' Set prompt.
message = "Enter a recipe between 0 and 31"
' Set title.
title = "Recipe Entry"

response1 = InputBox(message, title)
End If

If response1 >= 0 And response1 <= 31 Then
RSIChan = RSIChan = DDEInitiate("RSLinx", "PLC1")
Sheets("Controls").Cells(18, 12).Value = response1
Else
If response1 <= 0 Or response1 > 31 Then
Dim response2 As Integer
response2 = MsgBox(prompt:="Invalid Recipe Number Entered. Enter Recipe Number Between 0 and 31.", Buttons:=vbOKCancel)
End If
If response2 = vbOK Or response2 = vbCancel Then End
End If


Application.Cursor = xlWait
'Change cursor to hourglass.

'Clears Recipe Index on Controls page.
'Use Recipe name from Spreadsheet to re-populate Index.
'ClearIndex

SendSingleRcpData
'Writes Recipe data to PLC.

Application.DDETerminate (RSIChan)
'Close dde link.

Application.Cursor = xlDefault
'Change mouse back to pointer.

response = MsgBox(prompt:="Download Complete.")

End Sub
  Reply With Quote
Old December 4th, 2017, 12:39 PM   #7
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,045
I would look deeper into the two subroutines that are referenced:

SendRcpData, SendSingleRcpData
  Reply With Quote
Old December 5th, 2017, 11:51 AM   #8
dcooper33
Lifetime Supporting Member + Moderator
United States

dcooper33 is offline
 
dcooper33's Avatar
 
Join Date: Jun 2011
Location: Rogers, AR
Posts: 706
+1 to Paully's comment.
The subroutines mentioned are probably in a module, rather than in the code you see (probably for worksheet events or button clicks) when you open the VB editor.
Look in the solution explorer under "Modules" and you may find the subroutines that do the actual "DDEPoke" (PLC writes).
__________________
I'll walk a mile in your shoes. Now I'm a mile away, and I got your shoes.
  Reply With Quote
Old December 5th, 2017, 05:29 PM   #9
Rob S.
Member
United States

Rob S. is offline
 
Join Date: Sep 2008
Location: Maryland
Posts: 632
Thanks Guys . I will look at that tomorrow morning .
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
RS Linx To Excel Donnchadh LIVE PLC Questions And Answers 3 January 4th, 2010 01:15 PM
Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix vvcd LIVE PLC Questions And Answers 21 September 24th, 2009 10:04 PM
Which RS Linx would be best to use as a OPC Server Coachman LIVE PLC Questions And Answers 1 June 25th, 2008 01:44 PM
RS Linx Training Guide Myles LIVE PLC Questions And Answers 1 June 2nd, 2008 10:05 AM
"Error" Message In N7 Register On Rs Linx TRACY H LIVE PLC Questions And Answers 2 July 26th, 2004 09:45 PM


All times are GMT -5. The time now is 04:04 PM.


.