Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

XBase++ and WriteItemValue

More
01 Nov 2011 08:50 #590 by support
The correct value for the MachineName argument is just the name of the computer, or its numerical IP address, without additional prefixes such as “opc.tcp://”.
In your case, it would mean either

oOpc:ReadItemValue("jds-vista","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")

or

oOpc:ReadItemValue("192.168.0.9","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")

With these command, do you actually get “Machine not connected” error, or something different?

Event with proper method call, going from local to remote (DCOM) is always painful. For start, disabling the firewalls is good, but it is just the beginning. You need to at least make sure that DCOM is enabled on both computers, and in most cases also configure the security properly. In order for the client machine to be able to access the remote OPC server by its ProgID, the server machine must have properly installed the OPC Core Components which include the so-called OpcEnum service (hopefully this has been done by Siemens OPC Server installation).

For the DCOM configuration, please have a look at following topic: www.opclabs.com/Support/OnlineForums/tabid/195/forumid/9/pos...6/scope/posts/Default.aspx#146 and especially the links to 3-rd party materials about DCOM for OPC. You can also Google for additional info on “OPC DCOM configuration” – there is plenty of information available.

If you keep having problems, let me know and we will investigate together.

Please Log in or Create an account to join the conversation.

More
01 Nov 2011 08:46 #589 by support

Original Message
From: J.
Sent: Monday, October 31, 2011 7:03 PM
To: Zbynek Zahradnik
Subject: RE: QuickOpc

Hello,

Thank you for the reply.
I did receive the topic notifications.
Attached you find a simple Xbase++ sample program, I wrote for you.
If you have installed the xbase++ development system on your computer Unpack this in a separate folder.
Run Pbuild.exe to compile.
You find a OpcLabTest.exe in this folder.

I already managed to update 1 bit in the PLC. Your suggestion worked out ok.
My question was because reading the help file.

Now I have encountered a new problem.
If my test program runs on the SAME machine as the OPC server, all is ok, and works ok.
However, if I try to connect from another computer to the same OPC server I get error message: "Machine not connected Operation: ReadItemvalue"

This works ok if run on same machine as OPC server:
oOpc:ReadItemValue("","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")

The OPS server computer name = "jds-vista" (192.168.0.9)

This works not ok if run on other machine as OPC server:
oOpc:ReadItemValue("opc.tcp://jds-vista:4845","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")
oOpc:ReadItemValue("opc.tcp://jds-vista","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")
oOpc:ReadItemValue("jds-vista","OPC.SimaticNET.1"," S7:[S7 connection_1]DB1,X0.0")

Even if I replace "jds-vista" by "192.168.0.9" same problem.

Both machines are in the same subnet (192.168.0.x) and all firewalls are disabled.

Please Log in or Create an account to join the conversation.

More
31 Oct 2011 16:44 #588 by support
Hello,
I have created a simple Xbase++ program that writes a value into an OPC item, reads it back, and displays it. The code is in the attachment, and looks like this:

#pragma library( "ascom10.lib" )
PROCEDURE Main
LOCAL oEasyDAClient
oEasyDAClient := CreateObject("OPCLabs.EasyDAClient.5.1")
oEasyDAClient:WriteItemValue("", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345)
? oEasyDAClient:ReadItemValue("", "OPCLabs.KitServer.2", "Simulation.Register_I4")
RETURN


This works fine. With your specific OPC server, you may need different data types, and there are ways to specify that as well. If you cannot make it work, in order to help you further, I will need more details about what you are trying to achieve.
Best regards

Please Log in or Create an account to join the conversation.

More
28 Oct 2011 12:37 #585 by support
Hello,
we have not yet made any tests with XBase++, but based on your request, I am downloading the software and will attempt to figure out the right way to do the writing. In most languages, it is possible to pass in simple types in place of object, and we will do the conversion.
In the meantime, can you please provide more details:
1) Are you unable to make your program compile/run, i.e. no way to write what you want, or have you written some code but the code does not do what you want? Any error message?
2) Please send a sample code (including the variable initializations etc. - not just tge method call) that you are using.trying to use for writing. Please understand that we are not experts in XBase++ so some help from your might be needed.
Best regards

Please Log in or Create an account to join the conversation.

More
28 Oct 2011 12:32 #584 by support
Hello,

I am strugling with my application connect to a Siemens OPC server.
I downloadded and installed QuickOpc - COM I work with the language Xbase++. C can connect to "OPCLabs.EasyDAClient.5.1" and use



oClient:ReadItemValue(cServer,cServerClass,cItem)



For the WriteItemValue() function, the value is of type "Object" wich is not availeble in my programming languague. I can only pass simple vartypes as parameters, like strings and integers.

How to continue?

Regards,
J.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.062 seconds