PHP code example of graze / wipotec-checkweigher-client

1. Go to this page and download the library: Download graze/wipotec-checkweigher-client 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/ */

    

graze / wipotec-checkweigher-client example snippets


$client = \Graze\WipotecCheckweigherClient\Client::factory();
...

...
$dsn = '127.0.0.1:55001';
$client->connect($dsn);
...

...
$request = new \Graze\WipotecCheckweigherClient\Request\RequestSetArticle();
$request->setArticleParam(Parameter::NAME, $articleName);
$request->setArticleParam(Parameter::NUMBER, $articleNumber);
$response = $client->sendRequest($request);
...

/**
 * Whether an error was returned.
 *
 * @return bool
 */
public function hasError();

/**
 * Get the error message. 
 *
 * @return string
 */
public function getError();

/**
 * Get the raw response as an array. 
 *
 * @return mixed[]
 */
public function getContents();