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
- Connections, Reconnections, COM/DCOM
- PHP ReadItem returns only "BadNonspecific" Quality
PHP ReadItem returns only "BadNonspecific" Quality
This is really a server-side DCOM issue; "Launching user" is an especially dangerous settings, because the server it is then started under the identity of the (potentially remote client process), which is hardly predictable or desired. Furthermore, when *multiple* clients with different identities attempt to connect to the server, DCOM will try to launch multiple copies of it, each under a different identity. What then happens depends on the server: Some may refuse to start the subsequent instances, some may start them but they would be somehow dysfunctional (returning errors or bad qualities), some may start but even the original instance would be negatively influenced...
Please Log in or Create an account to join the conversation.
- alexf
- Topic Author
- Visitor
The IIS is now running again as "ApplicationPoolIdentity" user.
If anyone else seeks a solution for this type of problem (Reminder for me):
I configured the DCOM object of the OPC server I used.
Right click on the DCOM object and select <properties>.
Go to the register <Identity>. On this page you have 4 different options
"The interactive user"
"The launching user"
"This user"
or "The system account (services only).
I selected "This user" and entered the login name and password of a user account.
Restarted the IIS, tried my test page and it is working.
Thank you
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- alexf
- Topic Author
- Visitor
This has definitley to do with the settings of the DCOM. As the Server on which the IIS is running is Windows Server 2012, it uses the "DefaultAppPool". In the Advanced settings dialog of this application pool, I temporarily switched the Identity to "LocalSystem".
Then the php script on the website is functioning.
But I do not consider this as good practice because of security so I will check how I can get the DefaultAppPool user to access the DCOM objects.
Please Log in or Create an account to join the conversation.
- alexf
- Topic Author
- Visitor
I am currently testing with the following code:
<html>
<head><t-itle>Test.php</title></head>
<body>
<?php
// Create EasyOPC-DA component
$Client = new COM("OpcLabs.EasyOpc.DataAccess.EasyDAClient");
print $Client->ReadItemValue("", "OPCLabs.KitServer.2", "Simulation.Random");
print "<br>";
$result = $Client->ReadItem("", "IBHSoftec.IBHOPC.DA.1", "G03S7.M1000.1");
print $result;
?>
</body>
</html>
The first line that reads the random value from the OPCLabsKit Server returns with the line
0,00125125888851588 {System.Double} @31.03.2016 06:11:00; Good GoodNonspecific LimitOk (GoodNonspecific)
The second line that reads from the connected PLC returns
@01.01.1601 00:00:00; Bad BadNonspecific LimitOk (BadNonspecific)
Reading the value from the command line with the following script:
<?php
$Client = new COM("OpcLabs.EasyOpc.DataAccess.EasyDAClient");
print $Client->ReadItem("", "IBHSoftec.IBHOPC.DA.1", "G03S7.M1000.1");
?>
returns:
False {System.Boolean} @31.03.2016 06:15:52; Good GoodNonspecific LimitOk (GoodNonspecific)
Please Log in or Create an account to join the conversation.
Thank you
Please Log in or Create an account to join the conversation.
- alexf
- Topic Author
- Visitor
I have now a PHP website under IIS running. On some lines, I need to read and write values via OPC to the PLC.
After receiving a COM error - I had to enable the COM setting in the PHP.ini file, I tried to read values from the PLC and found out I had to configure the DCOM compontens.
After configuring the DCOM settings for OPCEnum and the used OPC server, I am trying to execute the ReadItem method with my settings for the OPC server. Through the website, i do not get any values and the Quality is indicated as "BadNonspecific".
I then tried to read the same variables via PHP script that was executed via the command line. I used the same commands and variables and there I get values with a good quality and the correct PLC variable value.
DCOM\Computer settings\Default Properties: "Enable distributed COM on this computer" is enabled.
Default Authentication Level: Connect
Default Impersonation Level: Identify
As for the DCOM configuration, I have set for the OPC Enum component and for "Opc Enum x64 Category Manager":
Authentication Level: "None"
Security and Activation Permissions --> Edit --> Group "Everyone" --> allow all permissions (local/remote launch, local/remote activation)
Access Permissions --> Edit --> Group "Everyone" Allow all permissions for "Local/Remote access"
For the used OPC DA Server, I configured the same settings at the DCOM components.
Reading via the website from the "OPCLabs.KitServer.2" --> e.g Simulation.Random is functioning. Have I missed a DCOM setting somewhere?
Firewall is set off
Thank you for your help
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Connections, Reconnections, COM/DCOM
- PHP ReadItem returns only "BadNonspecific" Quality