You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 30th, 2014, 07:09 PM   #1
SourceGin
Member
United States

SourceGin is offline
 
Join Date: Sep 2014
Location: Grottoes Va
Posts: 7
Fancy Exclamation VB2012 RsiOPCAuto.OPCServer

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 /

'//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)
  Reply With Quote
Old October 1st, 2014, 09:01 AM   #2
danatomega
Lifetime Supporting Member
United States

danatomega is offline
 
Join Date: Mar 2011
Location: Dayton OH
Posts: 789
You have a lot of things commented out in your code that you may need.

This site has a VB.Net 2008 version for reference:
http://industrial-software.blogspot....th-visual.html
  Reply With Quote
Old October 1st, 2014, 11:58 AM   #3
SourceGin
Member
United States

SourceGin is offline
 
Join Date: Sep 2014
Location: Grottoes Va
Posts: 7
VB2012 RsiOPCAuto.OPCServer

Actually i don't those were just tests , i have it Working now thanks for your reply
  Reply With Quote
Old October 1st, 2014, 12:36 PM   #4
danatomega
Lifetime Supporting Member
United States

danatomega is offline
 
Join Date: Mar 2011
Location: Dayton OH
Posts: 789
Can you share what you did to solve the issue?
  Reply With Quote
Old October 1st, 2014, 01:41 PM   #5
SourceGin
Member
United States

SourceGin is offline
 
Join Date: Sep 2014
Location: Grottoes Va
Posts: 7
Talking VB2012 RsiOPCAuto.OPCServer

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
  Reply With Quote
Old October 1st, 2014, 02:23 PM   #6
danatomega
Lifetime Supporting Member
United States

danatomega is offline
 
Join Date: Mar 2011
Location: Dayton OH
Posts: 789
Thanks for sharing!
  Reply With Quote
Old July 18th, 2016, 05:51 AM   #7
venkatgude90
Member
India

venkatgude90 is offline
 
Join Date: Jul 2016
Location: Pune
Posts: 4
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.
Attached Images
File Type: jpg OPCError.jpg (55.2 KB, 18 views)
  Reply With Quote
Old July 18th, 2016, 07:17 AM   #8
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,772
Quote:
Originally Posted by venkatgude90 View Post
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.
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old July 18th, 2016, 07:44 AM   #9
venkatgude90
Member
India

venkatgude90 is offline
 
Join Date: Jul 2016
Location: Pune
Posts: 4
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,
  Reply With Quote
Old July 18th, 2016, 07:53 AM   #10
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,772
Quote:
Originally Posted by venkatgude90 View Post
I just have RSLinx Classic installed on my machine.

Does it mandatory to have RSLINX Oem or Pro versions to connect from .NET applications?
Yes. RSLinx Lite (the version that comes with RSLogix) will not work
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:38 AM.


.