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

CyBroReadParameters is a tool that searches the local network for specified controller and 
reads its retentive data or variables from xml file. It also implements data chunk
segmentation and thus making communication more robust and safe.  

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

CyBroReadParameters 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 saving to backup file.

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:

CyBroReadParameters /nad=c<val> /inf=<file> /seg=<val> /t=<ms> /r=<count> /an=<name>

Parameters:

/nad=c<val> : controller NAD (default: 0)
/inf=<file> : xml input file with defined variables to read (optional)
/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:

- Read controller with NAD = 12345 and xml input file backup_vars.xml:

CyBroReadParameters /nad=c12345 /inf=backup_vars.xml /t=250 /r=1 /an=CyBro

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

<object>
  <type>button</type> 
  <name>backup</name>    
  <file>button.png</file>
  <shortpress>           
    <action>
      <type>command</type>
      <command>CyBroReadParameters.exe</command>
      <parameters>/nad=c12345 /inf=backup_vars.xml /t=250 /r=1 /an=CyBro</parameters>
      <waitforexit>1</waitforexit>
    </action>
  </shortpress>
  <style>button</style>   
  <x></x>
  <y></y>
</object>
