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.

ReadMultipleItemValues not very fast

More
30 Mar 2011 15:13 #343 by support
I am glad it works! Not sure if I fully understand, though, probably a serial communication problem and some kind of terminal impedance adjustment?
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.

More
30 Mar 2011 13:47 #342 by Markus
Problem solved!
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.

More
30 Mar 2011 13:19 #341 by Markus
The 1.7 seconds are the average load. It moves in a range of 0.04 seconds up to 3.4 seconds.
Its equal if it is the first or third request.

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

More
30 Mar 2011 12:32 #338 by support
Whether this is long or not really depends on the situation. It would not be long if the target OPC server was not running before.
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.

More
30 Mar 2011 11:48 #337 by Markus
I took a little bit of time but I testet different things.
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.

More
10 Mar 2011 12:41 #330 by support
A new test, a bit closer to yours: I have installed PHP 5.3.5 (IIS CGI). It appears a bit slower, but my example still runs quite fast (certainly not more than 100-200 milliseconds to refresh the page).
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.

More
10 Mar 2011 12:33 #329 by support
Hello, I am trying to reproduce the issue. First I have used what I had readily in hand, meaning that I used PHP 5.2.12 (IIS ISAPI Module), haven't used the Web service, and used our own simulation server. My code looks like this:


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.

More
08 Mar 2011 14:42 #321 by Markus
Yes, the configuration is as per description.
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.

More
07 Mar 2011 19:28 #320 by support
Thank you; at this point it looks like that I will set up a similar configuration here and see if I can reproduce it. Please allow some time before I have the results.
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.

More
07 Mar 2011 08:24 #317 by Markus
Hello!
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.

Moderators: support
Time to create page: 0.060 seconds