Utgard examples

2,188 views
Skip to first unread message

Guillecs

unread,
Apr 21, 2011, 5:01:06 AM4/21/11
to OpenSCADA
Hi... I´m trying to connect MatrikonOPC universal server to a JAVA
client. I´m using Jinterop libraries. I think Utgard would be useful
for me but i´m quite noob :s . I can not open the examples, actually i
don´t know if i´ve got the examples right. Would be nice any kind of
help ^^. I´m not really a pro in JAVA programming T_T .

Thanks in advance!!

Regards!

Guillecs

unread,
Apr 21, 2011, 9:33:36 AM4/21/11
to OpenSCADA
hi again... Is there any documentation about Utgard i can use for my
porpouse?

TX!!! ;)

Regards

Guillecs

unread,
Apr 21, 2011, 1:23:44 PM4/21/11
to OpenSCADA

YEY! I managed to connect to the opc with utgard! im quite happy, i
tried to import some items and check their status and it is working.
The thing now is that i dont know how to import the groups that i
already have in the opc. i tried this:

Group inputGroup = s.findGroup("Inputs"); -->inputs is my
group name in the opc
inputGroup.read(true, items); --> i defined items as a
string
System.out.println(items[0].read(true).getValue());

I had an error in the first line... T_T

I dont know what is wrong actually...

Tx!!

Regards

tomatensaft

unread,
Apr 28, 2011, 2:21:11 AM4/28/11
to OpenSCADA
Hello Guillecs,

i would also use the Utgard OPC-Client too, i'm interested in your
connection code.

Please could you post it here ?

Thanks in advance

Guillecs

unread,
May 2, 2011, 5:24:29 AM5/2/11
to OpenSCADA
Hi!

I dont know if this is what you are looking for:

ConnectionInformation connectionInformation = new
ConnectionInformation(user, password);
connectionInformation.setHost(ip); // computer where the opc
server is installed
Server s = new Server(connectionInformation,new
ScheduledThreadPoolExecutor(10));
connectionInformation.setClsid(CLSiD); //The CLSiD of the opc
server
s.connect();

Tell me if you need something else...

By now, im able to create groups of signals, search and check their
state...

Regards

tomatensaft

unread,
May 4, 2011, 6:45:30 AM5/4/11
to OpenSCADA
Hello,

thanks for the code, i had a Problem with the SheduledThreadExecutor -
but solved now.

Can you tell me please how do i get the CLSID from the OPC Server ?

thx

Guillecs

unread,
May 5, 2011, 6:14:39 AM5/5/11
to OpenSCADA
Hi! Well,,, it depends of what OPC you are using.. im using
MatrikonOPC universal server... so i think its different if you are
using other opc server... in case you are using it, if you go to the
matrikon explorer and you right click on the server and click
properties you can see the CLSiD...

Anyways i have installed the server in a few computers and the CLSiD
is the same for all of them. Maybe is the same for you too: "D7CA0556-
C317-4512-8B8C-7543DD7F1626"

Hope you find this useful... if you have more question just ask!

regards!

Jens Reimann

unread,
May 6, 2011, 2:01:36 PM5/6/11
to open...@googlegroups.com

You can also open a connection using the more readable ProgId

Am 05.05.2011 12:14 schrieb "Guillecs" <guill...@gmail.com>:

tomatensaft

unread,
May 16, 2011, 12:55:34 AM5/16/11
to OpenSCADA
Hello,

thanks for your anserwers, but well i get no no connection to my OPC
Server...


i use the wonderware DassiDirect - ProgID -
connectionInformation.setProgId("ArchestrA.DASSIDirect.1");

When i execute it then i get some Errors ->

Exception in thread "main" org.jinterop.dcom.common.JIException: The
system cannot find the file specified. Please check the path provided
as parameter. If this exception is being thrown from the WinReg
package, please check if the library is registered properly or do so
using regsvr32. [0x00000002]
at
org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:
184)
at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:123)
at
org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:
154)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:395)
at org.openscada.opc.lib.da.Server.connect(Server.java:123)
at OpcConnectors.OpcConnect.main(OpcConnect.java:33)
Caused by: org.jinterop.dcom.common.JIRuntimeException: The system
cannot find the file specified. Please check the path provided as
parameter. If this exception is being thrown from the WinReg package,
please check if the library is registered properly or do so using
regsvr32. [0x00000002]
at org.jinterop.winreg.IJIWinReg$openKey.read(IJIWinReg.java:939)
at ndr.NdrObject.decode(NdrObject.java:19)
at
rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:
138)
at rpc.Stub.call(Stub.java:112)
at
org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:
178)
... 5 more

