Could you please explain Recipe Extraction using ControlLogix , RS Linx , and Excel ?

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
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.
 
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?
 
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 ?
 
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
 
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
 
I would look deeper into the two subroutines that are referenced:

SendRcpData, SendSingleRcpData
 
+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).
 

Similar Topics

Just for readers in the US, when I write 'gas' I mean it as a state of matter, not shorthand for gasoline :-) I don't understand the logic of a...
Replies
39
Views
11,073
Good Morning , Could you please explain to me what a S:FS is , what the purpose of it is and why would it be used in a rung. Thanks so much.
Replies
4
Views
1,634
Good Afternoon , We have a number of Kinetix 6000 Servo Drives and motors. I'm trying to understand these a little ( really alot ) better...
Replies
16
Views
6,198
Good Afternoon , We have a new machine from Italy , and for some reason , the servo actual positions quit updating on the HMI. I looked at...
Replies
6
Views
1,699
Hello, I started my new job at a factory and I found that when I opened the PLC cabinet there are "ABB contactors" that are connected to the PLC...
Replies
9
Views
3,279
Back
Top Bottom