Documente Academic
Documente Profesional
Documente Cultură
USB Driver
* Matsusada Precision
Rev. 0.4
CONTENTS
Page
1 Introduction 1
1- 1 Device driver 1
1 - 2 Driver CD 1
2 Install 2
3 Sample program 19
1 Introduction
Although we have made all possible efforts to produce a very accurate manual, if you find any
mistakes, please contact our customer support. The contents of this manual may be changed
9aSE. Notice that you may see some different image if using other as version.
The software does not function by itself. Please use our Power Supply and Digital Controller after
1 -1 Device driver
There are following two models of device drivers for attaching to our products.
Directly control USB interface: Direct version
Use as serial port (Com port): Virtual Com port version
If application software made by the customer is RS-232C controlled, our products will be
controlled by just adding Com port assigned to existing process by using virtual Com port version.
However, if using several units controlled together, generate application on direct version. (See 3.
Sample program is described some examples e of how device driver of direct version is used.
* In case use of only direct version, virtual Com port is installed and new Com port is assigned.
1-2 Driver CD
Connect the unit to 2 PC with an USB cable. (\Nhen the power of the unit is off)
Note that the following procedure is based on the case of Windows XP(Microsoft).
When turning on the unit, windows of driver search will pop up (fig. 1)
Next> 1 [ Cancel
fig.1
When the window of fig. 2 pop up, insert the attached CD-ROM to the PC.
After that check < Search for the best driver in these locations. > and
'::~:' ii.~:;~S:i9.~::iF~::~~~.t:.~:ii:~~~::!~::\h~~ii~~~~Iq:~~::
Use the check boxes below to limit or expand the default search, vklich includes local
paths and removable media. The best driver found will be installed.
fig.2
Fig.3
Please wail l'inile the wizard inslalls lhe software...
fig A
When the window of fig.5 appear, install is completed. Click < Finish >.
fig.5
Afier turn on a computer, and completes installation of direct version of device driver, it
continuously displays installation retrieval screen of virtual Com port of device driver. (fig. 6)
Check < Install from a list or specific location [Advanced] >,
and click < Next>
tl ext> J l Cancel
fig.6
When the window of fig. 7 pop up, insert the attached CO-ROM to the PC.
After that check < Search for the best driver in these locations. > and
<~:)~e.:~:i~h:i9.f::iEe.::~~i(::~:;ix~r::j;i:th~~ij(~~~tI.9:6~::
Use the check boxes below to limit or expand the derault search, which includes local
paths and removable media. The best driver found will be installed
fig.?
fig.8
Please wait while the wizard installs the software._.
FT DZXXU N axe
To C:\WINDOWS\S,\Jslem32
.... -·--.------------~-----------··--I
fig.9
If screen (fig. 10) pops up, the installation of virtual Com port of device driver is completed. Click
<Finish>
fig.10
2 - 3 Installation of driver(\Nindows Vista)
Note that the fol/owing procedure is based on the case of Windows Vista (Microsoft).
Driver can be installed different way which is not described on this manual, but driver of the other
OS (Windows 98 Me and so on) would be searched and installed. Therefore, install the driver after
After turning on, searching screen of direct version of device driver will pop up.
V /GU ;·J~,.·t:1h-c l;i~( (-lj11:l~i':":: ~\lrl ),:,1_1' J;:.·.'i:~t: . in~c·t i: nc.'., ..:.:;': ll~:'i~ ;·,:1 c:.t.tJ~·r·,~~.i'~Jl'y
~t'3'(h th::- (11:'( f:jr :.Iri·, ~r ~.Jlt.'~:rr.:
Message shows, Windows couldn't find driver software for your device, but select <Browse my
computer for driver software (advanced) >
Cancel
When next screen pops up, insert an attached CD-ROM to a PC, and select the inserted CD-ROM
drive on <Browse>.
* Remove the check mark from <Include subfolders> Click next
*It may take longer time searching virtual Com port depending on your usage environment.
'liinc!c'/·.·' has finishEd imtal::n~: thE clri'itr scft'har" fer thi, dE,..icE:
After completing the installation of direct version of device driver, the installation of virtual Com port
*It may take longer time searching virtual Com port depending on your usage environment.
In the same way for the instillation of virtual Com port, select <\ don't have the disc. Shows me
other options. > and <Next>.
If ycu ha'ie the dl~c that came '81th ycur de'icE, imE:t it nc,.'" '''','inclc'.'.,~ ','fill aut:;l11atica'l~
,earch the c1i,c fer dri'ier ,dt",are,
!
.;
"
~-I ~
"
I Cancel
Message shows <Windows couldn't find driver software for your device>, but select <Browse my
computer for driver software (advanced».
'~'---l
I Ntxt -! I'---l
CanCf:! ~
,":
..".-,,,-~; ·,~\"~"'J,"i1.;n."{.W7:""''''''''''J''''~~~I~,f~1I\-.!!·r:!!'-··':,'''F,V,-I':
f····················································· - -.-..................•.•.................•...................•............:
,v See getail~
When end screen displays, the installation of virtual Com port version of device driver is completed.
Assigned Com port number on virtual Com port is indicated as installed driver name. Click <close>.
- ." jt.t
-\SLa:i~( \
There are D2XX (Direct version of device driver9NCp (virtual Com port version of device driver)
Alternative of Direct version of device driver or Virtual Com port version of device driver can be
*As installing direct version of device driver, message [Cannot find file name of ftd2xx.cat] might
be appeard on the display, however, you can skip it since file [ftd2xx.cat] is not used.
£:..
Search
_.J
~--.:. ...
t\
!~ ")/ {J L::ii ~,
I ~ _c'.! IfA.'-'J ~
Scheduled Sounds and Speech System Taskbar and User Accounts
Tasks Audio Devices Start Menu
± . ~ Keyboards
ct S')
Mice and other pointing devices
. ,f:! j'rde!i~UinBilf!ltilm~;nGlt:!I!iiE+lnd
±.-tSCSI and RAID controllers
:£qi·:
Sound, Video and game controllers
ct .~
System devices
r'------.
• .•
j
..... ",
VBNC++6.0(MS) .
Regarding details of function, see the [D2XXPG34.pdn progr2mming guide on an attached CD
ROM.
Windows shown below shall be open when execute the executable file "USBtest.exe" in sample
folder.
This "USBtest.exe" is an executable file compiled sample program source code in VC folder in
enclosed CD-ROM. Use this program to verify the communication between Matsusada power
supplies.
Note that the operation verification of these executable program "USBtest.exe" was done in the
environment of our factory, and not to confirm the operation in any environment, and as such
support on this program is not to be provided. Indemnification is not to be provided either for any
damaged caused by using or diverting this program.
[Start-up window]
\/Jirite Data RT~<.iiiiiiiiiiiiO~==--""'""''''''''"'''''''''''~ Input a command (STS: receive status of power supply).
* When receiving, input commands for read out.
Read Data
CC operation
\Ilk ite
Sample program is on the attached CD-ROM. The sample of Visual Basic is located at VB folder
in sample folder on the CD-ROM.
"Project1.exe" in VB folder in the CD-ROM sample folder is an executable file compiled sample
program source code in VB folder. This program operate just as "USBtest.exe" does described in
previous page, but when used with only this program, VB6.0 run time library shall be required.
: :'; ':,~_:,~-~ ~:~>:'~"::~;,\;.-'-:':- ',~,::_~:~:) ;~;-~- !T·:;:::!'·~'·:. ~ .:' :-: ;-:.- ~~.":f;:->;~~·.<--.--:~~:; _,~,~~~:~?:,< <.~ -,:- :
• .• , ._':~. ;,,". '. ,,~,.' :;.~ • ~ . • • • . • • '-' .:'"',_ •• ~ ,;;'~-'-~'-.>. ' •• '-' . "
: : : : Status
. Write
Private Declare Function FT_Open Lib "FTD2XXDLL" (ByVal intDeviceNumber As Integer, ByRef IngHandle
As Long) As Long
Private Declare Function FT_OpenEx Lib "FTD2XXDLL" (ByVal pArg1 As String, ByVallngFlags As Long,
ByRer IngHandle As Long) As Long
Private Declare Function FT_Close Lib "FTD2XXDLL" (ByVal IngHandle As Long) As Long
Private Declare Function FT_Read Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByVal IpszBuffer As String,
ByVal IngBufferSize As Long, By Ref IngBytesReturned As Long) As Long
Private Declare Function FT_Write Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByVal IpszBuffer As String,
ByVal IngBufferSize As Long, ByRef IngBytesWritten As Long) As Long
Private Declare Function FT_SetBaudRate Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByVal IngBaudRate
As Long) As Long
Private Declare Function FT_SetDataCharacteristics Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByVal
byWordLength As Byte, ByVal byStopBits As Byte, ByVal byParity As Byte) As Long
Private Declare Function FT_SetFlowControl Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByVal
intFlowControl As Integer, ByVal byXonChar As Byte, ByVal byXoffChar As Byte) As Long
Private Declare Function FT_ResetDevice Lib "FTD2XXDLL" (ByVal IngHandle As Long) As Long
Private Declare Function FT_Purge Lib "FTD2XX.DLL" (ByVal IngHandle As Long, ByVal IngMask As Long) As
Long
Private Declare Function FT_GetQueueStatus Lib "FTD2XXDLL" (ByVal IngHandle As Long, ByRef
dwRxBytes As Long) As Long
, Return codes
Canst FT_OK =0
• Word Lengths
Canst FT_BITS_8 = 8
, Stop Bits
Canst FT_STOP_BITSJ =0
, Parity
Const FT_PARITY_NONE =0
, Flow Control
Const FT_FLOV'tNONE =&HO
, Purge rx and tx buffers
Const FT_PURGE_RX = 1
Const FTYURGE_TX = 2
, FT_OpenEx Flags
Const FT_OPEN_BY_SERIAL_NUMBER =1
, USB Handle
Dim IngHandle As Long
· Write Buffer 256 Byte
Dim strWriteBuffer As String * 256
· Read Buffer 256 Byte
Dim strReadBuffer As String * 256
· USB Open
Sub UsbOpen()
· Open
If FT_Open(O. IngHandle) <> FT_OK Then 'How to open the device when connecting only one our
product.
If FT_OpenExCC0001001 ", FT_OPEN_BY_SERIAU\IUMBER, IngHandle) <> FT_OK Then
'When opening the device while connecting
multiple our products (or only one is also possible) to
one PC.
In case only 1 unit is used for all series. use FT_Open (recommended).
(Even with FT_Open Ex, if USB SIN is written it will work)
In case multiple unit is used
CO series .. 'Write USB SIN in the place of C0001 001 which is enclosed with
''''(double quotation) of FT_OpenEx (e.g.C0001001)
Other series " 'Write USB SIN in the place of C0001 001 which is enclosed with
""(double quotation) of FT_OpenEx
e.g. RK series FT_OpenEx("RK001001", .
e.g. DRA series FT_OpenEx("DRA01001" ..
e.g. XXXXX series FT_OpenEx(IXXXXX001", .
Exit Sub
End If
, BaudRaie 9600bps Set
If FT_SetBaudRate(lngHancie. 9600) <> FT_OK Tilen
UsbClose
Exit Sub
End If
, 8 data bits, 1 stop bit, no parity
If FT_SetDataCharacteristics(lngHandle. FT_EITS_8, FT_STOP_BITSJ, FT_PAF-iITY_NONE) <> FT_OK
Then
UsbClose
Exit Sub
End If
I no flow control
If FT_SetFlowControl(lngHandle, FT_FLOW_NONE, 0, 0) <> FT_OK Then
UsbClose
Exit Sub
End If
'50m second read,write timeout
If FT_SetTimeoutsCingHandle. 50, 10) <> FT_OK Then
UsbClose
Exit Sub
I Rx Clear
End If
UsbClose
Exit Sub
End If
I Tx Clear
If FT_Purge(lngHandle, FT_PURGE_TX) <> FT_OK Then
UsbClose
Exit Sub
End If
End Sub
I USB Close
Sub UsbCloseO
FT_Close ClngHandle)
End Sub
'USB Write
Function UsbWriteCdata As String) As Boolean
Dim wlen As Long
_-=~_n=~~~~=-'~~="""""'~Y_-~_~~~_~~'_~_~_""- _ _~
wlen :: Len(data)
strWriteBuffer :: data
UsbWrite :: FT_Write(lngHandle, strWriteBuffer, wlen, Ln)
End Function
'USB Read
Function UsbRead(data As String, n tv;:, Integer) As Boolean
Dinl I As I_ong
UsbRead:: FT_Read(lngHandle, strReadBuffer, n, I)
jf I >0 Then
data:: Left(strReadBuffer, I - 1)
Else
data:: ""
End If
End Function
Label5.Caption :: ""
If Rt :: FT_OK Then
LabeI5.Caption:: ""
Rt:: Usb Read(rdata, 20) 'Receive data
Label3.Caption :: rdata 'Indicate the data received
If Rt :: FT_OK Then
LabeI5.Caption:: "Read OKl"
Else
LabeI5.Caption:: "Read NG!"
End If
End Sub
UsbClose
The sample program is on the attached CD-ROM. The sample of Visual C++ is located at VC
folder in sample folder on the CD-ROM
IDC_WriteData
IDC_ReadData
IDC_StatusData
: ~~a~u.s. : : jEdit
ftd2xx.lib Link
ftd2xx.h Include
public:
FT_STATUS ftStatus;
FT HANDLE fnHandle;
OnlnitDialogO
I II Form2tting II I I II I I II I I II I II I I I I III I1/111///1 I I I I I I I 1// / I I I / / I I I I I/ I I I I I I I I
ftStatus =FT_Open(O, &fnHandle); How to open the device when connecting only one our
product
multiple our products (or only one is also possible) to one PC.
else
SetDlgltemTextODC_StatusData. "FT_Open Error !"):
return TRUE;
In case only 1 unit is used for all series, use FT_Open (recommended).
(Even with FT_Open Ex, if USB SIN is written it will work)
In case multiple unit is used
CO series ., 'Write USB SIN in the place of C0001 001 which is enclosed with
""(double quotation) of FT_OpenEx (e.g.C0001001)
Other series' "Write USB SIN in the place of C0001 001 which is enclosed with
''''(double quotation) of FT_OpenEx
e.g. RK series FT_OpenEx("RK001001", .
e.g. DRA series FT_OpenEx("DRA01001", .
e.g. XXXXX series FT_OpenEx(IXXXXX001", .
if (ftStatus = FT_OK) {
else {
SetDlgltemTextODC_StatusData. "FT_SetBaudRate Error !");
FT_Close (fnHandle); I I End processing
return TRU E;
if (ftStatus = FT_OK) [
1-=-~~~S-e-tD-I-gI~t-em-T-e-xt~(j-D-C-_-S-ta-t-u-s-D-at-a=,-"-8~d-a-ta"""'b~it-s.-1-s-t-o-p~b-it-.-no~;:jty Set7~
else {
SetDlgltemTextODC_StatusData, "FT_SetDataCharacteristics Error n;
FT_Close (fr,Handle); / / End processing
return TRUE;
/ / no flow control
if CftStatus = FT_OK) {
else {
SetDlgltemTextODC_StatusData, "FT~SetFlowControl Error n;
FT_Close CfnHandle); / / End processing
return TRUE;
if CftStatus = FT.OK) {
else {
SetDlgltemTextODC_StatusData, "FT_SetTimeouts Error!");
FT_Close CfnHandle); / / End processing
return TRUE;
/ / Rx Clear
if CftStatus = FT_OK) {
else {
return TRUE;
/ / Tx Clear
~~~ ~~~.o.7~~~_~~~~.~~~~ ~ _
else {
SetDlgltemText(IDC_StatusData, "FT_Purge Error 1");
FT_Close (fnHandle); I I End processing
return TRUE;
CString strData:
char data[256];
DWORD I;
if CftStatus = FT_OK) {
else {
SetDlgltemText(IDC_StatusData, strData);
__
~_~~~ . : w " " V : ~ = : I ' - = : I l " ~ ~ ~ - = - - = ' ~ = ~ ~ ~ = ~ _ ~ . . . . . , ~ ~ ~ ~ ~ _ ~ ~ _ ~ ~ __
/ / Read in data
void CUSBtestDlg::OnReadO
CString strData;
char data[2561
DWORD \;
else {
SetDlgltemText(IDC_ReadData, "");
)
//------------------------------------------------------------------------------
OnCancelO
FT_Close (fnHandle);
---~--~--'---_._-----_._---------------------.
Tel: +81-77-561-2111