PC-Link. 1x Komputer / Laptop dengan OS Windows 2000, Windows XP atau yang lebih tinggi. Gambar 1 Blok Diagram AN200

dokumen-dokumen yang mirip
PC-Link. PC-Link. Application Note AN202

PC-Link. Gambar 1 Blok Diagram AN201. AGND (J3 pin 1) Pin 1 VCC (J3 pin 2) Pin 3 Dapat dipilih salah satu dari A0 s.d. A7 (J3 pin 3 s.d.

DT-Sense Application Note

DT-Sense Current Sensor With OpAmp Gambar 1 Blok Diagram AN212

SPC Application Note. SPC Blue-Link (J2) Tabel 1 Hubungan SPC Blue-Link Dengan Komputer

DT-AVR. Application Note AN214

PC-Link Application Note

DT-PROTO Application Note AN219 Kontrol Lampu Secara Nirkabel berbasiskan Smarphone Android dan

DT-I/O DT-I/O. Application Note AN171

DT-I/O. Application Note AN211. Komunikasi data saat ini terus dikembangkan dan diimplementasikan di dalam setiap bidang, seperti proses

PC-Link Application Note

DHT11 Temperature and Humidity Sensor Board Gambar 1 Blok Diagram AN196. 5V (Power) GND (Power)

DT-I/O. I/O Application Notes AN164 Komunikasi Jarak Jauh antara 2 PC dengan RS-485. Application Note AN164

DT-BASIC Application Note

DT-AVR Application Note AN191 SMS Gateway dengan GSM STARTER KIT

DT-BASIC Application Note

SPC SPC. SPC Application Note AN175 Bluetooth Mobile Robot. Application Note AN175

DT-AVR Application Note

DT-I/O. DT-I/O Application Note

DT-AVR. Application Note AN213

EMS Application Note. 1x Kabel USB 1x Komputer (Memiliki wireless adapter, serta wireless network melalui router atau program Connectify)

Gambar 1 Blok Diagram AN190. P1.0 (J3 pin 3) IN1 (J1 pin3) Tabel 1 Hubungan antar PC-Link Serial PPI dan DT-I/O Quad Relay Board12V

DT-ARM Application Note. AN221 Web Server I/O Remote

DT-AVR Application Note

DT-AVR Application Note

1 Pendahuluan Spesifikasi Sistem yang Dianjurkan... 3

DT-IO Application Note

WIZnet. Application Note AN178 Wireless IP Printer 1 Oleh : Tim IE

SPC Application Note. SPC IR Transceiver. Gambar 1 Blok Diagram AN159. RX (PORTD.0 J13 pin3 / J4 pin2)

PC-Link Application Note

WIZnet. Application Note AN179 Wireless IP Printer 2 Oleh : Tim IE

DT-AVR DT-AVR ApplicationNote

DT-AVR Application Note

DT-AVR Application Note

DT-AVR Application Note. Gambar 1 Blok Diagram AN133

Gambar 1 Blok Diagram AN190. P1.0 (J3 pin 3) IN1 (J1 pin3) Tabel 1 Hubungan antar PC-Link Serial PPI dan DT-I/O Quad Relay Board12V

PC-Link Application Note

DT-SENSE Application Note

DT-AVR DT-AVR Application Note

DT-AVR DT-AVR. Application Note AN203

Starter Kit Application Note AN165 - Update Tampilan Character LCD Berbasis USB Flash Disk

AVR Application Note AN187 Monitoring Suhu Nirkabel (Bahasa C)

DT-AVR Application Note

PC-Link Application Note

DT-AVR Application Note

BAB III PERANCANGAN SISTEM. 3.1 Pengantar Perancangan Sistem Pengendalian Lampu Pada Lapangan Bulu

Gambar 1 Diagram Blok AN215. DT-AVR Maxiduino DT-Proto Header Shield DT-I/O Level Converter

AVR Application Note AN95 Wireless Chatting with PC

DT-BASIC Mini System. Gambar 1 Blok Diagram AN132

DT-51 Application Note

Gambar 1 Blok Diagram AN217. DT-AVR Maxiduino DT-Proto Header Shield DT-I/O Level Converter

DT-I/O DT-I/O. Application Note. Application Note AN193

DT-AVR Low Cost Nano System. Gambar 1 Blok Diagram Remote TV Berbasis ATtiny2313. DT-I/O I/O Logic Tester

DT-AVR Application Note Monitoring Suhu Nirkabel (Bahasa BASIC)

DT-AVR. AVR Application Note AN160 Graphic LCD Dengan Bahasa C. Application Note AN160

DT Series Application Note

BAB III PERANCANGAN SISTEMKENDALI PADA EXHAUST FAN MENGGUNAKAN SMS GATEWAY

BAB III DESKRIPSI DAN PERANCANGAN SISTEM

STARTER KIT Application Note AN157 Browsing Internet Via GSM STARTER KIT

DT-AVR. DT-AVR Application Note AN207 Library USB Controller untuk Komunikasi Serial pada DT-AVR Inoduino

How2Use DT-51 AT89C51XXX BMS. Oleh: Tim IE. Gambar 1 Tata Letak DT-51 AT89C51XXX BMS

DT-SENSE Color Sensor Q uick S tart

BAB III PERENCANAAN DAN PEMBUATAN ALAT

SPC Application Note

SPC SPC. SPC Application Note AN181 - SPC for Hexapod Robot

DT-AVR Application Note

DT-AVR Application Note. AN186 Digital Compass

Trademarks & Copyright

DT-51 Application Note

asic Application Note AN97 BASIC Chatting

DT-SENSE Application Note AN168 Color Game. Gambar 1 Blok Diagram AN168

DT-BASIC Application Note

STARTER KIT Application Note AN162 Web Scrapping Dengan GSM STARTER KIT

BAB III PERANCANGAN ALAT

DT-AVR. DT-AVR Application Note AN208 Library USB Controller untuk Komunikasi Paralel pada DT-AVR Inoduino

DT-AVR Low Cost Micro System. Gambar 1 Blok Diagram AN154. RXD (J13 Pin 3) TXD (J8 Pin 4) GND (J10/J11/J12/J13 Pin 1) GND (J7/J8 Pin 1)

DT-SENSE Application Note

DT-AVR. Gambar 1 Blok Diagram AN177

DT-SENSE Application Note

BAB III PERANCANGAN SISTEM

DT-AVR Application Note

DT-AVR. DT-AVR Application Note AN209 Library USB Controller with SPI Communication based DT-AVR Inoduino

DT-SENSE. IR Proximity Detector

BAB III PERANCANGAN ALAT

AVR USB ISP Trademarks & Copyright

BAB 3 PERANCANGAN SISTEM

BAB III PERENCANAAN DAN PEMBUATAN ALAT

BAB III ANALISIS DAN PERANCANGAN

DAFTAR ISI HALAMAN PENGESAHAN... ABSTRAKSI... KATA PENGANTAR... DAFTAR ISI... DAFTAR TABEL... DAFTAR GAMBAR... DAFTAR LAMPIRAN...

DT-SENSE. UltraSonic Ranger (USR)

de KITS Application Note AN51 How 2 Use de KITS SPC Character LCD w/ PC

Crane Hoist (Tampak Atas)

BAB IV PERANCANGAN. Gambar 4. 1 Blok Diagram Alarm Rumah.

DT-SENSE. Color Sensor

DT-AVR Application Note

DT-AVR Application Note

DT-51 Application Note

DT-AVR Application Note

Gambar 3.1 Diagram Blok Alat

DGSM300 DELTA GSM MODEM INTERFACE

Transkripsi:

PC-Link PC-Link Application Note AN200 GUI Digital Input dan Output Oleh: Tim IE Aplikasi ini akan membahas software GUI (Grapic User Interface) yang digunakan untuk mengatur Digital Input dan Output pada. merupakan sebuah modul kontroler pintar yang dapat dihubungkan dan dikendalikan melalui port USB pada komputer. Modul ini akan dikenali sebagai COM Port virtual. Contoh aplikasi modul ini adalah sebagai pengendali relay atau LED, membaca sinyal analog dari sensor, sebagai pembaca kondisi saklar, penghitung pulsa counter, komunikasi dengan modul-modul yang memiliki antarmuka serial (GSM Serial Modem, GPS Receiver, Sensor, dll.) dan I2C (Sensor, RTC, EEPROM, dll.). Pada artikel AN200 ini digunakan DT-I/O Logic Tester sebagai indikator Output dan Input digital yang dimiliki oleh. Jika dikembangkan lagi, Digital I/O dapat digunakan sebagai pengendali relay, input sinyal digital, sinyal kontrol digital dan lain-lain. Berikut adalah perlengkapan yang diperlukan dalam aplikasi ini : 1x 1x Kabel USB mini to USB Type A 1x Adaptor +12V DC 1x DT-I/O Logic Tester 1x Komputer / Laptop dengan OS Windows 2000, Windows XP atau yang lebih tinggi Adapun blok diagram dari aplikasi ini adalah sebagai berikut : USB Komputer Sumber gambar : en.wikipedia.org/wiki/personal_computer Gambar 1 Blok Diagram AN200 DT-I/O Logic Tester Komunikasi antara dengan Komputer berjalan dengan menggunakan Command Set atau protokol perintah yang telah disertakan secara detail pada manual produk. Ilustrasi Command Set PC-Link USB Smart I/O dapat dilihat pada Tabel 1. Tabel 1 Struktur Command Set Start Byte selalu bernilai heksadesimal 0x58 ($58) atau 88 desimal. Byte Count adalah jumlah byte Command dan Parameter (tidak termasuk Start Byte, Byte Count, dan LRC). Page 1 of 5

LRC (Longitudinal Redundacy Check) adalah Byte yang berfungsi sebagai error-checking byte. LRC diperoleh dari penjumlahan semua Byte, mulai dari Start Byte hingga parameter terakhir. Hasil penjumlahan tersebut hanya diambil LSB saja lalu dilakukan two's complement. Beberapa Command Set yang digunakan pada aplikasi Digital I/O ini antara lain. SET FUNCTION Berfungsi untuk mengatur fungsi I/O pada modul PC : 0x58 0x05 0x10 0x01 0x00 0xF0 0xF0 0xB2 USB Smart I/O : 0x58 0x01 0xAA 0xFD akan menjadikan Digital I/O bit 4-7 sebagai jalur output dengan nilai 0 dengan resistor pull-up aktif, sedangkan bit 0-3 sebagai jalur input dengan resistor pull-up internal tidak aktif. SET BIT Berfungsi untuk memerintahkan modul mengubah nilai 1 pin pada port tertentu. PC : 0x58 0x04 0x13 0x01 0x05 0x01 0x8A USB Smart I/O : 0x58 0x01 0xAA 0xFD akan mengirimkan nilai 1 atau high ke Digital I/O bit 5 GET BIT Berfungsi untuk memerintahkan modul membaca nilai 1 pin pada port tertentu. PC : 0x58 0x03 0x14 0x01 0x02 0x8F USB Smart I/O : 0x58 0x02 0x14 0x00 0x92 berarti komputer meminta nilai bit 2 pada Digital I/O dan modul menjawab bahwa logika pada bit tersebut adalah low. Hubungan antar modul adalah sebagai berikut : (DIGITAL I/O) DT-I/O Logic Tester PGND (J4pin 1) Ground (Pin 1) VCC (J4pin 2) VCC (Pin 2) DIO0 (J4pin 3) Input Switch Bit 0 (Pin 3) DIO1 (J4pin 4) Input Switch Bit 1 (Pin 4) DIO2 (J4pin 5) Input Switch Bit 2 (Pin 5) DIO3 (J4pin 6) Input Switch Bit 3 (Pin 6) DIO4 (J4pin 7) Output LED Bit 4 (Pin 7) DIO5 (J4pin 8) Output LED Bit 5 (Pin 8) DIO6 (J4pin 9) Output LED Bit 6 (Pin 9) DIO7 (J4pin 10) Output LED Bit 7 (Pin 10) Tabel 2 Hubungan dengan DT-I/O Logic Tester Setelah menghubungkan DT-IO Logic Tester dengan, lakukan pengecekan kembali menggunakan multimeter untuk memastikan koneksi antar modul telah terhubung dengan benar. Pastikan juga bahwa tidak terjadi hubungan singkat antara VCC dan GND sebelum memberikan catu daya. Apabila konfigurasi di atas telah selesai, lakukan langkah langkah berikut ini : 1. Berikan catu daya +9V DC s.d. +12V DC pada terminal biru J1 atau DC Jack J2 (perhatikan polaritas catu daya, Jika polaritas terbalik dapat menyebabkan kerusakan modul). 2. Hubungkan kabel USB dengan J7 USB 2.0 konektor ke port USB Komputer. 3. Pastikan driver USB sudah terinstal pada Komputer, jika belum silakan mengikuti panduan pada Manual atau arahkan pada folder produk di dalam DVD Innovative Electronics. Page 2 of 5

SoftwareDigital Input dan Output Program ini dikembangkan menggunakan bantuan Visual Basic 6.0 serta tambahan komponen MSComm dan Timer. Membuka dan menutup port COM Menutup Seluruh Program Bit Digital I/O 0-3 yang di set sebagai Input Bit Digital I/O 4-7 yang di set sebagai Output Gambar 2 Tampilan software Digital Input dan Output Tombol untuk ON/OFF LED Output pada DT-I/O Logic Tester Program ini secara otomatis akan mencari nilai ComPort yang tersedia ketikan dijalankan. Daftar ComPort dapat dilihat pada Combo Box. Pilihan baudrate dapat dilakukan melalui Combo Box Baudrate. Tombol Connect berfungsi untuk membuka atau menutup koneksi antara komputer dengan PC-Link- USB Smart I/O. Tombol ON/OFF pada DIO4 s.d. DIO7 berfungsi untuk mengontrol logika Output bit 4-7. LED bit 4-7 pada DT-I/O Logic Tester akan menyala saat diberikan logika 0 atau low. TextBox dengan label Sent dan Received berfungsi untuk menampilkan Command Set yang dikirimkan dan yang diterima. Tombol Exit digunakan untuk menutup seluruh program. Berikut flowchart dari software program Digital Input dan Output : START Men-disable tombol-tombol Selain connect dan exit Mencari ComPort yang tersedia B Tombol Connect ditekan? A Gambar 3 Diagram alir program Software Digital Input dan Output (bagian ke-1 ) Page 3 of 5

A Ambil data ComPort dan Baudrate ng dipilih Buka ComPort SET FUNCTION Timer aktif Tombol ON ditekan? GET BIT SET BIT Low Baca Data Respon dari Ubah tampilan Indikator Output menjadi merah Parsing data Tombol OFF Apakah data 00? SET BIT High Ubah warna indikator Input menjadi merah Ubah warna indikator Input menjadi merah muda Ubah tampilan Indikator Output menjadi merah muda Tombol Disconnect ditekan? B Gambar 4 Diagram alir program Software Digital Input dan Output (bagian ke-2 ) Page 4 of 5

Penjelasan urutan kerja dari flowchart diatas adalah sebagai berikut : 1. Ketika program ini dijalankan maka akan secara otomatis mencari ComPort yang tersedia pada komputer. Hasil dari pencarian tersebut akan ditampilkan pada ComboBox dengan label COM Port. 2. Sebelum melakukan koneksi dengan menekan tombol Connect, COM Port dan baudrate harus dipilih terlebih dahulu. 3. memiliki fitur Auto Baudrate sehingga pengguna dapat memilih baudrate berapa saja yang akan digunakan tanpa perlu pengaturan terlebih dahulu pada modul. 4. Tombol Connect ditekan, maka program akan membuat koneksi dengan dan kemudian Caption pada tombol ini akan berubah menjadi Disconnect. 5. Pada awal setelah koneksi, program akan mengirimkan perintah SET FUNCTION yang akan membuat Bit 0-3 berlaku sebagai input tanpa pull-up, serta Bit 4-7 sebagai output dengan pull-up internal aktif. 6. Tombol ON pada DIO4 - DIO7 diditekan, maka program akan mengirimkan perintah Set BIT dengan nilai 0 low yang sesuai dengan Bit DIO4-7 yang ditekan sehingga LED pada DT-IO Logic Tester akan menyala. 7. Jika tombol ON telah ditekan, dan indikator DIO Bit tersebut menyala, maka Caption dari tombol akan berubah menjadi OFF. Jika tombol OFF ditekan maka akan mengirimkan Set BIT dengan nilai 1 high sehingga LED pada DT-I/O Logic Tester akan padam. 8. Pembacaan input digital pada Bit 0-3, dilakukan dengan menggunakan Timer sebagai time trigger untuk mengirimkan perintah GET BIT. 9. Respon balasan modul kemudian diparsing untuk mendapatkan nilai status logika Bit yang dibaca. Jika nilai bit tersebut 00 maka indikator Bit Input akan menyala merah. Jika nilai bit tesebut 01 maka indikator Bit Input akan padam. 10. Untuk memutuskan koneksi antara dengan komputer dapat dilakukan dengan menekan tombol Disconnect. 11. Nilai logika Digital I/O akan tetap bertahan saat koneksi COM Port Virtual terputus, sepanjang masih terhubung dengan power supply. Gambar koneksi keseluruhan modul dapat dilihat pada Gambar 5. Gambar 5 Rangkaian antar modul pada AN200 Listing program aplikasi ini terdapat pada AN200.ZIP Selamat berinovasi! All trademarks, company names, product names and trade names are the property of their respective owners. All softwares are copyright by their respective creators and/or software publishers. Page 5 of 5