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.
CPU usage jumps to 100%
The ReadAutomatic and WriteAutomatic properties are 32-bit signed integers, and Timeout.Infinite is -1 (all ones, in binary representation). I think (but I am not 100% sure) that LONG_MAX would be 2^32 -1, giving very long time but not the "never" semantics as intended. I think that -1 would be more appropriate.
And, the suggested code also includes setting static properties through EasyDAClient.SharedParameters. Since COM does not have static members, we have a made an object that you can instantiate and then set its instance properties, and that in effect would behave like setting the static property on EasyDAClient. The object is EasyDAClientConfiguration. So, in your code, you should also write an equivalent of the following two lines, using the EasyDAClientConfiguration object instead.
EasyDAClient.SharedParameters.Topic.SlowdownWeight = 0.0f;
EasyDAClient.SharedParameters.Topic.SpeedupWeight = 0.0f;
Please Log in or Create an account to join the conversation.
Regarding "Class not registered ":
Good sign is that the behavior differs depending on whether you are using the config file or not. This means that the file is named and picked up properly.
The "Class not registered" is most likely a negative side effect of turning off the boxing - see kb.opclabs.com/How_to_disable_prerequisites_boxing . When it is turned off, some prerequisites need to be installed manually. In this case, they are probably the OPC Core Components - from opcfoundation.org/developer-tools/developer-kits-classic/core-components/ .
Best regards
P.S.
I do not understand the part about messageBox - there was none to be expected. If you refer to the "displayProgress" setting, the progress would be in the trace output.
Please Log in or Create an account to join the conversation.
Not sure if the issue still occurs with this configuration yet.
_EasyDAClientPtr ClientPtr;
_EasyDATopicParametersPtr topic_params;
DAClient(std::shared_ptr<json> InputTags, std::shared_ptr<PCS::ZMQ_Publisher>& opc_writeback_publisher,
_bstr_t _machinename, _bstr_t _servername) : machinename(_machinename), servername(_servername){
CoInitializeEx(NULL, COINIT_MULTITHREADED);
topic_params = _EasyDATopicParametersPtr(__uuidof(EasyDATopicParameters));
topic_params->SlowdownWeight = 0.0f;
topic_params->SpeedupWeight = 0.0f;
ClientPtr = _EasyDAClientPtr(__uuidof(EasyDAClient));
ClientPtr->InstanceParameters->UpdateRates->ReadAutomatic = LONG_MAX;// Timeout.Infinite;
ClientPtr->InstanceParameters->UpdateRates->WriteAutomatic = LONG_MAX;// Timeout.Infinite;
//default write item timeout is 60000, which means we get 60 cycles behind since we're being given new data every secondish
ClientPtr->InstanceParameters->Timeouts->WriteItem = 900;
//setup callback
AtlGetObjectSourceInterface(ClientPtr, &EventCallback.m_libid, &EventCallback.m_iid,
&EventCallback.m_wMajorVerNum, &EventCallback.m_wMinorVerNum);
EventCallback.m_iid = _uuidof(DEasyDAClientEvents);
EventCallback.DispEventAdvise(ClientPtr, &EventCallback.m_iid);
EventCallback.set_dependancies(opc_writeback_publisher, InputTags);
}
~DAClient() {
ClientPtr->UnsubscribeAllItems();
ClientPtr = NULL;
topic_params = NULL;
CoUninitialize();
}
Edit: The error still occurs with the changes made above.
Please Log in or Create an account to join the conversation.
<configuration>
<appSettings>
<add key="OpcLabs.EasyOpc.Implementations.Native.Assemblies.EnableVC140RedistBoxer" value="false"/>
<add key="OpcLabs.EasyOpc.Internal.OpcPSBoxing.EnableOpcCorePSBoxer" value="false"/>
<add key="OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.EnableUACertificateGeneratorBoxer" value="false"/>
</appSettings>
<system.diagnostics>
<switches>
<add name="OpcLabs.Boxing.DisplayProgress" value="1" />
</switches>
</system.diagnostics>
</configuration>
But when I use this config file the component gives me the error "Class not registered " when attempting to write. I've named the config file appropriately, and do not get this error when not using the config file. Any ideas?
edit: I forgot to mention I do not see a messageBox pop up
Please Log in or Create an account to join the conversation.
Verification is possible using instructions at kb.opclabs.com/QuickOPC-UA:_How_to_enable_extended_tracing . Majority of the switches listed there is for OPC UA, but the line
<add name="OpcLabs.Boxing.DisplayProgress" value="1" />
First indication the the .config file is working is that you can actually create some output using this. And second, the output should differ depending on whether you turn off the "boxing" or not.
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
There is a second thing over which we have little influence ad that sometimes causes unexpected problems. I want to rule it out as well. Can you please perform the steps described here: kb.opclabs.com/How_to_disable_prerequisites_boxing .
If the above does not help: From your screenshots, there is a relation (of the time spent) to a particular algorithm/piece of code. It is possible to disable that as well. Instructions are here:
www.opclabs.com/forum/reading-writing-subscriptions-property...scriptions-made-with-opc-reads
Can you please test that as well.
Regards
Please Log in or Create an account to join the conversation.
I've also attached the results of another debugging session from VS, where about 2 mins of data was collected while the CPU usage was 100%.
Any other ideas would be greatly appreciated. I'd be willing to share the code I'm using in case there's some grievous error in my usage of the QuickOPC api, but would prefer not to do so over a public channel.
Please Log in or Create an account to join the conversation.
It could be the GC doing this.
Best regards
Please Log in or Create an account to join the conversation.
I have an issue where after 5-10 minutes my opc-da client application jumps to 100 CPU usage. The opc client in this application can be disabled, and when it's disabled this issue does not occur. Typical CPU usage on the machine in question for this program is typically ~3% with short peaks of a about 20%.
The application is written in VC++, so I'm using the COM/procedural coding interface for your product.
The application is posting several hundred tags to an OPC server on the same machine at an update rate of roughly ~5s (though sets of ~100 tags are received at different times), with a smaller set of tags being posted every second (~15). A handful of tags are also being read back. I've used the 'WriteMultipleItemValues' and 'SubscribeItem' functions, with a a write timeout of 900ms since the thread that's calling the quick client has work to do every second.
From the CPU profiling I've done it looks like the QuickOPC component is making internal calls that result in this. I've attached CPU usage info for one debug session, mainly because I'm not sure what else to look at. That session was only in this state for a few seconds, the visual studio debugger struggles to collect usage data when the machine is completely choked out.
I realize this isn't a lot to go on, what sort of information can I collect to figure out why this is happening? Is there any known issue that I could be experiencing?
Thanks,
M
Please Log in or Create an account to join the conversation.