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.

Get Data Type methods

More
06 Apr 2013 10:45 - 06 Apr 2013 10:45 #1287 by support
Replied by support on topic Get Data Type methods
Regarding your approach in general, thanks for explanation, and I think it is reasonable to do it the way you are doing it (leave out the initial reads, only obtain that tag information and possibly the data types). The extraction of data types will always slow down this phase, but when done well, I believe you can get reasonable performance. I will prepare the example you asked for.
Last edit: 06 Apr 2013 10:45 by support.

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

More
05 Apr 2013 16:01 #1286 by arahming
Replied by arahming on topic Get Data Type methods
Do you have an example of using this method I am using it according to the documentation and it is still failing not sure if I am missing something

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

More
05 Apr 2013 15:10 #1285 by arahming
Replied by arahming on topic Get Data Type methods
We have developed a test environment which mimics our real environment except for really data. So we have decided to program a data capture (which I am doing) and a server which reads from the capture. This way we can capture real data for a specific period and feed it into our P2V test server. I need the data types so the server portion can recreate the structure dynamically on runtime. Information I was trying to collect was server name, tag name, data type, initial quality, and initial values, I than have a class that will collect data for a specific time period via subscription. The second part works fine but the schema class takes too long I decided not to worry about value and quality and have the tag names now taking less than a minute to collect 10,000 tag names. The data type which is needed takes too long. I will attempt the technique you outlined and let you know

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

More
05 Apr 2013 04:30 #1283 by support
Replied by support on topic Get Data Type methods
OPC properties, per the spec, are not designed for efficiency.
The GetDataTypePropertyValue method is nice for simple coding, but it accesses one property at a time, making the situation even worse.

I suggest that you replace it by calling GetMultiplePropertyValues instead, and make just one such call per all items in a branch, if not for more. The code will get uglier, e.g. you will have to explicitly specify the DAPropertyId.DataType, and typecast the obtained value, but that's te price for better speed.

May I ask about the larger picture - why do you need the data type? Maybe the whole thing can be designed diffently.

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

More
04 Apr 2013 20:49 #1280 by arahming
is there a way to use the GetDataTypeProteryValue or anohther method which is faster it take aprox 1/2 to 1 hour to get the data types for 10,000 tags

public List<string> OPCTags = new List<string>();

private List<string> OPCDataTypeConver = new List<string>();

private void Get_OPCTagsNames(string parentItemID)
{
var nodeFilter = new DANodeFilter();

EasyDAClient.ClientParameters.TurnOffActivationSecurity = true;

OpcLabs.EasyOpc.DataAccess.DANodeElementCollection allNodes1 = easyDAClient1.BrowseNodes(IP, serverName, parentItemID, nodeFilter);


foreach (DANodeElement nodeElement in allNodes1)
{
if (nodeElement.IsLeaf)
{
OpcLabs.EasyOpc.VarType varType = easyDAClient1.GetDataTypePropertyValue(IP, serverName, nodeElement);

//string display;
//try
//{
// object value = client.ReadItemValue(IP, serverName, nodeElement.ItemId);
// display = String.Format("", value);
//}
//catch (OpcException ex)
//{
// display = String.Format("** {0} **", ex.GetBaseException().Message);
//}
OPCTags.Add(nodeElement.ItemId);
OPCDataTypeConver.Add(varType.ToString());

}
else
{
if (nodeElement.IsBranch)
Get_OPCTagsNames(nodeElement.ItemId);
}
}

}

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

Moderators: support
Time to create page: 0.053 seconds