Connecting to b+b automations CCEIB OPC Server

376 visualizações
Pular para a primeira mensagem não lida

The Bartman

não lida,
5 de ago. de 2011, 13:22:2905/08/2011
para openSCADA, b...@telenet.be
Hi,

I am trying to write a opc client in java.
I tried using the openSCADA utgard to connect to the b+b automations
CCEIB OPC Server.
The client is not able to connect to the server.
I noticed a port number is needed. Does anybody know how i can find
this port number.

(A few years ago i made a delphi program with the demo version of the
dOPC component. There only the clsid was needed to connect to the
server.)

Does anybody know if it is possible to connect to this opc server? And
if so, how?

PS: I also tried a client demo of the JEasyOPC package for java. There
i have the same problem.

Jens Reimann

não lida,
6 de ago. de 2011, 05:06:0806/08/2011
para open...@googlegroups.com

Where do you need to put a port number?

The Bartman

não lida,
6 de ago. de 2011, 15:02:5806/08/2011
para openSCADA
I first tried this code:

------
final ConnectionInformation ci = new ConnectionInformation ();
ci.setHost ("localhost");
ci.setDomain ("default");
ci.setUser ("");
ci.setPassword ("");
ci.setClsid ( "D31DBAD1-0632-11D4-A6B8-00600868B157" );
final Server server = new Server ( ci, new
ScheduledThreadPoolExecutor(2));
final AutoReconnectController autoReconnectController = new
AutoReconnectController ( server );
autoReconnectController.connect ();
------

That gave this error:


------

INFO:
Recieved FAULT
609 [OPCReconnectThread] INFO org.openscada.opc.lib.da.Server - Failed
to connect to server
org.jinterop.dcom.common.JIException: Access is denied, please check
whether the [domain-username-password] are correct. Also, if not
already done please check the GETTING STARTED and FAQ sections in
readme.htm. They provide information on how to correctly configure the
Windows machine for DCOM access, so as to avoid such exceptions.
[0x00000005]
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:572)
at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:
481)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:445)
at org.openscada.opc.lib.da.Server.connect(Server.java:117)
at
org.openscada.opc.lib.da.AutoReconnectController.performReconnect(AutoReconnectController.java:
217)
at org.openscada.opc.lib.da.AutoReconnectController.access
$3(AutoReconnectController.java:190)
at org.openscada.opc.lib.da.AutoReconnectController
$1.run(AutoReconnectController.java:173)
at java.lang.Thread.run(Unknown Source)
Caused by: rpc.FaultException: Received fault. (unknown)
at
rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:
141)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:568)
... 7 more
609 [OPCReconnectThread] INFO org.openscada.opc.lib.da.Server -
Destroying DCOM session...
------



then i tried this code:


------
final ConnectionInformation ci = new ConnectionInformation ();
ci.setProgId("CCEIBOPCServer.1");
ci.setHost ("localhost");
final Server server = new Server ( ci, new
ScheduledThreadPoolExecutor(2));
final AutoReconnectController autoReconnectController = new
AutoReconnectController ( server );
autoReconnectController.connect ();
------


And gives this error:


------
6344 [OPCReconnectThread] INFO org.openscada.opc.lib.da.Server -
Failed to connect to server
org.jinterop.dcom.common.JIException: Message not found for errorCode:
0xC0000022
at
org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:
115)
at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:
130)
at
org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:
162)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:
413)
at org.openscada.opc.lib.da.Server.connect(Server.java:
123)
at
org.openscada.opc.lib.da.AutoReconnectController.performReconnect(AutoReconnectController.java:
217)
at org.openscada.opc.lib.da.AutoReconnectController.access
$3(AutoReconnectController.java:190)
at org.openscada.opc.lib.da.AutoReconnectController
$1.run(AutoReconnectController.java:173)
at java.lang.Thread.run(Unknown
Source)
Caused by: jcifs.smb.SmbAuthException: Access is
denied.
at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:
510)
at jcifs.smb.SmbTransport.send(SmbTransport.java:
622)
at jcifs.smb.SmbSession.send(SmbSession.java:
239)
at jcifs.smb.SmbTree.send(SmbTree.java:
109)
at jcifs.smb.SmbFile.send(SmbFile.java:
718)
at jcifs.smb.SmbFile.open0(SmbFile.java:
923)
at jcifs.smb.SmbFile.open(SmbFile.java:
940)
at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:
142)
at
jcifs.smb.TransactNamedPipeOutputStream.<init>(TransactNamedPipeOutputStream.java:
32)
at jcifs.smb.SmbNamedPipe.getNamedPipeOutputStream(SmbNamedPipe.java:
187)
at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:
92)
at rpc.Stub.attach(Stub.java:
106)
at rpc.Stub.call(Stub.java:
110)
at
org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:
113)
... 8
more
------


