- 18 -
4.Operation
4.1.
Preparation
ZS-6225 uses API made by FTDI inc, depending on each programming language, include
the collowing ciles.
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 collowing cunction.
FT_Open
:
Open the USB port.
FT_OpenEx
:
Open the USB port when using multiple units.
FT_Close
:
Close the USB port.
FT_SetBitMode
:
Set the I/O oc the 8-bit port.
FT_SetBaudRate
:
Set the rewrite time oc 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 *ctHandle)
iDevice
:
Set “0”
ctHandle
:
Ic FT_Open is successcul, the handle number will be returned.
Use this handle number when using other cunctions.
Return value
FT_OK
:
In case oc “0”, success.
Other than “0”
:
Error
4.2.2. FT_OpenEx
Function
Open the USB port and initialized.
In case oc using multiple units, execute “FT_OpenEX” cor each one. It is possible to
control by acquiring the handle number oc each and using that number when using
other cunctions.
Format
FT_OpenEx (PVOID pvArg1, DWORD dwFlags, FT_HANDLE *ctHandle)
pvArg1
:
Set the product serial number(K-xxxxxx).
dwFlags
:
Set “FT_OPEN_BY_SERIAL_NUMBER”.
ctHandle
:
Ic FT_Openis successcul, the handle number will be returned.
Use this handle number when using other cunctions.
Return value
FT_OK
:
In case oc “0”, success.
Other than “0”
:
Error