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.

Reading Time

More
18 May 2017 13:53 #5163 by Captain_Dash
Replied by Captain_Dash on topic Reading Time
Thanks for this quick response.

1. I thought if I only subscribe to the variables i do not have all current values from the server. I need to get the all current values at the time when initialize my program and of course I want to know when the values are changing.

2. & 3. When the reading operation perform the cpu usage is really low, near to zero with small peaks of maybe 3%, I checked it in the diagnosis tool of the visual studio and it does not matter whether the sampling rate is 50 ms or 250 ms.

4. Yes, I mean the reading operation ended and the values of our structure still has all its default values but not the current and right values.

Here is a code snipped:
 
                    client = new EasyUAClient();
 
                    clientMapper = new UAClientMapper(client);
 
                    axisDescriptor = new UANodeDescriptor
                    {
                        BrowsePath = UABrowsePath.Parse(browseName, defaultNamespaceUri)
                    };
 
                    lock (MapLock)
                    {
                       ClientMapper.Map(MappedMotionAxis,
                            new UAMappingContext
                            {
                                EndpointDescriptor = serverInstance.DiscoveryUriString,
                                NodeDescriptor = axisDescriptor,
                                MonitoringParameters = 250
                            });
                    }
 
                    ClientMapper.Subscribe(true);
 
                    // This reading operation takes about 54 seconds
                    ClientMapper.Read();

Our Mapped properties have the following attributes
 
        [UANode(BrowsePath = ".Initialize"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 50), UASubscription(PublishingInterval = 100)]
        public bool Initialize
        {
            get { return initialize; }
            set { SetProperty(ref initialize, value); }
        }

What we were trying to achieve is the following. Our plc is controlling some motion axes and we want to view the current values and want to change values to set some commands for the motions and the 27 variables are only used to control one the axes. We may need to control about 30 to 40 axis in that way.

I hope I could answer your questions properly.

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

More
18 May 2017 13:05 #5162 by support
Replied by support on topic Reading Time
Hello,
can you please first clarify some points? Thank you.

1. Why do you need to subscribe *and* read the same variables?
2. When you subscribed with 50 ms rate, what was the CPU usage?
3. When you subscribed with 250 ms rate, what was the CPU usage?
4. What do you mean by "...the variables were not mapped": Do you mean that you have not seen the right values being read? Note that I am confused here by the fact that we use the term "map" for the initial operation that creates the links between the OPC data and .NET - and this operation is made even before you can do any subscribe or read. I guess this also applies to "...we are able to map the variables after 54 seconds ..." - do you mean the same?

In general, as given by its principle, the mapping has to use the .NET reflection mechanism to access each piece of your data every time it needs it. .NET reflection is relatively ineffective, and therefore the Live Mapping will always be significantly slower than other approaches.

I do not have any absolute performance numbers at hand. But after we clarify what your code is doing and what you are trying to achieve, and rule out other reasons for the issue, I can create a test/example here with our sample server, to see what kind of performance is realistically achievable.

Regards

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

More
18 May 2017 12:36 #5161 by Captain_Dash
Reading Time was created by Captain_Dash
Hello,

When we want to subscribe to a structure in our c# code which maps a structure on our plc server. First we subscribe to the variables and then we read the values.

On our first try we used a sampling rate of 50 ms and the reading operation lasts for about 85 seconds and the variables were not mapped. After adjusting the sampling rate to 250 ms we are able to map the variables after 54 seconds which is still a pretty long time.

Why is this operation taking so long and how is it possible to reduce the time? In this case we only want to map and read 27 variables.

best regards

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

Moderators: support
Time to create page: 0.071 seconds