PHP code example of erikwang2013 / industrial-protocols-profinet

1. Go to this page and download the library: Download erikwang2013/industrial-protocols-profinet 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/ */

    

erikwang2013 / industrial-protocols-profinet example snippets


$conn = $kernel->getConnectionManager()->connect('pn-device');
$devices = $conn->discoverDevices(5);          // DCP 广播
$result = $conn->read('0:1:1:0xAFF0');        // 读诊断

'devices' => [
    'pn-device' => [
        'protocol' => 'profinet', 'variant' => 'nrt',
        'host' => '192.168.1.30', 'port' => 34964,
        'transport' => 'udp', 'timeout' => 5000,
    ],
],