Hello Community!
I am using the Windows Server 2012 with IIS 8 to run a PHP Website. On some user interactions, I have to write values to the OPC server.
Used components:
Windows Server 2012
IIS 8
Sql Server 2014
PHP 5.6.0
Quick OPC 5.34
Before changing everything, I tried the script " ReadAndDisplayValue.php" from the PHP example folder.
While reading the variable works, I am having problems to write the value of the OPC variable.
My code (PHP part only):
// Create EasyOPC-DA component
$Client = new COM("OpcLabs.EasyOpc.DataAccess.EasyDAClient");
// Read item value and display it
print $Client->ReadItemValue("", "OPCLabs.KitServer", "Demo.Single");
print $Client->WriteItemValue("", "OPCLabs.KitServer", "Demo.Single", 1)
I get the following output if the site with the code is opened:
"
3.4280347824097
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient<br/><b>Description:</b> Access rights of the topic do not allow writing. ' in C:\inetpub\kkgs14-18\ReadAndDisplayValue.php:13 Stack trace: #0 C:\inetpub\kkgs14-18\ReadAndDisplayValue.php(13): com->WriteItemValue('', 'OPCLabs.KitServ...', 'Demo.Single', 1) #1 {main} thrown in C:\inetpub\kkgs14-18\ReadAndDisplayValue.php on line 13
"
While testing and developing, I have turned of the windows firewall.
I configured the DCOM settings for the "OpcEnum" and "OPCKitServer". I set the "access permissions" and "Launch and activation permissions" for the two objects for my "IIS APPPOOL\<username>" User.
The apppool user is allowed to launch, activate and access the objects local.
After I changed the DCOM settings, I restarted the server and opened the ReadAndDisplayValue.php" page again but without success. Do you have any suggestions?
Thank you for your help!