VB2012 RsiOPCAuto.OPCServer

SourceGin

Member
Join Date
Sep 2014
Location
Grottoes Va
Posts
7
I've Started a VB2012 Project Looking at a OPC Topic in Rslinx Just wanting my tag value to show up in TextBox1.Text Any Idea's why it isn't or anyone have a better Code base to accomplish this / (y)

'//Using RSiOPCAuto.dll

Imports RsiOPCAuto
Imports OPCAutomation
Imports Microsoft.Office


Public Class Form1
Dim MyOPC1 As RsiOPCAuto_OPCServer
Dim WithEvents OPCServer1 As RsiOPCAuto_OPCServer
Dim WithEvents OPCGroup1 As RsiOPCAuto_OPCGroup
Dim MyOPCItems() As RsiOPCAuto_OPCItems


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

'Dim OPCitems1 As ArrayList
MyOPC1 = New RsiOPCAuto_OPCServer
'OPCServer1 = New RsiOPCAuto_OPCServer
'OPCServer1.Connect("RSLinx OPC Server")
'OPCServer1.Connect("RSLinxEnterprise.OPCServer")
MyOPC1.Connect("RSLinx OPC Server")
OPCGroup1 = MyOPC1.OPCGroups.Add("REPORTING")
'ReDim OPCitems(1)
MyOPCItems(1) = OPCGroup1.OPCItems.GetOPCItem("[REPORTING]COUNTDATA2.ACC")
TextBox1.Text = MyOPCItems(1)
 
i have an Complete Completed Project for Logix 500 and XP i was trying to Re-Develop For Logix 5000 on VB.NET 2012
After 24 Hours Of Coding i have it solved for Logix 5000

Anyone need assistance on Development Please Don't hesitate to Contact me ("VB6 / Delphi / VB.NET / ASP.NET / C# / PHP / ASP / PYTHON / PERL / BATCHFILE / POWERSHELL ") in Automation

Currently working on a Python OPC Server and Client

'//----------------MY SNIPPIT--------------------------------
'Tagvalue1Txt.Text = DATAVALUE1.ACC

'This is run when when the called from the btnConnect_Click

'Define OPCTopic to create the proper format for the OPCTopic to look like [OPCTopic]
Dim OPCTopic As String
OPCTopic = ("[" & TopicTxt.Text & "]")
'Create a new instance of OPC Server and call it OPCServer1
OPCServer1 = New OPCServer

'Now connect to the OPC Server we just created
OPCServer1.Connect("RSLinx OPC Server")
'Create a new OPC Group in the previous defined OPC Server
OPCGroup1 = OPCServer1.OPCGroups.Add("REPORTING")

'Set the Group to the Active State for Updates and Events
OPCGroup1.IsActive = True

'Set the Update Rate of the OPCServer 1000 = 1 Second, which is the Default
OPCGroup1.UpdateRate = 500

'Instruct OPC Server to send OPC Group data Changes
OPCGroup1.IsSubscribed = True
'Add an Item / Address Point to the OPCGroup we just created
'"[RSLinx_Topic_Name]PhysicalAddress or Symbol if Symbols have been imported to RSLinx
'the ", 1" is the Client Handle RSLinx will get this first, the next one will be ", 2"
OPCGroup1.OPCItems.AddItem(OPCTopic & Tagvalue1Txt.Text, 0)

' OPCGroup1.OPCItems.AddItem(OPCTopic & "S:4", 2)
OPCServerConnected = True
End Sub
 
Unable to connect RSLINX Classic OPC using C#.NET

Hi

I am trying to create a test connection to RSLINX classic using C# code but I am getting exception when trying to connect.

Exception :{"E_NETWORK_ERROR\r\nCould not connect to server."}

InnerException: {"CoCreateInstanceEx: Class is not licensed for use\r\n"}

Please find attached screen for code related onformation and help me to sort out this issue.


Thanks,
Venkatesh Gude.

OPCError.jpg
 
I am trying to create a test connection to RSLINX classic using C# code but I am getting exception when trying to connect.

Exception :{"E_NETWORK_ERROR\r\nCould not connect to server."}

InnerException: {"CoCreateInstanceEx: Class is not licensed for use\r\n"}
My first guess is that you only have RSLinx Lite which is not licensed for OPC use.
 
Hi Archie,

I just have RSLinx Classic installed on my machine.

Does it mandatory to have RSLINX Oem or Pro versions to connect from .NET applications?

I also observed an exception related to referenced dll(Interop.RsiopcAuto.dll) when executing below line

RsiOpcAuto opcsrvr=new RsiOPCAuto_OPCServer();


Exception details :

Retrieving the COM class factory for component with CLSID {DFB8323C-A952-11D2-A46B-00C04F796375} failed due to the following error: 80040154.

please suggest ways to get rid of this problem.

Thanks,
 

Similar Topics

Hi all , What im attempting to To is to have my RsiOPCauto.DLL in which has been Added to my VB2010 Solution and Connect to a remote RSLinx...
Replies
0
Views
2,572
Hi all. I am creating a dotnet application with RsiOPCAuto.dll, and I have managed to read and write tags value. But today when I wanted to...
Replies
5
Views
2,357
Hi I am trying to retrive RSLINX data from c#.net application. I have refenced my .Net application to Interop.RSIOPCAUTO.dll. But when trying to...
Replies
3
Views
2,567
hi, I want to see if anyone can help me find a bit that indicates Status Online or Offline connection OPC server "OpenBSIOPCServer" Bristol...
Replies
0
Views
1,342
Hello to all, I am trying to collect some data by using OPC Server from few different systems and put them together. I have problem with one of...
Replies
0
Views
3,498
Back
Top Bottom