RSView and OPC program.

MaxVon

Member
Join Date
Jan 2009
Location
Bend
Posts
1
Having some issues getting my code to add items to my collections in VB6. I have an OPC Topic called "PLC_1" with about 418 tags.. I need to only access a few of them.

On the RSView_Data is a primary Item RSView_Data with subitems that I need to access to read and write data to. My code works great up to where I need to start adding those sub items...
Not sure how to accomplish this... I thought I had a handle on groups,and Items etc...

Option Explicit
Option Base 1
Private WithEvents AnOPCServer As RsiOPCAuto_OPCServer
Private WithEvents AnOPCGroup As RsiOPCAuto_OPCGroup
Private WithEvents AnOPCGroups As RsiOPCAuto_OPCGroups
Dim AnOPCItem As RsiOPCAuto_OPCItem
Dim AnOPCItems As RsiOPCAuto_OPCItems
Private Sub Form_Load()
Dim icount As Long
Dim sMsg As String
Dim dTime As Date
On Error GoTo ErrorHandler
'On Error Resume Next
Me.Caption = Me.Caption & " v" & App.Major & "." & App.Minor & " Build " & App.Revision
'Set server
Set AnOPCServer = New RsiOPCAuto_OPCServer
AnOPCServer.Connect "RSLinx OPC Server", "PLC_1"
dTime = AnOPCServer.CurrentTime
Label1.Caption = dTime
'Set Groups
Set AnOPCGroup = AnOPCServer.OPCGroups.Add("PLC_1")
AnOPCGroup.OPCItems.De faultAccessPath = "PLC_1"
AnOPCGroup.UpdateRate = 100
AnOPCGroup.IsSubscribed = True
AnOPCGroup.OPCItems.DefaultIsActive = True
AnOPCGroup.OPCItems.AddItem "RSView_Data", 1
AnOPCGroup.OPCItems.AddItem "RSView_Status_Bits", 2
'Code works great up to this point.
' I need to add the items below RSView_Data to the AnOPCGroup.OPCItem "RSView_Data"
' Not sure how to accomplish this... I thought I had a handle on groups,and Items etc...
'This shows under RSView_Data in Tag Names under DataTable Monitor of RSLinx...
' RXView_Data (has the following sub items.)
'+ RSView_Data
' |- RSView_Data(0)
' |- RSView_Data(1)
' |- RSView_Data(2)
' etc etc...
icount = AnOPCServer.OPCGroups.Count
 

Similar Topics

Can anybody help me to know it that whether there is any communication :tod:
Replies
0
Views
2,202
I am very new to the rockwell allen bradley system. I am using another scada to fetch the data from RSView Supervisory Edition, Version4, CPR7...
Replies
0
Views
2,333
I am using RSView Studio to develop an ME project. When I tried to add RSLinx (Classic) as an OPC data server and clicked on Browse I got this...
Replies
1
Views
7,329
Hi, I want to know that In remote opc mode, Rsview32 supports synchronous OPC connection or asynchronous OPC connection.
Replies
0
Views
2,009
Dear Experts We are using 4 Rsview stations communicating with redundant contrologix having rev 13 on a LAN. We need help in following 4...
Replies
1
Views
3,744
Back
Top Bottom