- 17 -
4.Operation
4.1.
Preparation
ZS-6224 uses API made by FTDI inc, depending on each programming language, include
the following files.
Visual Basic
:
D2XX_Module.bas
Visual C++
:
FTD2XX.H
、
FTD2XX.lib
Delphi
:
D2XXUnit.pas
4.2.Function
In order to control the relay and input the photocoupler, use the following function.
FT_Open
:
Open the USB port.
FT_Close
:
Close the USB port.
FT_SetBitMode
:
Set the I/O of the 8-bit port.
FT_SetBaudRate
:
Set the rewrite time of 8 bits.
FT_Write
:
Turn relay ON/OFF.
FT_GetBitMode
:
Load the photocoupler.
4.2.1. FT_Open
Function
Open the USB port and initialized.
Format
FT_Open (int iDevice, FT_HANDLE *ftHandle)
iDevice
:
Set “0”.
ftHandle
:
If FT_Open is successful, the handle number will be returned.
Use this handle number when using other functions.
Return value
FT_OK
:
In case of “0”, success.
Other than “0”
:
Error
4.2.2. FT_Close
Function
Close the USB port and execute driver termination processing.
Format
FT_Close (FT_HANDLE ftHandle)
ftHandle
:
Set the handle number.
Return value
FT_OK
:
In case of “0”, success.
Other than “0”
:
Error