PHP code example of mrferrys / beckhoffplcsoapclient

1. Go to this page and download the library: Download mrferrys/beckhoffplcsoapclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrferrys / beckhoffplcsoapclient example snippets


	use mrferrys\beckhoffplcsoapclient\plcHandler as plcHandler;

	$pHandler= new plcHandler(
        "http://172.16.23.102/TcAdsWebService/TcAdsWebService.dll",
        "http://172.16.23.102/TcAdsWebService/TcAdsWebService.WSDL",
        "5.21.99.2.1.1",
        "801");
    
    print_r($pHandler->exec("GetFunctions"));
    
    $pHandler->getSymbolTable();
    foreach($pHandler->symbolTable as $k=>$v){
        echo "$k \n";
    }
    echo "STARTING\n";
    $pHandler->writeSymbolByName(".CLAS2_PARO_EMERGENCIA",true,"c");
	
    sleep(5);
    
	$pHandler->writeSymbolByName(".CLAS2_PARO_EMERGENCIA",false,"c");
    echo "DONE\n";
  
   $pHandler= new plcHandler(  
        "http://172.16.22.140/TcAdsWebService/TcAdsWebService.dll",
        "http://172.16.22.140/TcAdsWebService/TcAdsWebService.WSDL",
        "172.16.22.140.1.1",
        "801");
  
    $pHandler->getSymbolTable();
    foreach($pHandler->symbolTable as $k=>$v){
        echo "$k \n";
    }