In the sample code i fond this: ConnectionInformation.fromURI
( "da:net://localhost:1202" );
That's why i thought i needed an port number.

On the other hand in JEasyOPC this works. No portnumber and no
username or password

------
// JCustomOPC Clients
test
try
{

JOpc.coInitialize();
JOpc jopc = new JOpc("localhost", "CCEIBOPCServer.1",
"JCustomOPC");


jopc.connect();
while (true)
{

Thread.sleep(200);
System.out.println("Client is connected: " +
jopc.ping());
iter+
+;
if (iter == 5)
{

break;
}
}

JOpc.coUninitialize();
}
------


Any Idea what i'm doing wrong in the openscada source.
On Aug 6, 11:06 am, Jens Reimann <ctron1...@gmail.com> wrote:
> Where do you need to put a port number?

The Bartman

não lida,
6 de ago. de 2011, 15:06:2506/08/2011
para openSCADA
First I tried this:

final ConnectionInformation ci = new ConnectionInformation ();
ci.setHost ("localhost");
ci.setDomain ("default");
ci.setUser ("");
ci.setPassword ("");
ci.setClsid ( "D31DBAD1-0632-11D4-A6B8-00600868B157" );
final Server server = new Server ( ci, new
ScheduledThreadPoolExecutor(2));
final AutoReconnectController autoReconnectController = new
AutoReconnectController ( server );
autoReconnectController.connect ();

This gave me this error:
Then I tried this code:

final ConnectionInformation ci = new ConnectionInformation ();
ci.setProgId("CCEIBOPCServer.1");
ci.setHost ("localhost");
final Server server = new Server ( ci, new
ScheduledThreadPoolExecutor(2));
final AutoReconnectController autoReconnectController = new
AutoReconnectController ( server );
autoReconnectController.connect ();

That gavv me this error:
In the sample code i fond this:

ConnectionInformation.fromURI ( "da:net://localhost:1202" );

That's wy i tought i needed an port number.

On the other hand in JEasyOPC this works. No portnumber and no
username or password

// JCustomOPC Clients
test
try
{

JOpc.coInitialize();
JOpc jopc = new JOpc("localhost", "CCEIBOPCServer.1",
"JCustomOPC");


jopc.connect();
while (true)
{

Thread.sleep(200);
System.out.println("Client is connected: " +
jopc.ping());
iter+
+;
if (iter == 5)
{

break;
}
}

JOpc.coUninitialize();
}

Any Idea what i'm doing wrong in the openscada source.



On Aug 6, 11:06 am, Jens Reimann <ctron1...@gmail.com> wrote:
> Where do you need to put a port number?

Jens Reimann

não lida,
6 de ago. de 2011, 15:43:5606/08/2011
para open...@googlegroups.com

So you get access denied! Is your windows set up properly for DCOM?

The Bartman

não lida,
6 de ago. de 2011, 18:52:3906/08/2011
para openSCADA
That was my first thought too.

But it already used to work for my Delphi dOPC project.
Then i checked with the info i found here:
http://clifcarr.blogspot.com/2011/02/readwrite-to-opc-serverplc-register.html.
And everything was already like in these screenshots.
Also the JEasyOPC seems to connect, although I didn't succeed in
retrieving any data jet.