I've looked at the JInteropt-Site but i didnt found anything - only
maybe the the ports are not open.

Ports are open and the Server is running at my localhost, i get Acees
from other Programs - Well you have some more advices for me ?

Thanks


On 6 Mai, 20:01, Jens Reimann <ctron1...@gmail.com> wrote:
> You can also open a connection using the more readable ProgId
> Am 05.05.2011 12:14 schrieb "Guillecs" <guillec...@gmail.com>:

Guillecs

unread,
May 16, 2011, 12:43:10 PM5/16/11
to OpenSCADA
Hi!

I dont really know what can be your problem...

I change the code to connect to the server... im using this instead
the other one:

JISession _session = null;
_session = JISession.createSession(ip, user, password);
JIComServer comServer = new
JIComServer(JIClsid.valueOf(CLSiD), ip, _session);
IJIComObject serverObject = comServer.createInstance();
OPCServer server = new OPCServer(serverObject);

You can try....

Regards

ctron

unread,
May 18, 2011, 7:11:40 AM5/18/11
to open...@googlegroups.com
Well if you have a look at the error message it says that the path cannot be found (registry path). And that the COM component might not be registered property. Now this might be a) a security problem that the user you are using to connect is not allowed to remotely access the windows registry from the network or b) the COM component (OPC server) actually IS not registered properly with this name.

Can you check if you can access the OPC server from a second computer over the network using the same user credentials and using the same prog id?!

Gaurav Thawrani

unread,
Nov 7, 2012, 2:06:59 PM11/7/12
to open...@googlegroups.com
Hello Guillecs,

Could you give me any references that you must have used to get it to work? I've been rattling my brains over this for a while now and I don't seem to be getting anywhere. I'm have practically no knowledge of DCOM or OPC, so I'm a full fledged beginner in this.

Any help would be greatly appreciated.

Thanks!

Rvip

unread,
May 24, 2015, 8:19:21 PM5/24/15
to open...@googlegroups.com

Hi Guillec,

I was trying to find information about Java and OPC servers and came across with this group.Well, I am trying to create a GUI using Eclipse to display current count of boxes in a process line using a single tag that i created in the server.I installed the KEPware.KEPServerEx.V5 demo which i can use for 2 hours and I also installed the Eclipse IDE and downloaded all the plugins and library as explain here:    https://openscada.atlassian.net/wiki/display/OP/HowToStartWithUtgard. All this done in the same computer as it is very difficult to get necessary permission to use the network from IT department.
Well have encounter many issues:
  1. When I assign the variable ci to the function ConnectionInformation().  ConnectionInformation ci= new Connection Information().  I pass the following value:s ci.seHost("name of my computer host which i found with the command prompt "); ci.setDomain("i don't know what to put here since i am using my own computer");ci.setUser("my computer's name"); ci.setPassword("i did not put anything here");ci.setProId("KEPware.KEPServerEx.V5"). I dont even know if this is actually needed. What do you recommend since i am using the same computer for the server and the client.
  2. I then declare the server as: final server server=new Server(ci,Executors.newSingleThreadScheduledExecutor())The first bug that i have is the execution of the connect instruction.   server.connect()..  and them from here on everythng is not working.
How can i get the values of my tags in the server.For example  for the simulated tag named: "Simulation Examples.Functions.Ramp1".  Could you please help me solve the connecting issue and help me with the code for getting the data from the tag. Ihave no experience with this environment. Them i will try to incorporate the value of the tag in a label in the GUI and compute some results based on that value which i don't know neither but i will try to figure it out later.

Many thanks.

Spotti Malotti

unread,
Jun 23, 2015, 1:48:34 AM6/23/15
to open...@googlegroups.com
Hallo Guillecs

Can you help me with the declaration of the items object in your code ?

regards

Reply all
Reply to author
Forward
0 new messages