Export UDT to excel and modify values

Need more info on how you succeeded

Thanks for the tips guys!

As it turns out, the DDE option is ridiculously easy. With the help of this article I got it working in no time!

For anyone following along in the future, here's my code structure. My DDE topic was called EXCEL, and the data was in columns A through F, starting at Row 2.
Code:
Private Function OpenRSLinx()
    On Error Resume Next
    
    'Open the connection to RSLinx
    OpenRSLinx = DDEInitiate("RSLINX", "EXCEL")
    
    'Check if the connection was made
    If Err.Number <> 0 Then
        MsgBox "Error Connecting to topic", vbExclamation, "Error"
        OpenRSLinx = 0 'Return false if there was an error
    End If
    
End Function

Private Sub CommandButton1_Click()

On Error GoTo ErrorHandling

    rslinx = OpenRSLinx() 'Open connection to RSlinx

'Loop through the cells and write values to the array tags
    For i = 0 To 299
            DDEPoke rslinx, "Recipe_DB[" & i & "].ID", Cells(2 + i, 1)
            DDEPoke rslinx, "Recipe_DB[" & i & "].Name", Cells(2 + i, 2)
            DDEPoke rslinx, "Recipe_DB[" & i & "].Qty1", Cells(2 + i, 3)
            DDEPoke rslinx, "Recipe_DB[" & i & "].Tol1", Cells(2 + i, 4)
            DDEPoke rslinx, "Recipe_DB[" & i & "].Qty2", Cells(2 + i, 5)
            DDEPoke rslinx, "Recipe_DB[" & i & "].Tol2", Cells(2 + i, 6)
    Next i
    
'Terminate the DDE connection
    DDETerminate rslinx
Exit Sub

ErrorHandling:
    MsgBox "Error Writing Data", vbExclamation, "Error"
    DDETerminate rslinx
End Sub

Thanks!

What version of Windows do you have? Win7? XP? Is it 32bit or 64bit?
What version of RSLinx are you using? Which version of RSLogix5000?
 
What version of Windows do you have? Win7? XP? Is it 32bit or 64bit?
What version of RSLinx are you using? Which version of RSLogix5000?

It was a while ago, but I *think* at the time I was using Windows 8.1 64 bit. RSLinx, I have no idea. RSLogix 5000 is irrelevant as it has nothing to do with this trick; data goes straight from excel>RSLinx>PLC.

It was pretty straightforward and worked for me almost straight away, so I don't have a lot of tips and tricks that I learned to make it work.

Do you have the full (licensed) version of RSLinx, or the Lite version? If you only have Lite, you will never make it work.
 
Hi everybody,
i have a Little Problem. I have 1000 tags in my Studio 5000 Project and I want to Group them. For example that 100 are in one Group. Do I have to use a udt? And is there an easy and fast way to make this? Because it would take me a Long time to add 100 tags ^^
Thanks
 
A UDT is a Data Type created by the User. Like a DINT or STRING is a Data Type. A UDT Can Be Used to Create a Group of Data Types under one name. Example: I create a Data Type called HISTORY. In HISTORY I want to have a serial number of a part, a timestamp for that part and a Part Number.

So I could use a 100 DINT array for my Serial Numbers, a 100 STRING array for My Timestamps And a 100 DINT array for my Part Numbers.

Once I make that series of tags under History UDT then my tag structure would look like this If I Create a Tag Call MYHISTORY.
MYHISTORY.SerialNumber[100]
MYHISTORY.Timestamp[100]
MYHISTORY.PartNumber[100]

Now when I use MYHISTORY tag in my program. I would use MYHISTORY.SerialNumber[1] or MYHISTORY.Timestamp[1] or MYHISTORY.PartNumber[1] or whatever array number I needed.

So your existing tag names would not fall in this data structure so creating a UDT would require you to change all your tags in your program to the new data structure of the UDT.

There is no way to take 100 existing independent tag names and group them into one structure. Because when you create the Tag of the UDT it creates the structure. In your case if I made an array called MYHISTORY[10] and set the data type as HISTORY. I just created 1000 new tags.

Note: You should have started a new thread instead of using this old one you might would have received quicker responses.
 
Last edited:
Hello everyone!

I have an UDT array in Control Logix, similar as in ASF's example, but i think i'm missing something, because i took his example, i paste it into my excel, i modified the tag name, but i still don't get nothing.

Can you please explain a little bit more how to get my UDT values?

Thank you!

Now, I have same issue as "caponegl", and I am using RSLinxClassic Gateway, ver3.8.

any suggestion? what did I missed?
appreciate your response in advance.
 

Similar Topics

Does anybody know of a way to export tags from Logix Designer and have it expand the UDTs into individual tag names? For example, say I have a...
Replies
5
Views
1,722
Hi, Im wanting to know if its possible to export a recipe UDT into excel to allow manipulation of the recipe, and then to be able to import it...
Replies
5
Views
3,610
Anyone know how to export and Import UDT Comments only? I have a file that has all the latest and greatest commnets but does not have the...
Replies
4
Views
2,687
How can I export a UDT from a offline V13 project. It does not appear to ave the ability to export in that version. Is there a work around?
Replies
4
Views
2,552
Hey all, What I'm looking to do is import RSLogix5000 UDT into a V16 program that was originally created and exported from a v18 program. It...
Replies
2
Views
2,210
Back
Top Bottom