=====================================================================
=        DAQ-LIBMB-LNX Additional Sample Program for CPSR           =
=                                                         Ver.1.00  =
=                                                 CONTEC Co., Ltd.  =
=====================================================================

- Contents
=======================
  Introduction
  Folder Structure
  Specification
  Support device
  About this sample
  Usage
  About Open Source Software
  Version up history

- Introduction
===========
  Thank you for using our products.

  This package contains sample programs exclusively for CONPROSYS Robust I/O series using DAQ-LIBMB-LNX.
  Please use it as a reference when using CONPROSYS Robust I/O series.
  [DAQ-LIBMB-LNX]  :
    - Download： https://www.contec.com/jp/products-services/daq-control/iiot-conprosys/cps-software/daq-libmb-lnx

- older Structure
=======================
  <User Directory>
   +--<Sample>
   |   +--<jp>
   |     +--<gcc>         gcc sample
   |     |
   |     +--<Python>      Python sample
   |
   +-- Readme_e.txt       Readme(English)  *This file
   +-- Readme_j.txt       Readme(Japanese)
   +-- COPYING.LESSER     COPYING.LESSER

   In the folder of each language above, sample programs are stored in the following configuration.
  <Sample folder>
   +-- tcp_dio_simple      TCP Master Digital I/O Sample for CPSR
   +-- tcp_ai_simple       TCP Master Analog Input Sample for CPSR
   +-- tcp_ao_simple       TCP Master Analog Output Sample for CPSR
   +-- rtu_dio_simple      RTU Master Digital I/O Sample for CPSR
   +-- rtu_ai_simple       RTU Master Analog Input Sample for CPSR
   +-- rtu_ao_simple       RTU Master Analog Output Sample for CPSR

- Support device
=======================
[CONPROSYS Robust I/O Series]
CPSR-ET7017, CPSR-ET7026, CPSR-ET7028, 
CPSR-ET7044, CPSR-ET7051, CPSR-ET7052,
CPSR-ET7053, CPSR-ET7060, CPSR-ET7066
CPSR-ET7217, CPSR-ET7224
CPSR-M7017G, CPSR-M7028DG, CPSR-M7051DG, 
CPSR-M7052DG, CPSR-M7053DG, CPSR-M7055UDG,
CPSR-M7060PDG, CPSR-M7066PDG

- Specification
===========
  [Supported driver]
  DAQ-LIBMB-LNX

  [Supported development languages]
  gcc       (C, C++)
  Python    (3.9, 3.10, 3.11, 3.12, 3.13)

- About this sample
===========
  I/O data is sent and received for the corresponding Modbus function code and register address.
  For details, please refer to the CONPROSYS Robust I/O series reference manual.
   <TCP Master> 
        This is a sample program of Modbus/TCP master.
        It is possible to specify the IP address and communication port, and execute Modbus/TCP communication.
   <RTU Master> 
        This is a sample program for Modbus/RTU master.
        Specify the COM port, baud rate, parity, etc., and execute Modbus/RTU communication.

- Usage
===========

  1. connection 
   <TCP master> 
   - When you select the command [Connect], you can specify the IP address and the port number to be used.
     When these are specified, a connection to the device is initiated.
   <RTU master> 
   - When “Connect” is selected, you can specify the COM port to be used, baud rate, parity, and slave ID.
     When these are specified, a connection to the device is initiated.

  2.Input/Output 
   <Digital I/O> 
   - Data input/output is available from channel 0 to 15.
   - Single Input 
     When inputting only one specified channel, select the command 
     [Single Input] to specify the channel number.
     When a channel number is specified, the input value from the device is displayed.
     The input value can be 0 or 1.
   - Multi Input 
     When inputting multiple channels, select the command 
     [Multi Input] to specify the number of channels.
     When the number of channels is specified, the input value from the device is displayed.
     The starting channel number is fixed at 0ch. When the number of channels 4 is specified, data is acquired from 0ch to 3h.
     The input value is converted to a hexadecimal number and displayed.
   - Single Output 
     To output only one specified channel, select the command 
     [Single Output] to specify the channel number and output data.
     When the channel number and output data are specified, the specified value is output from the specified channel number of the device.
     The output value must be 0 or 1.
   - Multi Output 
     To output multiple channels, select the command 
     [Multi Output] to specify the number of channels and output data.
     When the number of channels and output data are specified, the specified value is output from the specified channel number of the device.
     The start channel number is fixed at 0ch. If channel number 4 is specified, data is acquired from 0ch to 3h.
     The output value should be the value converted to hexadecimal number.
   - EchoBack Single 
     To input the current output value of a specified channel, select the command 
     [EchoBack Single] to specify the channel number.
     When a channel number is specified, the input value from the device is displayed.
     The input value can be 0 or 1.
   - EchoBack Multi 
     To input the current output value of multiple channels, select the command 
     [EchoBack Multi] to specify the number of channels.
     When the number of channels is specified, the input value from the device is displayed.
     The starting channel number is fixed at 0ch. When the number of channels 4 is specified, data is acquired from 0ch to 3h.
     The input value is converted to a hexadecimal number and the value is displayed.
   <Analog Input> 
   - Data can be input from channel 0 to 8.
   - Use with devices that are set to ±10[V] range and differential input method.
   - Single Input 
     When inputting only one specified channel, select the command 
     [Single Input] to specify the channel number.
     When a channel number is specified, the input value from the device is displayed.
     Input values from -10000[mV] to 10000[mV] can be obtained.
   - Multi Input 
     When you want to input multiple channels, you can specify the number of channels by selecting the command 
     [Multi Input].
     When the number of channels is specified, the input value from the device is displayed.
     The start channel number is fixed to 0ch. When the number of channels 4 is specified, data is acquired from 0ch to 3h.
     Input values from -10000[mV] to 10000[mV] can be acquired.
   <Analog output
   - Data can be input from channel 0 to 8.
   - Use with devices with the range set to 0-10[V] and the input method set to differential input.
   - Single Output 
     To output only one specified channel, select the command 
     [Single Output] to specify the channel number and output data.
     When the channel number and output data are specified, the specified value is output from the specified channel number of the device.
     Specify output values from 0[mV] to 10000[mV].
   - Multi Output 
     To output multiple channels, select the command 
     [Multi Output] to specify the number of channels and output data.
     When the number of channels and output data are specified, the specified value is output from the specified channel number of the device.
     The start channel number is fixed to 0ch. When the number of channels 4 is specified, data is acquired from 0ch to 3h.
     Specify output values from 0[mV] to 10000[mV].

  3. exit process
   - Selecting[Close]disconnects from the device and releases the allocated memory.
   - Selecting the command [Exit] terminates the program.

- About Open Source Software
=======================
  This product contains open source software.
  Please note that you must comply with the terms of the LGPLv2.1+ when distributing the product, including libraries.
  For license information on open source software, please refer to the “COPYING.LESSER”.

  [libmodbus]  :
    - Download： https://github.com/stephane/libmodbus
  
- Version up history
=======================
  Ver.1.00 (Web Release 2025.06)
  ----------------------------------------
  - First release
    Support device: CPSR-ET7017, CPSR-ET7026, CPSR-ET7028,
                    CPSR-ET7044, CPSR-ET7051, CPSR-ET7052,
                    CPSR-ET7053, CPSR-ET7060, CPSR-ET7066
                    CPSR-ET7217, CPSR-ET7224
                    CPSR-M7017G, CPSR-M7028DG, CPSR-M7051DG, 
                    CPSR-M7052DG, CPSR-M7053DG, CPSR-M7055UDG,
                    CPSR-M7060PDG, CPSR-M7066PDG