Hardware Support : Hardware@comizoacokr Software Support : Software@comizoacokr wwwcomizoacokr wwwcomizoacom Tel) 042 861 3301~3 Fax) 042 861 3304
1 2 11 3 12 COMI-SD104 (MULTI-FUNCTION) 6 13 COMI-EDKIT1 14 14 17 15 38 2 40 21 COMI-SD104 41 21 43 22 63 3 84 31 COMI-SD104 85 31 LED 86 32 7-96 33 108 34 112 4 131 41 (FF, FLIP-FLOP) 131 42 135 43 COMI-SD104 137 41 139 5 152
51 DC 155 6 170 61 A/D 170 62 A/D 171 61 175 62 187 APPENDIX A 198 A1 198 A2 1 198 A3 199 A4 200 A5 201 APPENDIX B 204 A1 204 A2 209 A3 L297 - STEP MOTOR CONTROLLER IC 214 A4 217
1 / COMI-SD104-1-
1 / COMI-SD104 - - - / - - Visual C++ - - - - - - COMI-SD104 Multi-function DAQ Board - Visual C++ -2-
11 CPU CPU, / [ 11] [ 11] / -3-
/ DAQ(Data Acquisition) DAQ (Analog Input), (Analog Output), (Digital Input), (Digital Output), (Counter) (Motion Controller) DAQ A/D(Analog to Digital) [ 11] PC,, D/A(Digital to Analog) DC (Actuator), ON/OFF ON/OFF (Mainboard) (Slot) [ 12] (Hardware) (Software) [ 12] CPU,, 3 CPU -4-
RAM ROM (Floppy disk driver), CD-ROM CPU,,, CPU, (Address Bus), CPU I/O (Data Bus) (Control Bus) [ 12] -5-
COMI-SD104 Single Ended 16 Differential 8, 2, 8, 2 (Multi-function) DAQ COMI-SD104 32Bits PCI Windows Plug and Play Windows 95/98/2000 14Bits Resolution 370KHz, 16 Single-Ended Differential 8 Gain (Voltage Range) 1V, 2V, 5V, 10V, 0~1V, 0~2V, 0~5V, 0~10V Data Resolution 12Bits Resolution 2 [ 13] COMI-SD104-6-
Bus IBM PC Bus (32Bits PCI) 195 * 107 mm PNP (Plug &Play) Single-Ended 16 Differential 8 2 8 8 2 Complete 14 Bit A/D Conversion A/D Converter Type of ADC Burr Brown ADS7899 Successive approximation A/D Channel Single-Ended 16 or Differential 8 Input Voltage Range ±10V, ±5V, ±2, ±1V, 0~10V,0~5V, 0~2V, 0~1V Resolution 14 Bits, 1 in 16384 Maximum Sampling Rate 375KHz Streaming to Disk Rate 375KHz (Tested on Pentium700MHz ) Input Impedance A/D Trigger Mode Data Transfer Channel Configuration 10M Ohm Programmable Timer, Software, External Programmed I/O, Interrupt Gain, Channel No D/A Converter Burr Brown DAC7545 D/A Channel 2 Channels (for single DC Output) Resolution 12 Bits, 1 in 4096-7-
Setting Time 2µsec Output Voltage Range ±10V Data Transfer Programmed I/O TTL Compatible Input Channel 8 Channels Voltage Level Low(0 ~ 08V), High(2V ~ ) Input Load Low 05V(02mA), High 27V(20mA) Data Transfer Programmed I/O TTL Compatible Output Channel 8 Channels Voltage Level Low(0 ~ 04V), High(24V ~ ) Input Load Data Transfer Low 05V(02mA), High 27V(04mA) Programmed I/O COMI-SD Counter Clock Input Channel 2 Channels Resolution 32Bits Gate Input Software Reset Real Time Clock -8-
Analog Input SE-16CH DIFF-8CH Analog MUX Gain Controller (1,2,5,10) A/D Convertor (12bit) Buffer & FIFO(2048x16) I/O CONNECTOR 2Channels 8Channels A/D Scan Control Counter (32bit ) Digital Output FPGA Interrupt Countrol Decoder Data Address Data PCI CONTROLLER Data Control Address PCI BUS 8Channels Digital Input Data 2Channels Analog Amplifier D/A Convertor Data [ 14] COMI-SD104 Hardware -9-
[ 15] COMI-SDT1 COMI-SDT1 COMI-SD104 COMI-SD104 COMI-SDT1 68 Pin SCSI -10-
Signal Name Reference I/O Description AI<015> AGND (single ended 0 ) AI<07>- AI<07>+ AGND (Differential 0 7) AGND - DAOUT0 AGND 0 DAOUT1 AGND 1 GATE0 DGND COMI-SD Counter0 GATE0 CLK0 DGND COMI-SD Counter0 Clock0 GATE1 DGND COMI-SD Counter1 GATE1 CLK1 DGND COMI-SD Counter1 Clock1 A/D E_TRG DGND A/D DGND VCC DGND 5V DI<07> DGND (0 7) D0<07> DGND (0 7) [11] COMI-SDT1-11-
COMI-SD104 /, /, (Load)/ (Unload) (Load)/ (Unload) BOOL COMI_LoadDll (void) COMIDAS DLL(Dynamic Link Library) (load) - Return : 1 => - Remarks : 0 => 1 COMIDAS Library 2 void COMI_UnloadDll (void) COMIDAS DLL(Dynamic Link Library) (unload) - Remarks : HANDLE COMI_LoadDevice (COMIDAS_DEVID deviceid, ULONG instance) COMIDAS (load) - deviceid : COMI_SD104 - instance : deviceid 0 - Return : -12-
INVALID_HANDLE_VALUE - Remarks : void COMI_UnloadDevice (HANDLE hdevice) COMIDAS (unload) - hdevice : COMI_LoadDevice() -13-
[ 16] COMI-EDKIT1 COMI-EDKIT1 / Autonics PS17-5DNU 5mm DC 3, NPN normal open -14-
1 EA Autonics BY500-TD1( ) & BY500-TDT2( ) 500mm NPN open collector output, 1 EA 8 8 EA LED 3mm 8 EA LED 7-SEGMENT Anode common type 7-SEGMENT 1 EA 7SEGMENT A TTL ON/OFF LED -15-
2 Phase DC 12V 18 1 EA DC DC12, 24V CW, CCW 1 ~ 1,900 RPM 1 EA DC PT100 1 EA POTENTIO ROTARY POTENTIO 1 EA POWER POWER SUPPLY AC 220V, DC 12 V REGULATOR DC 5, 12, 15, -15V 2A ON/OFF -16-
Microsoft Visual C++ / (Dialog based)comi-sd104 DAQ COMI-SD104 CH0 CH0 COMI-SD104 AppWizard Visual C++ AppWizard (Resource) (Project), AppWizard [ 17] Visual C++File New -17-
[ 17] File/New [ 18] [18] MFC AppWizard(exe) Project name, Location Path OK [ 18] -18-
[ 19] (Single document), (Multiple document), (Dialog based) [ 19] Dialog based Next [ 19] [ 110] Next [ 110] AppWizard About box Context-sensitive Help 3D controls 3 2 ActiveX Control ActiveX Control -19-
Windows Sockets TCP/IP [ 110] [ 111] Finish [ 112] OK -20-
[ 111] [ 112] AppWizard -21-
VC++, Edit Box, Static text,,, (Slider) Layout, [ 113] [ 113] [ 113] -22-
[ 113] Static Text, Edit Box, Button [ 114] Properties [ 115]Static text [ 114] [ 115] COMI-SD104 DAQ -23-
CD C:\Program Files\COMIZOA\COMIDAS-CPSD\Window\C_CPP\Lib Comidascpp, Comidash ComidasCommonh [ 116] VC++Project => Add To Project => Files [ 117] OK [ 116] [ 117] -24-
COMI-SD104 Comidascpp Open #include stdafxh Stdafxh Visual C++ Precompiled Header Precompiled Header Stdafxh fatal error C1010: unexpected end of file while looking for precompiled header COMI-SD104 #include Comidash -25-
AppWizard F7 EXE F5 Dialog based CXxxApp CXxxDlg AppWizard Xxx Dialog based CXxxApp Dialog based CXxxApp Dialog based CXxxDlg -26-
[ 118] AppWizard COMI-SD104 COMI_LoadDevice COMI-SD104 DAQ COMI_LoadDevice C++ XxxDlgcpp -27-
COMI_LoadDevice OnInitDialog // VCProgramDlgcpp : implementation file // #include "stdafxh" #include "VCProgramh" #include "VCProgramDlgh" #include "Comidash" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif HANDLE ghdevice; // ///////////////////////////////////////////////////////////////////////////// // CVCProgramDlg dialog CVCProgramDlg::CVCProgramDlg(CWnd* pparent /*=NULL*/) : CDialog(CVCProgramDlg::IDD, pparent) { //{{AFX_DATA_INIT(CVCProgramDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hicon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); },,,, Visual C++ (Class Wizard) -28-
, Visual C++ View Class Wizard [ 119] Message Maps Object IDs (Object) Messages Member functions [ 119] (Class Wizard) OnInitDialog OnInitDialog Dialog based (Routine) COMI-SD104-29-
COMI_LoadDll() COMI_LoadDevice() OnInitDialog BOOL CVCProgramDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } } return TRUE; // return TRUE unless you set the focus to a control OnClose OnClose Dialog based (Routine) COMI-SD104 COMI_UnloadDevice() COMI_UnloadDll() OnClose() [ 120] Object IDs CXxxDlg Messages WM_CLOSE OnClose() -30-
[ 120] OnClose OnClose() COMI_UnloadDll() void CVCProgramDlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); COMI_UnloadDevice() } CDialog::OnClose(); OnTimer OnTimer CXxxDlg WM_TIMER WM_TIMER OnTimer -31-
[121]Object IDs CXxxDlg Messages WM_TIMER OnTimer() [ 121] OnTimer OnTimer() A/D Channel0 void CVCProgramDlg::OnTimer(UINT nidevent) { // TODO: Add your message handler code here and/or call default m_fadvalue = COMI_AD_GetVolt(ghDevice, 0); // Read A/D CH0 UpdateData(FALSE); // A/D } CDialog::OnTimer(nIDEvent); OnTimer() SetTimer() Timer -32-
SetTimer() MFC UINT SetTimer( UINT nidevent, UINT nelapse, void (CALLBACK EXPORT* lpfntimer)(hwnd, UINT, UINT, DWORD) ) - nidevent : 0 - nidevent : milli-second - lpfntimer : NULL WM_TIMER OnTimer() 01 SetTimer SetTimer(0, 100, NULL); 01 OnTimer KillTimer KillTimer SetTimer KillTimer MFC BOOL KillTimer( int nidevent ) (Check Box) (Uncheck) ( ) [ 113] A/D Enable/Disable -33-
A/D Enable/Disable( A/D Enable/Dsiable ) Visual C++ View Class Wizard [ 122] Object IDs (IDC_CHECK1) Message BN_CLICKED OK [ 122] BN_CLICKED CXxxDlg void CVCProgramDlg::OnEnableTimer() { // TODO: Add your control notification handler code here } A/D Enable/Disable -34-
void CVCProgramDlg::OnEnableTimer() { // TODO: Add your control notification handler code here if(isdlgbuttonchecked(idc_check1)) SetTimer(0, 100, NULL); else KillTimer(0); } (Edit box) Visual C++ (Mapping) UpdateData() Member Variables Control IDs ( IDC_EDIT1) Member variable name Variable type ( float ) Category Value OK -35-
[ 123] UpdateData() UpdateData MFC BOOL UpdateData( BOOL bsaveandvalidate = TRUE ) bsaveandvalidate TRUE () FALSE ( ) OnTimer A/D UpdateData() void CVCProgramDlg::OnTimer(UINT nidevent) { // TODO: Add your message handler code here and/or call default m_fadvalue = COMI_AD_GetVolt(ghDevice, 0); // Read A/D CH0 UpdateData(FALSE); // A/D } CDialog::OnTimer(nIDEvent); -36-
(EXE ) Visual C++ Build => Build Xxxxexe F7 Debug Release ( Build ) F5-37-
15 : : : : 1) / 2) 3) DAQ 4),,, -38-
2 COMI-SD104 DAQ 21 43 22 63-39-
2 COMI-SD104 DAQ Low High, 0Volt 5Volt ON OFF 0 1 [ 21] 1 [ 21] OFF LSB 0 ON 1 (Bus driver : buffer) (High impedance), SELECT=1, IN=1 LSB, 3 (3-State buffer) 3 1 0 LSB (Accumulator)LSB 0 IN=0 (Photo sensor) -40-
[ 21] 21 COMI-SD104 int COMI_DI_GetOne (HANDLE hdevice, int ch) Digital Input Status - hdevice : COMI_LoadDevice() - ch : Digital Input 0 - Return : Status 0 - OFF, 1 - ON DWORD COMI_DI_GetAll (HANDLE hdevice) COMI-SD104 8 32 BIT0 ~ BIT7 ON/OFF - hdevice : COMI_LoadDevice() - Return : Digital Input Status 32 bit Status -41-
-42-
21 - - - - - Visual C++ - COMI-SD104 - COMI-EDKIT1-1 (ON/OFF) [ 22] ON OFF ON/OFF ( (Marking) ) [ 23] -43-
[ 22] 1-44-
[ 23] -45-
( ) ( ), 80msec 0V [ 24] -46-
[ 25] [ 26] 2 3 2,,, mm ~ 25mm 120mm, -47-
[ 26] ( ) ( ) ( ),,,, ( ),, 1) [ 27 (a)]+ + 2) [ 27 (b)] + 3),, -48-
[ 27] 0V, [ 28] -49-
[ 29] 2 COMI-EDKIT1 Autonics PS17-5DNU 5mm, DC 3 NPN normal open [ 210] -50-
[ 210] PS17-5DNU [ 211] (Isolation) PS17-5DN DC 12~24V COMI-SD104, [ 211] (Photo-coupler) COMI-SD104, (Photo-coupler) LED (Phototransistor)1, (Isolation) -51-
COMI-EDKIT1 PC817, [ 212] COMI-SD104 COMI-EDKIT1 [ 212] [ 212] COMI-EDKIT1 COMI-SDT1 221 (ON/OFF) ON OFF [ 213] -52-
[ 213] 222 Visual C++ AppWizard Visual C++File New (Dialog based) Exp2_1 [ 214] -53-
[ 215] 1 [141 AppWizard ], 1 1 223 (Edit box) ON OFF Static text 1 ID IDC_EDIT1 (Default) -54-
[ 216] 224 COMI-SD104 COMI-SD104 DAQ C:\Program Files\COMIZOA\COMIDAS-CPSD\Window\C_CPP\Lib Comidascpp, Comidash ComidasCommonh VC++Project => Add To Project => Files 3-55-
[ 217] COMI-SD104 Comidascpp Exp2_1Dlgcpp #include Comidash ghdevice #include "stdafxh" #include "Exp2_1h" #include "Exp2_1Dlgh" #include "Comidash" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif ///////////////////////////////////////////////////////////////////////////// // CExp2_1Dlg dialog -56-
HANDLE ghdevice; CExp2_1Dlg::CExp2_1Dlg(CWnd* pparent /*=NULL*/) : CDialog(CExp2_1Dlg::IDD, pparent) { //{{AFX_DATA_INIT(CExp2_1Dlg) m_svalue = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hicon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } 225 OnInitDialog Exp2_1Dlgcpp OnInitDialog COMI-SD104 BOOL CExp2_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } SetTimer(0, 10, NULL); // 10ms } return TRUE; // return TRUE unless you set the focus to a control 226 OnClose [ 218] OnClose COMI-SD104 (Unload) -57-
[ 218] OnClose OnClose void CExp2_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default KillTimer(0); COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 227 m_svalue (Member variable) ON OFF -58-
[ 219] 228 (10ms ) COMI-SD104 [ 220] OnTimer Exp2_1Dlgcpp OnTimer() OnTimer void CExp2_1Dlg::OnTimer(UINT nidevent) { // TODO: Add your message handler code here and/or call default int nstate; nstate = COMI_DI_GetOne(ghDevice, 0); // DI CH0 m_svalue = (nstate)? ON : OFF ; // DI 1 ON 0 OFF UpdateData(FALSE); // } CDialog::OnTimer(nIDEvent); -59-
[ 220] OnTimer SetTimer() OnInitDialog() SetTimer() SetTimer 1 1 BOOL CExp2_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } SetTimer(0, 10, NULL); // 10ms } return TRUE; // return TRUE unless you set the focus to a control -60-
: : : : 1) 2)? 3) PNP COMI-SD104 4) OFF ON -61-
-62-
- - - - Visual C++ - COMI-SD104 - COMI-EDKIT1 - (, ) 1, () ( ),,,, -63-
[ 221] -64-
( LED : Light Emitting Diode) PN (P N ) ( Elector-luminescence ) diode, PN, diode diode Photo Diode, Photo Transistor diode [ 222] PN diode [ 223(a)] (GaAs)home Peak 940 N Epitaxial P,N, P, N Epitaxial [ 223 (b)] GaAlAs AlAs GaAs ( G ao65alo35as) diode PN Single Hetero (a), (b) -65-
[ 223] diode P N level (VD) (hole) (VF) ( ) N P, P N (hole) (Carrier), PN, P () () -() gap diode GaAs (Photo Diode) Energy Energy PN Energy Energy,,, PCM TV VTR -66-
[ 224] (Photo Transister) (Base) PN, Photo Diode Bipolar Transistor -67-
[ 225], ( ) [ 226] -68-
[ 227], [ 228] -69-
2 COMI-EDKIT1 Autonics BY500 [ 229] [ 229] BY500 COMI-EDKIT1 [ 230] ( ) PC817 (Photo-coupler) COMI-SD104-70-
[ 230] COMI-SD104 COMI-EDKIT1 [ 31] -71-
[ 231] COMI-EDKIT1 COMI-SDT1 221 (ON/OFF) OFF ON 0 Reset [ 232] -72-
[ 232] 22 222 Visual C++File New (Dialog based) Exp2_2 [ 233] -73-
[ 234] 223 3 [ 235] 22 ID IDC_STATIC Static text (Title) IDC_EDIT1 EDIT BOX IDC_Reset Button [21] 22-74-
224 COMI-SD104 COMI-SD104 DAQ C:\Program Files\COMIZOA\COMIDAS-CPSD\Window\C_CPP\Lib Comidascpp, Comidash ComidasCommonh VC++Project => Add To Project => Files 3 [ 236] COMI-SD104 Comidascpp -75-
Exp2_2Dlgcpp #include Comidash ghdevice #include "stdafxh" #include "Exp2_2h" #include "Exp2_2Dlgh" #include "Comidash" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif ///////////////////////////////////////////////////////////////////////////// // CExp2_2Dlg dialog HANDLE ghdevice; CExp2_2Dlg::CExp2_2Dlg(CWnd* pparent /*=NULL*/) : CDialog(CExp2_2Dlg::IDD, pparent) { //{{AFX_DATA_INIT(CExp2_2Dlg) m_svalue = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hicon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } 225 Exp2_2Dlgh class CExp2_2Dlg : public CDialog { private: BOOL m_bstateprv; // Construction public: CExp2_2Dlg(CWnd* pparent = NULL); } // standard constructor -76-
m_bstateprv BOOL ON OFF [22] 22 226 OnInitDialog Exp2_2Dlgcpp OnInitDialog COMI-SD104 BOOL CExp2_2Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here m_bstateprv = 0; if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } SetTimer(0, 10, NULL); // 10ms } return TRUE; // return TRUE unless you set the focus to a control 227 OnClose [ 237] OnClose COMI-SD104 (Unload) -77-
[ 237] OnClose OnClose void CExp2_2Dlg::OnClose() { // TODO: Add your message handler code here and/or call default KillTimer(0); COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 228 m_dwcount UINT (Member variable) -78-
[ 238] 229 (10ms ) COMI-SD104, OFF ON [ 239] OnTimer [ 239] -79-
OnTimer Exp2_2Dlgcpp OnTimer() OnTimer void CExp2_2Dlg::OnTimer(UINT nidevent) { // TODO: Add your message handler code here and/or call default BOOL bstate; bstate = COMI_DI_GetOne(ghDevice, 0); // DI CH0 if(bstate &&!m_bstateprv){ // OFF ON m_dwcount++; UpdateData(FALSE); } m_bstateprv = bstate; CDialog::OnTimer(nIDEvent); } SetTimer() OnInitDialog() SetTimer() SetTimer 1 1 BOOL CExp2_2Dlg::OnInitDialog() { CDialog::OnInitDialog(); m_bstateprv = 0; if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } SetTimer(0, 10, NULL); // 10ms } return TRUE; // return TRUE unless you set the focus to a control -80-
: : : : 1) 2) 3), -81-
-82-
3 COMI-SD104 DAQ LED, 7-SEGMENT,, 31 LED 87 32 7-SEGMENT 97 33 109 34 113-83-
3 3 COMI-SD104 DAQ LED, 7-SEGMENT,, 1 LED(Light Emitting Diode)ON/OFF [ 31] LSB 1 LED [ 31] 1 LED LED CPU (Accumulator)LSB 0 1,, LED, OUT 1-84-
SELECT 1 SELECT=1, OUT=1 D D D LSB Q Q 1 0LED, Q 0 1 LED 31 COMI-SD104 BOOL COMI_DO_PutOne (HANDLE hdevice, int ch, int status) Digital Output Status - hdevice : COMI_LoadDevice() - ch : Digital Output 0 - status : Status 0 - OFF, 1 - ON - Return : 1 => 0 => BOOL COMI_DO_PutAll (HANDLE hdevice, DWORD dwstatuses) Digital Output COMI-SD104 8 dwstatuses BIT0 ~ BIT7 D/O CH0 ~ CH7 - hdevice : COMI_LoadDevice() SD104 8 dwstatuses BIT0 ~ BIT7 D/O CH0 ~ CH7 - Return : 1 => 0 => - dwstatuses : Digital Output Status 32 bit COMI- -85-
31 LED -LED - LED, LED - - Visual C++ - COMI-SD104 - COMI-EDKIT1 - LED 1 GaAs, GaP, GaAsP PN PN (Energy Gap) (Excess carrier) LED LED 2V -86-
20mA, LED [ 32] LED 2 COMI-SD104 COMI-EDKIT1 LED [ 33] : LED LED LED -87-
[ 33] LED COMI-EDKIT1 COMI-SDT1 221 [ 34] 8 8 LED ON/OF LED LED LED -88-
[ 34] 31 222 Visual C++File New (Dialog based) LED Exp3_1 [ 35] -89-
[ 36] 223 8 (Push button) (Check box) [ 37] 31-90-
ID CAPTION IDC_CHECK1 Check Box DO0 (Push button) IDC_CHECK2 Check Box DO1 (Push button) IDC_CHECK3 Check Box DO2 (Push button) IDC_CHECK4 Check Box DO3 (Push button) IDC_CHECK5 Check Box DO4 (Push button) IDC_CHECK6 Check Box DO5 (Push button) IDC_CHECK7 Check Box DO6 (Push button) IDC_CHECK8 Check Box DO7 (Push button) [31] 22 Check Box (Push button) Check Box Push like [ 38] Push-like 224 COMI-SD104 COMI-SD104 DAQ -91-
C:\Program Files\COMIZOA\COMIDAS-CPSD\Window\C_CPP\Lib Comidascpp, Comidash ComidasCommonh VC++Project => Add To Project => Files 3 [ 39] COMI-SD104 Comidascpp Exp3_1Dlgcpp #include Comidash ghdevice #include "stdafxh" -92-
#include "Exp3_1h" #include "Exp3_1Dlgh" #include "Comidash" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif ///////////////////////////////////////////////////////////////////////////// // Cexp3_1Dlg dialog HANDLE ghdevice; Cexp3_1Dlg::Cexp3_1Dlg(CWnd* pparent /*=NULL*/) : CDialog(Cexp3_1Dlg::IDD, pparent) { //{{AFX_DATA_INIT(Cexp3_1Dlg) m_svalue = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hicon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } 226 OnInitDialog Exp2_2Dlgcpp OnInitDialog COMI-SD104 BOOL CExp2_2Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } -93-
COMI_DO_PutAll(ghDevice, 0x00); // OFF } return TRUE; // return TRUE unless you set the focus to a control 227 OnClose OnClose void Cexp3_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 227 (Push button) 8 BN_CLICKED LED IDC_CHECK1 void CExp3_1Dlg::OnCheck1() { // // BOOL bstate = ((CButton *)GetDlgItem(IDC_CHECK1))->GetCheck(); // D/O CH0 // COMI_DO_PutOne(ghDevice, 0, bstate); } IDC_CHECK2 ~ IDC_CHECK8-94-
: LED : : : 1) LED? 2) LED 3) 8 LED 01 8 LED 2-95-
32 7- - 7-SEGMENT - 7-SEGMENT, 7-SEGMENT - - Visual C++ - COMI-SD104 - COMI-EDKIT1-7-SEGMENT 1 7 7 LED LCD Back Light 7 a g, 0 9 7 7 IC 2-3 7-96-
[ 310] 2 COMI-SD104 COMI-EDKIT1 LED [ 311] : 7-SEGMENT LED 7SEGMENT -97-
[ 311] 221 COMI-SD104 7-SEGMENT [ 312] 7 7-SEGMENT 7- SEGMENT SEGMENT ON/OFF 16 7-SEGMENT ( ) 7-98-
[ 312] 31 222 Visual C++File New (Dialog based) LED Exp3_2 [ 313] -99-
[ 314] 223 7 (Push button) [ 315] 32-100-
ID CAPTION IDC_CHECK1 Check Box A (Push button) IDC_CHECK2 Check Box B (Push button) IDC_CHECK3 Check Box C (Push button) IDC_CHECK4 Check Box D (Push button) IDC_CHECK5 Check Box E (Push button) IDC_CHECK6 Check Box F (Push button) IDC_CHECK7 Check Box G (Push button) IDC_EDIT1 Edit Box 7 16 [32] 32 7-SEGMENT Check Box Check Box Push like Flat [ 316] Push-like 224 COMI-SD104 COMI-SD104 DAQ -101-
C:\Program Files\COMIZOA\COMIDAS-CPSD\Window\C_CPP\Lib Comidascpp, Comidash ComidasCommonh VC++Project => Add To Project => Files 3 [ 317] COMI-SD104 Comidascpp Exp3_2Dlgcpp #include Comidash ghdevice #include "stdafxh" #include "Exp3_2h" #include "Exp3_2Dlgh" -102-
#include "Comidash" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif ///////////////////////////////////////////////////////////////////////////// // Cexp3_2Dlg dialog HANDLE ghdevice; Cexp3_2Dlg::Cexp3_2Dlg(CWnd* pparent /*=NULL*/) : CDialog(Cexp3_2Dlg::IDD, pparent) { //{{AFX_DATA_INIT(Cexp3_2Dlg) m_svalue = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hicon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } 226 OnInitDialog Exp3_2Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp3_2Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } -103-
COMI_DO_PutAll(ghDevice, 0x00); // OFF SetTimer(0, 10, NULL); } return TRUE; // return TRUE unless you set the focus to a control 227 OnClose OnClose void Cexp3_2Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 228 7-SEGMENT 7 (7 ) 16 m_shexaval CString (Member variable) [ 318] 229 7-SEGMENT (10ms ) -104-
7-SEGMENT void CExp3_2Dlg::OnTimer(UINT nidevent) { ULONG dwdostates=0x00; BOOL bstates; int nids[7]={idc_check1, IDC_CHECK2, IDC_CHECK3, IDC_CHECK4, IDC_CHECK5, IDC_CHECK6, IDC_CHECK7}; for(int i=0; i<7; i++){ // // bstates = ((CButton*)GetDlgItem(nIDs[i]))->GetCheck(); // 32 1 0 // dwdostates = (bstates)? dwdostates (1<<i): dwdostates & ~(1<<i); } // // COMI_DO_PutAll(ghDevice, dwdostates); // 7 16 (Hexa decimal) // m_shexavalformat("0x%x", dwdostates); UpdateData(FALSE); } CDialog::OnTimer(nIDEvent); OnInitDialog BOOL Cexp3_2Dlg::OnInitDialog() { CDialog::OnInitDialog(); if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); //return TRUE; } COMI_DO_PutAll(ghDevice, 0x00); // OFF SetTimer(0, 10, NULL); } return TRUE; // return TRUE unless you set the focus to a control -105-
: 7-SEGMENT : : : 1)? 2) 7-SEGMENT -106-
-107-
33 -, - - Visual C++ - COMI-SD104 - COMI-EDKIT1-1 -108-
[ 319] -109-
: : : : 1) 2) -110-
-111-
34 - -, - - Visual C++ - COMI-SD104 - COMI-EDKIT1-1) stepping motor(pulse motor, stepper motor) OA, FA stepping motor AC servo, DC servo motor DC servo motor stepping motor, stepping motor pulse digital micom motor stepping motor DC motor AC motor shaft feedback,,, system,,, system motor -112-
( ) stepping motor pulse rate stepping motor serial print,printer head, XY Plotter floppy disk head,,,, 1) 1 step 5% 1), step, 2) 2) feedback 2), 3) driver 3) DC motor brush pulse torque DC motor 4) 5) servo motor [33] 3, 4, 5, VR, PM 4 PM [ 320] [ 321] S1 ON 1 S N S1 OFF, S2 ON 2 90 S1 S4 90-113-
[ 320] 4 PM( ) -114-
[ 321] 2 COMI-SD104 ( ) COMI-EDKIT1 SLA7024M IC, [ 322] SLA7024M -115-
[ 322] COMI-EDKIT1 COMI-SD104 COMI-EDKIT1 [ 323] -116-
[ 323] COMI-EDKIT1 COMI-SDT1 221 COMI-SD104 [ 324] -117-
[ 324] 31 - :, - :, msec - :, - CCW- : - CW- : 222-118-
[ 325] 34 ID CAPTION IDC_Mode0 Radio button HALF STEP MODE Group IDC_Mode1 Radio button NORMAL MODE IDC_Mode2 Radio button WAVE DRIVE MODE IDC_Interval Edit Box IDC_NumStep Edit Box IDC_DriveCCW Button << CCW- IDC_DriveCW Button << CW- [34] 34 Radio button 3 (Radio button), 3-119-
OFF (Tab order) ( IDC_Mode0) Group, Group [ 326] Group 223 COMI-SD104 COMI-SD104 DAQ 1 2 224 OnInitDialog Exp3_4Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp3_4Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here // SPIN Control // ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1))->SetRange(1, 1000); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1))->SetRange(1, 10000); if(!comi_loaddll()){ -120-
} MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } COMI_DO_PutAll(ghDevice, 0x00); // OFF return TRUE; // return TRUE unless you set the focus to a control 225 OnClose OnClose void Cexp3_4Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 226 CONTROL ID Variable name CATEGORY Variable type IDC_Mode0 m_nmode VALUE INT IDC_Interval m_ninterval Value UINT IDC_NumStep m_nnumstep Value UINT [35] m_nmode 3 Radio Radio -121-
0, Radio 1, 2 226 AccurateTimer AccurateTimer 1msec (Delay) Mode0Drive(), Mode1Drive(), Mode2Drive() AccurateTimer AccurateTimercpp AccurateTimerh CExp3_4DlgCPP #include AccurateTimerh #include "stdafxh" #include "Exp3_4h" #include "Exp3_4Dlgh" #include "Comidash" #include "AccurateTimerh" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif 227 MODE0 (HALF STEP MODE) HALF STEP MODE [ 327] 8-122-
[ 327] HALF STEP MODE HALF STEP MODE void Mode0Drive(int ndir, UINT ninterval, UINT nnumstep) { WORD wcommand[2][8] = { {0x5, 0x1, 0x9, 0x8, 0xa, 0x2, 0x6, 0x4}, /* command */ {0x4, 0x6, 0x2, 0xa, 0x8, 0x9, 0x1, 0x5} /* command */ }; int ncommidx; AccurateTimer AccTimer; for(uint i=0; i<nnumstep; i++) { // COMMAND COMMAND // // // ncommidx = i%8; // COMMAND COMMAND COMI_DO_PutAll(ghDevice, wcommand[ndir][ncommidx]); AccTimerWait(nInterval); // Interval // } } MODE1 (NORMAL DRIVE MODE) NORMAL DRIVE MODE 2-Phase-On, [ 328] 4, CH0 CH2, CH1 CH3 ON OFF -123-
[ 328] NORMAL DRIVE MODE NORMAL DRIVE MODE void Mode1Drive(int ndir, UINT ninterval, UINT nnumstep) { WORD wcommand[2][4] = { {0x5, 0x9, 0xa, 0x6}, /* command */ {0x6, 0xa, 0x9, 0x5} /* command */ }; int ncommidx; AccurateTimer AccTimer; for(uint i=0; i<nnumstep; i++) { // COMMAND COMMAND // // // ncommidx = i%4; // COMMAND COMMAND COMI_DO_PutAll(ghDevice, wcommand[ndir][ncommidx]); AccTimerWait(nInterval); // Interval // } } MODE2 (WAVE DRIVE MODE) WAVE DRIVE MODE 1-Phase-On, [ 329] 4, ON OFF -124-
[ 329] WAVE DRIVE MODE WAVE DRIVE MODE void Mode2Drive(int ndir, UINT ninterval, UINT nnumstep) { WORD wcommand[2][4] = { {0x1, 0x8, 0x2, 0x4}, /* command */ {0x4, 0x2, 0x8, 0x1} /* command */ }; int ncommidx; AccurateTimer AccTimer; for(uint i=0; i<nnumstep; i++) { // COMMAND COMMAND // // // ncommidx = i%4; // COMMAND COMMAND COMI_DO_PutAll(ghDevice, wcommand[ndir][ncommidx]); AccTimerWait(nInterval); // Interval // } } 228 (CW) IDC_DriveCW, #define DIR_CW 0 #define DIR_CW 0 void CExp3_4Dlg::OnDriveCW() { // // GetDlgItem(IDC_DriveCW)->EnableWindow(FALSE); -125-
GetDlgItem(IDC_DriveCCW)->EnableWindow(FALSE); // // UpdateData(); } switch(m_nmode) { case 0: // HALF STEP MODE Mode0Drive(DIR_CW, m_ninterval, m_nnumstep); break; case 1: // NORMAL DRIVEP MODE Mode1Drive(DIR_CW, m_ninterval, m_nnumstep); break; case 2: // WAVE DRIVE MODE Mode2Drive(DIR_CW, m_ninterval, m_nnumstep); break; } // // GetDlgItem(IDC_DriveCW)->EnableWindow(TRUE); GetDlgItem(IDC_DriveCCW)->EnableWindow(TRUE); 228 (CCW) IDC_DriveCCW, #define DIR_CCW 0 #define DIR_CW 0 void CExp3_4Dlg::OnDriveCW() { // // GetDlgItem(IDC_DriveCW)->EnableWindow(FALSE); GetDlgItem(IDC_DriveCCW)->EnableWindow(FALSE); // // UpdateData(); switch(m_nmode) { case 0: // HALF STEP MODE Mode0Drive(DIR_CCW, m_ninterval, m_nnumstep); break; case 1: // NORMAL DRIVEP MODE Mode1Drive(DIR_CCW, m_ninterval, m_nnumstep); break; case 2: // WAVE DRIVE MODE Mode2Drive(DIR_CCW, m_ninterval, m_nnumstep); break; } // // GetDlgItem(IDC_DriveCW)->EnableWindow(TRUE); GetDlgItem(IDC_DriveCCW)->EnableWindow(TRUE); -126-
} -127-
: : : : 1) HALF STEP MODE, NORMAL DRIVE MODE, WAVE DRIVE MODE 2) ON, -128-
-129-
41 139-130-
4 1) RS (RS-FF) RS ( RS-FF) (Set) S, (Reset) R, [ 41]NAND 2RS-FF S=0, R=1 Q (Q=1), S=1, R=0 Q (Q=0) S, R (Low level) (Active low) [ 41 (b)]rs-ff( ), Q Q S, R 0-131-
(a) NAND RS-FF [ 41] RS (b) RS-FF [ 42] RS S R Q Q 0 0 * * 0 1 1 0 1 0 0 1 1 1 Q Q [41] RS -132-
2) D (D-FF) D 0 1 Q 0 1 [ 43] D [ 44] D [ 44] RS-FF S (CK) (D)AND, R (D)NOT (CK)AND Q D CK 0 D CK (Rising Edge) D Q ( ) (CK)D(Delay) 3) JK (JK-FF) J-K FF [ 45] RS AND Gate RS-FF 1 (toggle) J K 1, Q 0 (CK) Q 1, 0, 1, 0 1-133-
J K Q 0 0 1 1 0 1 0 1 Q 0 1 Q [ 45] JK [ 46] JK 4) T (T-FF) [ 47] JK-FF T-FF [ 48] T-FF -134-
T T (T-FF) T (Toggle) [ 47] JK-FF J, K 1, CK Q [ 48] 2 1 2 (FF),,, 3 FF FF FF COMI-SD104 3 [ 49] (Asynchronous couter) (Ripple counter) [ 49 (a)]3 T-FF 8 T-FF CK Q A, Q B, Q C FF [ 49 (b)] FF 2 1 QA LSB, QC MSB [42] Q C, Q B, Q A 2 2, 2 1, 2 0 2 (000) 2 = 0 CK (111) 2 = 7 (000) 2 8 (3 2 ) -135-
[ 49] 3 2 ( 8 ) 0 1 2 3 4 5 6 7 QC (2 2 ) 0 0 0 0 1 1 1 1 QB (2 1 ) (8) 0 0 0 0 1 1 0 0 1 1 QA (2 0 ) 0 1 0 1 0 1 0 1 0 [42] 3 2-136-
43 COMI-SD104 void COMI_ClearCounter32 (HANDLE hdevice, int ch) 0 (reset) - hdevice : COMI_LoadDevice() - ch : Counter 0 ULONG COMI_ReadCounter32 (HANDLE hdevice, int ch) - hdevice : COMI_LoadDevice() - ch : Counter 0 - Return : (32 ) -137-
-138-
41 - - - - Visual C++ - COMI-SD104-1 ( ), 11 3, -139-
(Schimidt trigger) -, [ 410] [ 411],,,,, -140-
[ 411] / ( ) 0,, 1, 12 (Incremental encoder) [ 412] -141-
(A ), (B ) (Z ) 3, A B 90 1 1000 T=036(360/1000), 1 A B 1000 [ 412] 13 (Shaft)0 360, (BCD, Binary, Gray ), (Shaft) ( ) ( ) -142-
[ 413] 2 A B (Up)/ (Down), A, B / COMI-SD104 GATE / COMI-SD104 CLK GATE GATE (Enable) (Disable), GATE HIGH LEVEL CLK GATE LOW LEVEL CLK [ 414] A CH0 (CNT0)CH1 GATE (GATE1), B CH1 (CNT1) CH0 GATE (GATE0), CH1-143-
, CH0 CH1 CH0 [ 414] 221 COMI-SD104 [ 415] -144-
[ 415] 41 - COUNTER 0 : COUNTER0 CH0 - COUNTER 1 : COUNTER0 CH1 - CNT1-CNT0 : COUNTER1 COUNTER0 - Reset : 0 222-145-
[ 416] 41 ID CAPTION IDC_Count0 Edit box COUNTER0 IDC_Count1 Edit box COUNTER1 IDC_Diff Edit box CNT1-CNT0 IDC_Reset Button RESET 0 [43] 41 223 COMI-SD104 COMI-SD104 DAQ 1 2 224 OnInitDialog Exp4_1Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp4_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); -146-
// Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon } // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } COMI_ClearCounter32(ghDevice, 0); // COUNTER0 Clear COMI_ClearCounter32(ghDevice, 1); // COUNTER1 Clear SetTimer(0, 10, NULL); return TRUE; // return TRUE unless you set the focus to a control 225 OnClose OnClose void Cexp4_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 226 (10ms ) COMI-SD104 1 2 void CExp4_1Dlg::OnTimer(UINT nidevent) { // COUNTER CH0 // m_ncount0 = COMI_ReadCounter32(ghDevice, 0); // COUNTER CH1 // -147-
m_ncount1 = COMI_ReadCounter32(ghDevice, 1); // // m_ndiff = m_ncount1 - m_ncount0; UpdateData(FALSE); // } CDialog::OnTimer(nIDEvent); 226 Reset Reset void CExp4_1Dlg::OnReset() { COMI_ClearCounter32(ghDevice, 0); // COUNTER0 Clear COMI_ClearCounter32(ghDevice, 1); // COUNTER1 Clear m_ncount0 = 0; m_ncount1 = 0; m_ndiff = 0; } -148-
: : : : 1) A/B 2 4 2, 4 2) -149-
-150-
5 51 DC 155-151-
5 0 1,, A/D(Analog to Digital),, D/A(Digital to Analog),,, D/A, ON 8I 0 OFF S 3 S 2 4I 0 S 1 2I 0 I 0 S 0 I R V out [ 51] D/A -152-
[ 51] D/A 2 n S 0 ~S 3 R, S 0 ~S 3 1 0 ON/OFF, 1101 2 S 0 ~ S 3, R I I = 8I = I 0 + 4I 0 + 1I 0 = (8 + 4 + 1) I 0 13, V out = RI = 13RI 0 1101 2 (=13), D/A 2 n (Resistance divider), D/A, IC FET, D/A (Operational amplifier) D/A,, 8, D/A D/A (Accuracy) (Resolution) D/A,, 10[V], 10% D/A 9 ~ 11[V], D/A, LSB, 2 4 D/A LSB 1/16, 4 D/A 111 2 16[V] LSB 1[V] 0-153-
1 D/A -154-
51 DC - Faraday s - - DC DC - - Visual C++ - COMI-SD104 - COMI-EDKIT1 - DC 1 DC MOTOR,, ( ),, MOTOR, MOTOR 11 MOTOR 1) Faraday'S 1830 Michael Faraday Joseph Henly -155-
(EMF) B V (E)Vector E = B x V, r, (I)I = E/r = B x V/r Mortor, L I, FF = BLIsinθ( θ: ) [ 52] FARADAY S, F BI Faraday's, 2) :,,, F = B x V = B x Ir -156-
:,, E = F x B -E = B x F Faraday DC Motor [ 53] DC [ 52] AB CD (, AB CD ), ( Rotational Kinetic Energy ) 180 BACD, BA CD -157-
[ 53] DC 12 DC MOTOR [ 54] DC DC ( ),,, -158-
: ( ) : : ( ) : : 13 DC MOTOR T-I ( ), T-N ( ),,, -159-
[ 55] DC 2 DC COMI-SD104 DC DC COMI-EDKIT1 DC [ 56] COMI-EDKIT1 DC (R3) DC DC (TIP31C) SD104 (TIP31C) (Base) DC (DC 12V), COMI- -160-
(LM741) [ 56] COMI-EDKIT1 DC COMI-SD104 COMI-EDKIT1 DC DC [ 57] -161-
[ 57] DC COMI-EDKIT1 COMI-SDT1 221 COMI-SD104 DC [ 58] -162-
[ 58] 51 - : - UP/DOWN STEP : UP DOWN - DOWN : UP/DOWN STEP - UP : UP/DOWN STEP - START : - STOP : 0V 222-163-
[ 59] 51 ID IDC_Volt IDC_Step Radio button Radio button CAPTION, UP/DOWN STEP, / IDC_DOWN Radio button <<(DOWN) IDC_UP Edit Box >>(UP) IDC_START Edit Box START IDC_STOP Button STOP [51] 34 0[V] 223 COMI-SD104 COMI-SD104 DAQ 1 2-164-
224 OnInitDialog Exp5_1Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp5_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } COMI_DA_Out(ghDevice, 0, 0); // 0[V] } return TRUE; // return TRUE unless you set the focus to a control 225 OnClose OnClose void Cexp5_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); } CDialog::OnClose(); 226-165-
CONTROL ID Variable name CATEGO RY Variable type IDC_Volt m_foutvolt VALUE FLOAT IDC_Step m_fupdownstep VALUE float UP/DOWN STEP [52] 227 Start Start COMI-SD104 CH0 Start void CExp5_1Dlg::OnStart() { UpdateData(); // // 10V // COMI_DA_Out(ghDevice, 0, 10); Sleep(100); // // COMI_DA_Out(ghDevice, 0, m_foutvolt); } : DC 10V 228 Stop Stop COMI-SD104 CH0 0[V] Start void CExp5_1Dlg::OnStop() { -166-
} COMI_DA_Out(ghDevice, 0, 0); 229 >>(UP), <<(DOWN) UP/DOWN UP/DOWN STEP void CExp5_1Dlg::OnSpeedDown() { UpdateData(); m_foutvolt -= m_fupdownstep; COMI_DA_Out(ghDevice, 0, m_foutvolt); UpdateData(FALSE); } void CExp5_1Dlg::OnSpeedUp() { UpdateData(); m_foutvolt += m_fupdownstep; COMI_DA_Out(ghDevice, 0, m_foutvolt); UpdateData(FALSE); } -167-
: DC : : : 1) DC 2) DC -168-
A/D(Analog to Digital) 61 175 62 187-169-
6 A/D(Analog to Digital), A/D D/A, D/A A/D (Simultaneous type) (Counter type) A/D 61 A/D A/D (Comparator circuit), [ 61]3 A/D [ 61] 3 A/D 2, [ 61] 0[V], (ON) +V[V] -170-
[ 61], C 1 =0, C 2 =0, C 3 =0, 0 ~ 1[V] C 1 C 2, C 3 C 2, C 3, 1 ~ 2[V], C 1 C 2 C 3 2 ~ 3 [v] C 1, C 2, C 3 3 ~ 4[V] [ 61] C 1 C 2 C 3 0 ~ 1 [V] 0 0 0 1 ~ 2 [V] 1 0 0 2 ~ 3 [V] 1 1 0 3 ~ 4 [V] 1 1 1 [61] A/D [ 61] C 1, C 2, C 3 2 A/D, 2 n 2 n -1, A/D, 62 A/D 1 A/D -171-
, 2 D/A [ 62]1 A/D V i V R [ 62] A/D, 0 (Reset), 0 D/A V R 0,, (CP), D/A L, (V R ) V i V R [ 63] A/D -172-
[ 64] A/D [ 62] A/D 0, [ 63] [ 63] H, / (Up), (Down) H, D/A, (Up) H [ 64],, 0 1 A/D, -173-
, -174-
61 - - - - - Visual C++ - COMI-SD104 - COMI-EDKIT1-1 (RTD),, [ 62] 0 100( ), (61) -175-
2 R = R 1+ α t + βt ) R (1 + α ) (61) 0 ( 0 t, R 0 0, R t,,, 100 R 100 R 0 R 100 /R 0 13916 039%/ (L), (M), (H)3,, [63] (Joule s heat) 2mA( 5mA) * 100 α / 0-200 ~ 640 3910-3, 0 ~ 180 4310-3, -50 ~ 300 6710-3 * 0 100 [62] -176-
() (ma) () Pt100 100(0) (L) 015 ± 006 ± (015+00015T) (M) 02 ± 006 ± (0015+002T) (H) 05 ± 012 ± (03+0005T) 2 5 () T [63] (JIS C 1604) 2 2, 3 4 [ 65] 2 r Pt100(0100 ) 1 4 (OP AMP) -177-
() (a) 2 () () (b) 3 () (c) 4 [ 65] -178-
2 COMI-EDKIT1 [ 66] VR2 GAIN VR3 (OFFSET) OFFSET OFFSET [ 66] COMI-EDKIT1 PT100 COMI-SD104 COMI-EDKIT1 [ 67] -179-
[ 67] COMI-EDKIT1 COMI-SDT1 221 COMI-SD104 A/D A/D A/D A/D A/D -180-
[ 68] - : - A/D : - A/D : A/D 222 [ 69] 61-181-
ID CAPTION IDC_Channel Edit Box IDC_AdRange Combo Box A/D IDC_AdValue Edit Box A/D A/D Voltage (VOLT) [64] 61 223 COMI-SD104 COMI-SD104 DAQ 1 2 224 OnInitDialog Exp6_1Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp6_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here // SPIN Control // ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1))->SetRange(0, 15); if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } -182-
// A/D 10V~+10V // for(int i=0; i<16; i++) COMI_AD_SetRange(ghDevice, 0, -10, 10); } SetTimer(0, 100, NULL); // 10ms return TRUE; // return TRUE unless you set the focus to a control 225 OnClose OnClose void Cexp6_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); CDialog::OnClose(); 226 CONTROL ID Variable name CATEGO RY Variable type IDC_AdRange m_nadrangeidx VALUE INT IDC_AdValue m_fadvalue VALUE FLOAT A/D IDC_Channel m_nchannel VALUE INT A/D [65] 227 A/D A/D A/D COMI-SD104-183-
Combo Box CBN_SELCHANGE [ 610] IDC_AdRange CBN_SELCHANGE [ 610] CBN_SELCHANGE void CExp6_1Dlg::OnSelchangeAdRange() { float vmin_list[8]={0,0,0,0,-1,-2,-5,-10}; float vmax_list[8]={1,2,5,10,1,2,5,10}; UpdateData(); COMI_AD_SetRange(ghDevice, m_nchannel, vmin_list[m_nadrangeidx], vmax_list[m_nadrangeidx]); } 228 A/D (100ms ) COMI-SD104 A/D 1 2 void CExp6_1Dlg::OnTimer(UINT nidevent) { // A/D // UpdateData(); // COMI-SD104 A/D // -184-
m_fadvalue = COMI_AD_GetVolt(ghDevice, m_nchannel); // A/D // UpdateData(FALSE); } CDialog::OnTimer(nIDEvent); -185-
: : : : 1) 2), -186-
62 - - - - Visual C++ - COMI-SD104 - COMI-EDKIT1 1 (Potentio-meter) [ 611],,, [ 612] -187-
(R0)R 0 R L /(R 0 +R L ) (Linearity) (Loading error) (62) δ = R P R ( R 0 ( R 0 0 + R R L P ) ) R 2 0 100[%] [ 611] (a) (b) [ 612] -188-
R P 100 (Smoothness), 2 COMI-SD104 COMI-EDKIT1 [ 613] [ 613] COMI-EDKIT1 COMI-SDT1-189-
221 COMI-SD104 A/D A/D A/D A/D A/D [ 614] - : - A/D : - A/D : A/D 222-190-
[ 615] 61 ID CAPTION IDC_Channel Edit Box IDC_AdRange Combo Box A/D IDC_AdValue Edit Box A/D A/D Voltage (VOLT) [66] 61 223 COMI-SD104 COMI-SD104 DAQ 1 2 224 OnInitDialog Exp6_1Dlgcpp OnInitDialog COMI-SD104 BOOL Cexp6_1Dlg::OnInitDialog() { CDialog::OnInitDialog(); -191-
// Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here // SPIN Control // ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1))->SetRange(0, 15); if(!comi_loaddll()){ MessageBox ("COMIDAS ", "Error", MB_ICONERROR MB_OK); return TRUE; } ghdevice = COMI_LoadDevice(COMI_SD104, 0); if(ghdevice==invalid_handle_value){ MessageBox ("COMI-SD104 ", "Error", MB_ICONERROR MB_OK); return TRUE; } // A/D -10~+10 // for(int i=0; i<16; i++) COMI_AD_SetRange(ghDevice, 0, -10, 10); } SetTimer(0, 100, NULL); // 10ms return TRUE; // return TRUE unless you set the focus to a control 225 OnClose OnClose void Cexp6_1Dlg::OnClose() { // TODO: Add your message handler code here and/or call default COMI_UnloadDevice(ghDevice); COMI_UnloadDll(); CDialog::OnClose(); 226-192-
CONTROL ID Variable name CATEGO RY Variable type IDC_AdRange m_nadrangeidx VALUE INT IDC_AdValue m_fadvalue VALUE FLOAT A/D IDC_Channel m_nchannel VALUE int A/D [67] 227 A/D A/D A/D COMI-SD104 Combo Box CBN_SELCHANGE [ 617] IDC_AdRange CBN_SELCHANGE [ 617] CBN_SELCHANGE -193-
void CExp6_1Dlg::OnSelchangeAdRange() { float vmin_list[8]={0,0,0,0,-1,-2,-5,-10}; float vmax_list[8]={1,2,5,10,1,2,5,10}; UpdateData(); COMI_AD_SetRange(ghDevice, m_nchannel, vmin_list[m_nadrangeidx], vmax_list[m_nadrangeidx]); } 228 A/D (100ms ) COMI-SD104 A/D 1 2 void CExp6_1Dlg::OnTimer(UINT nidevent) { // A/D // UpdateData(); // COMI-SD104 A/D // m_fadvalue = COMI_AD_GetVolt(ghDevice, m_nchannel); // A/D // UpdateData(FALSE); } CDialog::OnTimer(nIDEvent); -194-
: : : : 1) 2) DC 3) -195-
-196-
COMI-SD104 DAQ DOS -197-
COMI_DI_GetOne() D/I CH0 #include <stdioh> #include <conioh> #include "Comidasc" #define DI_CH 0 void main (void) { HANDLE hdevice; int di_state; hdevice = COMI_LoadDevice (COMI_SD104, 0); if(hdevice == INVALID_HANDLE_VALUE){ printf("can't load specified device!"); exit(0); } clrscr(); while(!kbhit()) { /* Get D/I and print on screen */ di_state = COMI_DI_GetOne(hDevice, DI_CH); gotoxy (10, 10); printf("status of D/I CH%d = %d\n", DI_CH, di_state); } } COMI_UnloadDevice(hDevice); COMI_DO_PutOne() D/O CH0 ON/OFF #include <stdioh> -198-
#include <conioh> #include "Comidasc" #define DO_CH 0 void main (void) { HANDLE hdevice; int do_state=0; hdevice = COMI_LoadDevice (COMI_SD104, 0); if(hdevice == INVALID_HANDLE_VALUE){ printf("can't load specified device!"); exit(0); } clrscr(); while(!kbhit()) { do_state ^= 1; /* toggle the state of D/O channel */ COMI_DO_PutOne (hdevice, DO_CH, do_state); /* Put D/O */ gotoxy (10, 10); Printf( D/O State = %d, do_state); delay(500); } } COMI_UnloadDevice(hDevice); COMI_DO_PutAll() 8 ON/OFF #include <stdioh> #include <conioh> #include "Comidasc" #define DO_CH 0 void main (void) { HANDLE hdevice; DWORD do_states=0; hdevice = COMI_LoadDevice (COMI_SD104, 0); if(hdevice == INVALID_HANDLE_VALUE){ printf("can't load specified device!"); exit(0); -199-
*/ } channels */ clrscr(); while(!kbhit()) { do_states = ~do_states; /* toggle the states of D/O channels } COMI_DO_PutAll (hdevice, do_states); gotoxy (10, 10); Printf( D/O States = %x, do_states); delay(500); /* Put D/O for all } COMI_UnloadDevice(hDevice); D/A CH0 0V 5V #include <stdioh> #include <conioh> #include "Comidasc" #define DA_CH 0 void main (void) { HANDLE hdevice; DWORD do_states=0, di_states; int i, di_each[8]; hdevice = COMI_LoadDevice (COMI_SD104, 0); if(hdevice == INVALID_HANDLE_VALUE){ printf("can't load specified device!"); exit(0); } clrscr(); while(!kbhit()) { printf("d/a Out 5 volt!\n"); COMI_DA_Out (hdevice, DA_CH, 5f); /* Output 5 volt through D/A channel 0 */ delay(1000); /* 1 sec delay */ printf("d/a Out 0 volt!\n"); COMI_DA_Out (hdevice, DA_CH, 0f); /* Output 0 volt through D/A channel 0 */ delay(1000); /* 1 sec delay */ } -200-
} COMI_UnloadDevice(hDevice); A/D CH0 #include <windowsh> #include <stdioh> #include <conioh> #include "Comidash" #define CHAN 0 #define VMIN -10 #define VMAX 10 void main (void) { HANDLE hdevice; float ad_volt; if(!comi_loaddll()){ printf("comidasdll load failure"); exit(0); } hdevice = COMI_LoadDevice (COMI_CP101, 0); if(hdevice == INVALID_HANDLE_VALUE){ printf("can't load specified device!"); COMI_UnloadDll(); exit(0); } COMI_AD_SetRange (hdevice, CHAN, VMIN, VMAX); while (!_kbhit()){ ad_volt = COMI_AD_GetVolt (hdevice, CHAN); printf("%62f\n", ad_volt); // Sleep(500); // 05 delay } } COMI_UnloadDevice(hDevice); COMI_UnloadDll(); -201-
-202-
COMI-EDKIT1-203-
- - - - -, - 10~30 VDC 200mA ( ) - IP67 (IEC ) - 2 ( ) - 2 ( ) -204-
- 3 ( ) -205-
/ ( PS17-5DNU) 5mm ± 10% 50M 10% 1000 VAC 1 18*18*1mm 10~55Hz 2 0~35mm 200m/S 3 12~24VDC ( LED) 10~30VDC 10mA 500Hz 15-25~70 C -30~80 C 35~95%RH, -25~70 10% IP67 200mA 71g -206-
* W -207-
-208-
-209-
BY500-TDT 500mm BYS500-TDT Ø 5mm 1ms 12~24VDC ± 10% ( P-P : 10% ) 30mA ( ) Dark ON NPN : 30VDC, : 100mA, : 1V, : LED 20MΩ (500VDC ) ± 240V 1000VAC 50/60 Hz 1 10~55Hz( 1 ) 2 500m/s 2 (50G) 3 : 11000 lx, : 3000 lx -10 ~ 60, : -25 ~ 70 35 ~ 85 RH, : 35 ~ 85 RH IP 50 (IEC ) : ABS, : 150g, / -210-
-211-
-212-
1 (, ), 2 3 2 4 5, 6 7 DC 8 9, 10 Switching Power Supply Frame Grount (FG) 0V FG -213-
ABSOLUTE MAXIMUM RATINGS at TA = +25 C Load Supply Voltage, VBB 46 V FET Output Voltage, VDS 100 V Control Supply Voltage, VCC 46 V Peak Output Current, IOUTM (tw 100 µs) SLA7024M 30 A SLA7026M 50 A SMA7029M 30 A Continuous Output Current, IOUT SLA7024M 15 A SLA7026M 30 A SMA7029M 15 A Input Voltage Range, VIN -03 V to 70 V Reference Voltage, VREF 20 V Package Power Dissipation, PD See Graph Junction Temperature, TJ +150 C Operating Temperature Range, TA -20 C to +85 C Storage Temperature Range, BENEFITS AND FEATURES Cost-Effective, Multi-Chip Solution Turn-Key Motion-Control Module Motor Operation to 3 A and 46 V 3rd Generation High-Voltage FETs 100 V, Avalanche-Rated NMOS Low rds(on) NMOS Outputs Advanced, Improved Body Diodes Single-Supply Motor/Module Operation Half- or Full-Step Unipolar Drive High-Efficiency, High-Speed PWM Dual PWM Current Control (2-Phase) Programmable PWM Current Control Low Component Count PWM Drive Low Internal Power Dissipation Heat Sinking (Normally) Unnecessary Electrically Isolated Power Tab Logic IC- and µp-compatible Inputs Machine-Insertable Package Tstg -40 C to +150 C The SLA7024M, SLA7026M, and SMA7029M are designed for high-efficiency and highperformance operation of 2-phase, unipolar stepper motors An automated, innovative packaging technology combined with power FETs and monolithic logic/control circuitry advances power multi-chip modules (PMCMs ) toward the complete integration of motion control Highly automated manufacturing techniques provide low-cost and -214-
exceptionally reliable PMCMs suitable for controlling and directly driving a broad range of 2-phase, unipolar stepper motors The three stepper motor multi-chip modules differ primarily in output current ratings (15 A or 30 A) and package style All three PMCMs are rated for an absolute maximum limit of 46 V and utilize advanced NMOS FETs for the high-current, high-voltage driver outputs The avalanche-rated ( 100 V) FETs provide excellent ON resistance, improved body diodes, and very-fast switching The multi-chip ratings and performance afford significant benefits and advantages for stepper drives when compared to the higher dissipation and slower switching speeds associated with bipolar transistors Normally, heat sinks are not required for the SLA7024M or SMA7029M The SLA7026M, in demanding, higher-current systems designs, necessitates suitable heat transfer methods for reliable operation Complete applications information is given on the following pages -215-
FUNCTIONAL BLOCK DIAGRAM -216-
- Ø40mm INCREMENTAL - - - 5~24VDC 5% - -217-
/ A, B, Z A, B : T/4 T/8 Totem Ploe Low: 30mA 04V High: 10mA ( -15) V NPN / :30mA, :04V Line Driver Low: 20mA, 05V High: -20mA, 25V Totem Pole 05s ( 1m, I sink=10ma ) NPN / 05s ( 1m, I sink=30ma ) ( / ) Line Driver 01s ( 1m, I sink=20ma ) 180Hz 5~24VDC, Line Driver :5VDC, :5VDC, 12VDC, 24VDC ( P-P:5% ) 80mA ), Line Driver 100mA ( ) 40gfcm(3,920 40gcm 2 (4*10-6 kgm 2 ) Radial : 2kgf, Thrust : 1 kgf Radial : 01kgf, Thrust : 02 kgf 5000rpm 100M 750VAC 50/60Hz 1 ( ) 10~55Hz( 1 ) 2 50G -10~70 C <Line Driver 0~70 C > 35~85%RH, 35~90%RH IP50(IEC ) 5P, 120g CE -218-
- NPN - (CW) : Shaft -219-
- - (FG) -220-
-221-