====================================================================================================
== To start the sample program (32bit compatible) for the time being ===============================

0. Start two Cmd.exe (Command Prompt) and move the current directory to the directory where TDS
   package is installed.

1. Copy the following files to "FirstSample0/bin32/".
   + Win32/TDS.dll
   + Sample0_Makefile/Sample.ini

2-1. Execution of FirstSimpleIo.exe
  a. Execute "FirstSimpleIo h" in one of the launched Cmd.exe.
  b. Execute "FirstSimpleIo e" in the other Cmd.exe.
  c. To exit, enter "Ctrl-C".

2-2. Execution of FirstBasicIo.exe and FirstCallbackIo.exe
  a. Execute "FirstBasicIo h" or "FirstCallbackIo h" in one of the launched Cmd.exe.
  b. Execute "FirstBasicIo e" or "FirstCallbackIo h" in the other Cmd.exe.
  c. Refer to the comments in the header part of each source code for operations after startup.



====================================================================================================
== Executable file =================================================================================

[] bin32/FirstSimpleIo.exe
[] bin64/FirstSimpleIo.exe

   Executable created by FirstSimpleIo.c by Makefile.Win32 or Makefile.Win64 using VS2010.
   To execute bin32/FirstSimpleIo.exe, you need ../Win32/TDS.dll.
   To execute bin64/FirstSimpleIo.exe, you need ../Win64/TDS.dll.


[] bin32/FirstBasicIo.exe
[] bin64/FirstBasicIo.exe

   Executable created by BasicIO.c  by Makefile.Win32 or Makefile.Win64 using VS2010.
   To execute bin32/FirstBasicIo.exe, you need ../Win32/TDS.dll.
   To execute bin64/FirstBasicIo.exe, you need ../Win64/TDS.dll.


[] bin32/FirstCallbackIo.exe
[] bin64/FirstCallbackIo.exe

   Executable created by CalbakIo.c by Makefile.Win32 or Makefile.Win64 using VS2010.
   To execute bin32/FirstCallbackIo.exe, you need ../Win32/TDS.dll.
   To execute bin64/FirstCallbackIo.exe, you need ../Win64/TDS.dll.


(Note) To prepare the above-mentioned execution environment such as .exe (.ini, .dll, etc. are
   required in bin32/ and bin64/), perform make processing as described in "== How to create sample
   programs ==" below.


====================================================================================================
== Source code file ================================================================================

[] FirstSimpleIo.c

  + The simplest use case of constructing a SECS message in the AP and simply repeating sending and
    receiving S1F1 and S1F2



[] FirstBasicIo.c

  + An example of basic processing that performs SECS Send/Receive processing of SECS message
    sequentially.



[] FirstCallbackIo.c

  + An example of processing similar to normal processing in which Receive processing of the SECS
    message is performed in the Callback function, and when the primary message is received, the
    corresponding secondary message is also sent at that time.

  + Continuous transmission/reception processing at fixed intervals (100 ms) is continuously
    executed until the CNTL-C input according to the request code.



[] FirstSubFunctions.h

  + Source code file containing function entities called from FirstBasicIo.c and FirstCallbackIo.c.
    For each source code file, include it in yourself by #include.



====================================================================================================
== Files to build and run the sample program =======================================================

[] Makefile.Win32    , Makefile.Win64  

  + Makefile that creates the above three programs (FirstSimpleIo, FirstBasicIo, FirstCallbackIo).

  + Refer to Makefile.*32 when supporting 32-bit applications.
  + Refer to Makefile.*64 when supporting 64-bit applications.



[] SampleE.ini

  + Use the one in ../Sample0_Makefile/.
  + This is an example of the setting file of this library, and used by this sample program.
  + Set the items common to the host side and the equipment side in the [DEFAULT] section, set the
    host side specific settings in the [HOST] section, and set the equipment side specific settings
    in the [EQUIP] section.
  + This setting assumes that equipment with deviceID=0x20 and host will perform loopback test in
    one PC using HSMS connection.
  + The maximum length of the SECS message is 100000 bytes, and when using a larger message, it is
    necessary to change the parameter value with reference to the comment described at the top of
    this setting file.
  + The following settings are made for log output performed by this library.
    - A communication trace is output in the form of a list of the format of this library.
      Hexadecimal numbers are not displayed.
    - Processing trace and user I/F function trace are not performed. Communication trace is output
      to file only
    - The trace file switches over 5MB.
  + Refer to the Programmer's Manual (TDSE.pdf) for details of setting values.



[] setup32.bat
[] setup64.bat

  + Example of a batch command to set up a build environment and a Java execution environment of a
    program using makefile on Windows.



(Note 1) The end of each sample program and Makefile line is "LF" code only.
   Therefore, Windows Notepad can not refer correctly. Refer to it using a text editor that supports
   files whose line feed code is "LF" only.
   Configuration files etc. can also be viewed with Notepad.

(Note 2) Since the TAB Stop position of each sample program etc. is every 8 digits, make the setting
   of the text editor to be used like that.
   However, each source code in Sample1 and Sample2 is every 4 digits of Visual Studio standard.



====================================================================================================
== How to create sample programs ===================================================================

[] Build a program using makefile on Windows

  + Start cmd.exe and work in it.

  + In order to use a development environment such as Microsoft Visual Studio compiler, start the
    following batch file prepared by Visual Studio and prepare the development environment.

    - In case of 32bit application
       [Directory where you installed Visual Studio]\VC\vcvarsall.bat x86

    - In case of 64bit application
       [Directory where you installed Visual Studio]\VC\vcvarsall.bat x64

  + Use Makefile.Win32 in the case of 32bit environment and Makefile.Win64 in the case of 64bit
    environment.

  + Execute Build with the following command.
    - nmake -f Makefile.Win32   or   nmake -f Makefile.Win64
      ~~~~~~~~~~~~~~~~~~~~~~~        ~~~~~~~~~~~~~~~~~~~~~~~

  + Build results are placed in ./bin32/ or ./bin64/.
    .dll, .ini, .sml, etc. necessary for execution are also copied to the same directory.


  (Note 1) Refer to "setup32.bat" or "setup64.bat" for setting up the environment, and it is also
     possible to change "setup32.bat" or "setup64.bat" appropriately and use it.

  (Note 2) This library package supports the following development environments.
     (Since the attached project file is from VS2010, when using a later version of VS, convert it
     to the version of VS to be used (or with automatic conversion) using the project file
     conversion function of VS.)
    + Microsoft .. Visual Studio 2005  (Microsoft Visual Studio 8)  ...... (Not support)
    + Microsoft .. Visual Studio 2008  (Microsoft Visual Studio 9.0)  .... (Not support)
    + Microsoft .. Visual Studio 2010  (Microsoft Visual Studio 10.0)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2012  (Microsoft Visual Studio 11.0)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2013  (Microsoft Visual Studio 12.0)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2015  (Microsoft Visual Studio 14.0)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2017  (Microsoft Visual Studio 14.1)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2019  (Microsoft Visual Studio 14.2)  ... (32bit, 64bit)
    + Microsoft .. Visual Studio 2022  (Microsoft Visual Studio 14.3)  ... (32bit, 64bit)



====================================================================================================
== How to start and operate sample programs ========================================================


[] Refer to the header section of each source code for how to start and operate each sample program.

  (Note 1) Windows : Put     TDS.dll      in the executable PATH.

  (Note 2) This sample is not sufficient for exception handling etc. because of its nature (as
     simply as possible to understand how to use TDS). When coding, be sure to code sufficient
     exception handling etc. according to the TDS operating environment, operating mode, etc.

