Beruflich Dokumente
Kultur Dokumente
Communication Control
Communication Control
fungsi bawaan VB untuk melakukan
komunikasi serial dengan serial device
Properties of MSComm
DTREnable : DTR stands for Data Terminal Ready ( this is a pin ).Set this to true.
Setting this false would stop the data transfer.
EOFEnable : Determines whether MSComm detects EOF ( End of File ).By default it
is false.
Handshaking : This handshaking will be between the DTE ( Data Terminal Equipment,
the Computer ) and the DCE ( Data Communication Equipment . Say,the modem).
Inbuffersize : It won't be out of place to mention that we will have two buffers, an
InputBuffer, for holding the data as it arrives and an OutputBuffer for holding the data
sent for transmission. Inbuffersize specifies the input buffer size for holding the data
as it arrives from the port. Later we shall learn how to read the contents of this buffer
InputLen : The number of characters the input property ( will come to it later ) reads
from the buffer. Setting this to 0 indicates that MSComm would read all characters in
the buffer.
Properties of MSComm
Properties of MSComm
InputMode : This is important ! There are two modes-binary and text. If you intend to
receive binary control characters too, then use binary mode or else use text mode. In
simpler terms, if you intend to receive data from text files only, you should stick to the
text mode and if you intend to receive data from all kinds of files, such as exe's, jpg's
etc, then go for binary mode. Text data can be transferred in binary mode too. The
problem with binary files is that they potentially produce control codes in the ASCII
sequence less than 32 (decimal) and may also produce control codes from 127 to
159.If you wish to transfer binary data in text mode, you will have to use a conversion
algorithm to convert the binary data to text.
ParityReplace: In case of parity error, this is used to replace the character in error.
Properties of MSComm
InputMode: Hal ini penting! Ada dua mode-biner dan teks. Jika Anda berniat
untuk menerima karakter kontrol biner juga, kemudian menggunakan mode
binary atau modus menggunakan teks. Secara sederhana, jika Anda berniat
untuk menerima data dari file teks saja, Anda harus tetap ke modus teks dan
jika Anda berniat untuk menerima data dari semua jenis file, seperti exe's,
jpg's dll, kemudian pergi untuk mode biner. Teks data dapat ditransfer dalam
mode biner juga. Masalah dengan file biner adalah bahwa mereka
berpotensi menghasilkan kode kontrol dalam urutan ASCII kurang dari 32
(desimal) dan juga dapat menghasilkan kode kontrol 127-159. Jika Anda
ingin mentransfer data biner dalam mode teks, Anda akan harus
menggunakan algoritma konversi untuk mengkonversi data biner ke teks.
NullDiscard: Penting. Ini menentukan apakah karakter NULL (Binary 0)
dibuang atau tidak. Dalam modus teks, positif set ini ke true jika tidak, anda
mungkin menghadapi masalah aneh.
OutBufferSize: Menentukan ukuran output buffer.
ParityReplace: Dalam kasus kesalahan paritas, ini digunakan untuk
mengganti karakter dalam kesalahan.
Properties of MSComm
RTSEnable : Important. RTS stands for Request To Send. Set this to True.
Setting : Use this to set the baud rate, parity, data bits and stop bits. This
has the following format : "B,P,D,S" where B is the baud rate, by default
9600bp
P is the parity bit, N for none
D is the number of data bits, default 8
S is the stop bit, default 1.
Properties of MSComm
Handshaking
Memastikan data tidak hilang akibat buffer
overrun (jika tiba terlalu cepat)
Properti :
comNone no handshaking
comXonXoff handshaking via software
comRTS handshaking via hardware
comRTSXOnXoff menggunakan keduanya
bit per detik (bps disingkat atau bit / detik) adalah ukuran umum kecepatan data
untuk komputer modem dan transmisi operator (adalah standar umum untuk
kecepatan transmisi data). Sebagai istilah menyiratkan, kecepatan dalam bps adalah
sama dengan jumlah bit yang ditransmisikan atau diterima setiap detik.
bit data adalah Jumlah bit yang digunakan untuk mewakili satu karakter data. Ketika
transmisi teks ASCII melalui modem, baik tujuh atau delapan bit dapat digunakan.
bentuk lain Sebagian besar data membutuhkan delapan bit.
flow control adalah proses mengelola tingkat transmisi data antara dua node untuk
mencegah pengirim yang cepat dari kehabisan receiver lambat. Ini menyediakan
sebuah mekanisme untuk penerima untuk mengontrol kecepatan transmisi, sehingga
node penerima tidak kewalahan dengan data dari transmisi node.
bit paritas adalah bit yang ditambahkan untuk memastikan bahwa jumlah bit dengan
nilai satu dalam satu set bit genap atau ganjil. (bit paritas adalah sedikit yang
ditambahkan untuk memastikan bahwa jumlah bit dengan satu nilai di set bit genap
atau ganjil)