VBA with control Logix

enault

Member
Join Date
Jun 2008
Location
house
Posts
35
here is our setup
we are using Factory talk view Se HMI that communicate with Control Logix PLC via RsLinx Enterprise

im searching for a way to save backup file using the FTView Se Built in Visual basic

the only way i know to read data in the PLC is actually to put a NumericDisplay in a FTView display and them im able to interact with the NumericDisplay.Value

the data i need to read is 6 array of about 800 entry each
there is a string array and 5 Dint array

using my previous method to read this i would need to put a field in a HMI dispaly for each tag i need

So what would be the best Way to connect to the Control Logix PLC directly from the VBA?
 
What i've find out

The following code is what i've found out that could be use within the FTView Se VBA

But this require a Rslinx liscense Higher than Lite That's the main reason why we'll not be using this solution

its also required to add this reference to the VBA project
"Microsoft Excel 12.0 Object library"
Im not sure if this library is avalaible without Excel installed There must be some way to add a few Dll to make this avalaible anyway

We will not go further with this solution for the reason mentionned above

Im still searching for a Way to interact With VBA and control Logix Costless But i guess that rockwell have blocked all those feature to allow them to sell more software. I Hate this marketing strategy.


Private Sub Button2_Released()
Dim TagName As String
Dim TopicName As String
Dim TagValue As Variant
Dim Dummy
Dim COMObject

'The topic name must be define in RSLinx
TopicName = "Test"

TagName = "Alarms_Control.LedDisplayAlarmMessage"
COMObject = DDEInitiate("RSLinx", TopicName)
Dummy = Array(3)
Dummy = DDERequest(COMObject, TagName)

'The DDEPoke command is used to write value to the
'controler this seems to be premade to use Excel Cell data type
'Tag Value Must Be a Variant to write DInt
'I havn't been able to write to a control Logix string
'DDEPoke COMObject, TagName, TagValue

'This Same Command used in an Excel Sheet VBA Work Great with prety much any data type
'DDEPoke COMObject, TagName, ActiveSheet.Cells(7, 13)


If IsError(Dummy) Then
MsgBox "Error"
Else
MsgBox Dummy(1)
End If
DDETerminate COMObject
End Sub
 
You have other options for DDE/OPC to ControlLogix, some commercial (Kepware, Software Toolbox, etc), and some open source options that I don't know much about.

Software is a tool, expect to have to pay for it.

Another option, is to write the data-transfer routines in RSView SE itself, which will communicate with Linx directly. (Or use the existing licensed Linx Enterprise).
 

Similar Topics

Good evening, I'll start by explaining what i want to do and then what I've tried. We have an excel document at work that contains our material...
Replies
4
Views
2,288
Hi all I am trying to write an array in PLC from my excel data base below is code Sub Update() Dim Test_array_Src() As String RSlinx =...
Replies
11
Views
3,240
Hello I am trying to add picture via activex control (Microsoft Forms 2.0 Image) my command is "Image1.Picture = LoadPicture("C:\aaa.bmp")" but...
Replies
0
Views
1,503
Has anyone encountered this, Not being able to select VBA Control in the Property panel of any object. I have a screen that was developed by...
Replies
0
Views
1,875
I have a CPR7 RSView application that I can not expose a string input control to VBA so that I can write the value to a .csv file. Here is what I...
Replies
0
Views
3,320
Back
Top Bottom