Click to See Complete Forum and Search --> : Sending '1's and '0's...


Lohchj
December 7th, 1999, 12:03 AM
Does anyone know how to send a string of '1's and '0's throught the serial port using VB? Is there any functions in VB which is similar to the outp function in C??? Urgent...Thanks!!!

Ruth Glushkin
December 7th, 1999, 01:21 AM
I don't know which version of VB you use. If it is 5.0 or 6.0 it is very easy:
MSComm1.InputMode = 1

Dim bOutput(0 To 10) As Byte ' Output Binary Array

bOutput(0) = 0
bOutput(1) = 1
MSComm1.Output = bOutput

But if you use VB 4 or less, you'd better use API functions CreateFile(), ReadFile(), WriteFile().

Good Luck!