0% found this document useful (0 votes)
191 views3 pages

RSLogix L5K Import Export

VBA L5K Export Import How to use the library to generate PLC Code from excel. Simplify code generation by focusing only on what is important. Other details and code structure already taken care of by the library.

Uploaded by

Feri Handoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views3 pages

RSLogix L5K Import Export

VBA L5K Export Import How to use the library to generate PLC Code from excel. Simplify code generation by focusing only on what is important. Other details and code structure already taken care of by the library.

Uploaded by

Feri Handoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Installation
Copy FHLogixLib.dll into Windows\System32 or Windows\SysWow64 depending on type of
windows.
From the same folder run regsvr32 FHLogix.dll

2. Usage in Excel VBA


In VB editor, point reference to the Class Library for L5K file

3. Example
Sub DemoAddTag()
'demonstrate how to add a Bool tag into controller
Dim aNewTag As LogixTag
Dim aCtrl As New LogixController
strFileToOpen = Application.GetOpenFilename(Title:="Open RSLogix L5K Export File",
FileFilter:="L5K Files *.L5K* (*.L5K*),")
If Len(strFileToOpen) > 0 Then
Dim aCtrl As New LogixController
aCtrl.LoadConfigFile strFileToOpen 'load L5K to memory
'create a new tag:
Set aNewTag = New LogixTag
With aNewTag
.Name = "MYNEWTAG0001"
.DataType = "BOOL"
.Description = "My test tag" & vbCrLf & "Demonstrate use of dll"
End With
'now add this to controller
aCtrl.Tags.Add aNewTag
'save the config into a different file
strFileToOpen = Left(strFileToOpen, Len(strFileToOpen) - 4) & "_DEMO.L5K"
aCtrl.SaveConfigFile strFileToOpen

End If
End Sub

Result from running the above code:

This is the structure of aCtrl when debugged:

4. Possible uses:
Creating routine from a template
Creating tags
Creating UDT
Merging two different projects
Adding a lot of tag comments
Adding rung in routine based on templates
etc

You might also like