--------------------------------------------------------------------------------
                   CyBroWriteParameters (c) 2021 Robotina d.o.o.
--------------------------------------------------------------------------------

CyBroWriteParameters is a tool that searches the local network for specified controller and 
writes data from xml backup file. It also implements data chunk segmentation and 
thus making communication more robust and safe.  

It features also:
- definition of nad number 
- definition of segmentation value
- definition of read timeout
- definition of retry count 
- definition of application name

CyBroWriteParameters works in local network. Internet connection is not directly 
supported, but it can be established with the help of CyBroRelay or CyBroHIQUniverseRelay. 
In such case, adjustment of timeout values and retries may be needed. It can also work
as a standalone program. This mode is activated if /nad=c<value> is not defined in 
additional parameters. Program then offers step by step guide for detecting CyBro devices
and restoring from backup files.

CyBroComServer is used to communicate with the controller so it is necessary 
that the "CyBroComServer.com" (version 1.6.4) is in the same directory.

There is no installation, just unzip and run.

Usage:

CyBroWriteParameters /nad=c<val> /seg=<val> /t=<ms> /r=<count> /an=<name>

Parameters:

/nad=c<val> : controller NAD (default: 0)
/seg=<val>  : segmentation (default: 200)
/t=<ms>     : timeout for autodetect [ms] (default: 500ms) 
/r=<count>  : number of retries, not counting the first message (default: 1)
/an=<name>  : application name (default: CyBro)

Examples:

- Write controller with NAD = 12345:

CyBroWriteParameters /nad=c12345 /seg=200 /t=250 /r=1 /an=CyBro

CyBroWriteParameters /nad=c31119 /seg=10 /t=1250 /r=5 /an=CyBro

- definition of command and parameters "restore" button in CyBroMiniScada.xml

<object>
  <type>button</type> 
  <name>restore</name>    
  <file>button.png</file>
  <longpress>           
    <action>
      <type>command</type>
      <command>CyBroWriteParameters.exe</command>
      <parameters>/nad=c12345 /seg=200 /t=500 /r=1 /an=CyBro</parameters>
      <waitforexit>1</waitforexit>
    </action>
  </longpress>
  <style>button</style>   
  <x></x>
  <y></y>
</object>