On Aug 6, 9:43 pm, Jens Reimann <ctron1...@gmail.com> wrote:
> So you get access denied! Is your windows set up properly for DCOM?
> Am 06.08.2011 21:02 schrieb "The Bartman" <b.herm...@gmail.com>:
>
>
>
>
>
>
>
> > I first tried this code:
>
> > ------
> > final ConnectionInformation ci = new ConnectionInformation ();
> >ci.setHost("localhost");
> >ci.setDomain("default");
> >ci.setUser("");
> >ci.setPassword("");
> >ci.setClsid( "D31DBAD1-0632-11D4-A6B8-00600868B157" );
> > final Server server = new Server ( ci, new
> > ScheduledThreadPoolExecutor(2));
> > final AutoReconnectController autoReconnectController = new
> > AutoReconnectController ( server );
> >autoReconnectController.connect();
> > ------
>
> > That gave this error:
>
> > ------
>
> > INFO:
> > Recieved FAULT
> > 609 [OPCReconnectThread] INFOorg.openscada.opc.lib.da.Server- Failed
> > to connect to server
> >org.jinterop.dcom.common.JIException: Access is denied, please check
> > whether the [domain-username-password] are correct. Also, if not
> > already done please check the GETTING STARTED and FAQ sections in
> >readme.htm. They provide information on how to correctly configure the
> > Windows machine for DCOM access, so as to avoid such exceptions.
> > [0x00000005]
> > atorg.jinterop.dcom.core.JIComServer.init(JIComServer.java:572)
> > atorg.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:
> > 481)
> > atorg.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:445)
> > atorg.openscada.opc.lib.da.Server.connect(Server.java:117)
> > at
>
> org.openscada.opc.lib.da.AutoReconnectController.performReconnect(AutoReconnectController.java:
>
>
>
>
>
>
>
> > 217)
> > atorg.openscada.opc.lib.da.AutoReconnectController.access
> > $3(AutoReconnectController.java:190)
> > atorg.openscada.opc.lib.da.AutoReconnectController
> > $1.run(AutoReconnectController.java:173)
> > atjava.lang.Thread.run(Unknown Source)
> > Caused by: rpc.FaultException: Received fault. (unknown)
> > at
> >rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:
> > 141)
> > atrpc.Stub.call(Stub.java:113)
> > atorg.jinterop.dcom.core.JIComServer.init(JIComServer.java:568)
> > ... 7 more
> > 609 [OPCReconnectThread] INFOorg.openscada.opc.lib.da.Server-
> > Destroying DCOM session...
> > ------
>
> > then i tried this code:
>
> > ------
> > final ConnectionInformation ci = new ConnectionInformation ();
> >ci.setProgId("CCEIBOPCServer.1");
> >ci.setHost("localhost");
> > atjcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:

Jens Reimann

não lida,
7 de ago. de 2011, 10:16:2507/08/2011
para open...@googlegroups.com

Are you using remote access (DCOM) or local access (COM) with your test? Can you connect from a remote computer using the same settings?

Bart Hermans

não lida,
7 de ago. de 2011, 15:39:2707/08/2011
para open...@googlegroups.com
Never tried to connect from another computer. I'm trying this on the same xp computer as the one where the eib server is running (and is connected to a eib weichte usb)

>> > €2,12 ($3)(AutoReconnectController.java:190)
>> > atorg.openscada.opc.lib.da.AutoReconnectController
>> > €0,71 ($1).run(AutoReconnectController.java:173)
>> > €2,12 ($3)(AutoReconnectController.java:190)
>> > atorg.openscada.opc.lib.da.AutoReconnectController
>> > €0,71 ($1).run(AutoReconnectController.java:173)

Jens Reimann

não lida,
7 de ago. de 2011, 17:15:5607/08/2011
para open...@googlegroups.com

Yes, but jinterop and utgard are connecting using DCOM even if it is local.

Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem