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.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Reading, Writing, Subscriptions, Property Access
- ReadMultipleItemValues not very fast
ReadMultipleItemValues not very fast
Anyway, if that was the case, then similar problems must have existed when other OPC clients were used. Since there are many different methods how OPC clients may work, and also it is difficult to make time measurements with some non-programmatic, UI-based tools, I guess that it was just a bad luck that the initial investigation pointed in direction of the QuickOPC component.
Best regards,
Zbynek Zahradnik
Please Log in or Create an account to join the conversation.
An electric resistance which costs 0.03 Euro solved the Problem.
The request works in about 0.04 up to 0.5 seconds.
Thanks for helping!
Please Log in or Create an account to join the conversation.
Its equal if it is the first or third request.
Please Log in or Create an account to join the conversation.
Windows need to start the process, and the OPC server needs to do its initialization, etc. This all takes time.
Some OPC servers with huge configurations may even take minutes before they become operational. 1.7 seconds for first request would be fine.
However if the server process stays in memory, with configuration loaded etc., and you are issuing a 2nd or 3rd etc. request, then 1.7 seconds would be long.
Please Log in or Create an account to join the conversation.
So, this is the Code I test, it took 1.7 seconds.
$beginn = microtime(true);
$EasyDAClient = new COM("OPCLabs.EasyDAClient.5.0");
$results = $EasyDAClient->ReadMultipleItems("", "Softing.OPC.ModbusTcp.DA.1", array("3/M1_Word1","3/M2_Word1","3/M3_Word1","3/M4_Word1","3/M5_Word1","3/M6_Word1","3/M7_Word1","3/M8_Word1","3/M9_Word1",
"3/M10_Word1","3/M11_Word1","3/M1_Word2","3/M2_Word2","3/M3_Word2","3/M4_Word2","3/M5_Word2","3/M6_Word2","3/M7_Word2","3/M8_Word2","3/M9_Word2","3/M10_Word2","3/M11_Word2","3/M1_Word3","3/M2_Word3",
"3/M3_Word3","3/M4_Word3","3/M5_Word3","3/M6_Word3","3/M7_Word3","3/M8_Word3","3/M9_Word3","3/M10_Word3","3/M11_Word3","3/M1_Word4","3/M2_Word4","3/M3_Word4","3/M4_Word4","3/M5_Word4","3/M6_Word4",
"3/M7_Word4","3/M8_Word4","3/M9_Word4","3/M10_Word4","3/M11_Word4","3/M1_DWord5","3/M2_DWord5","3/M3_DWord5","3/M4_DWord5","3/M5_DWord5","3/M6_DWord5","3/M7_DWord5","3/M8_DWord5","3/M9_DWord5",
"3/M10_DWord5","3/M11_DWord5"));
foreach ($results as $value) {
echo $value->Vtq()->ToString()."
";
}
echo '
';
$dauer = microtime(true) - $beginn;
echo "Time: $dauer Sec.";
Do you have any more ideas why it took so long?
Thank you
Markus
Please Log in or Create an account to join the conversation.
May I ask you to try my example first, and see if also performs well on your machine? This way we could tell whether there is something different with your machine - or whether the reason is in the code.
Thank you
Please Log in or Create an account to join the conversation.
ReadMultipleItemValues("", "OPCLabs.KitServer", $signals);
$i = 0;
foreach ($values as $v)
{
print $signals[$i] . ": " . $v->value . "";
$i++;
}
?>
With this code, I am getting very fast responses. I have not bothered measuring the precise time, but as far as I can tell the page refreshes "immediately" in th browser, even many times per second.
I will now continue trying to get closer to your scenario, by installing PHP 5.3 etc. Let me know if in the meantime you have found something on your side.
Also note that (at least with PHP versions we have used), it was not possible to index into the returned COM array by a numerical value; that's why my 'foreach' loop is reversed as opposed to your example: I loop through $values, and keep the index in $i for indexing into $signals.
Please Log in or Create an account to join the conversation.
I'am measuring the time on Machine1. The Response time of ReadMultipleItemValues is about 2 Seconds.
Please Log in or Create an account to join the conversation.
Can you please confirm that your configuration is as follows:
Machine 1: Runs the OPC server, and the PHP script similar to the one that you have listed - implementing a Web service.
Machine 2: Consumes the Web service from another PHP script.
Also, are you measuring the times around the ReadMultipleItemValues call on Machine 1, or are you measuring the turnaround time for request/response as seen on Machine 2?
Please Log in or Create an account to join the conversation.
Thanks for your answer.
I have already the settings precisely as shown on the picture. Any other Idea. Or something I coult test?
Regards
Markus
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Reading, Writing, Subscriptions, Property Access
- ReadMultipleItemValues not very fast