Visual Basic test program for the BSI

The following is a simple program to test the BSI using Visual Basic:

Any number between 0 and 255 in text box 1 will be transmitted to the BSI when the Command1 button is clicked. To send data from the BSI to the computer click on Command2 and then toggle "data strobe" on the BSI. Please refer to the BSI application notes for a full discussion of the operation of the BSI

----------------------------------------------------------------------------------
Drop two Command buttons and two Text boxes on a form plus either the MSComm or PDQComm tool

__________________________________________________________
Private Sub Command1_Click()
'test output from computer to BSI. must be a number from 0 to 255
' note, if using mscomm then substitute MSComm for PDQComm
PortOn
PDQComm1.Output = Chr$(Text1.Text)
PDQComm1.PortOpen = False
End Sub

__________________________________________________________
Public Static Sub PortOn()
' subroutine to open port. note coded for comm2 at 1200 baud.
' note, if using mscomm then substitute MSComm for PDQComm
PDQComm1.CommPort = 2
PDQComm1.Settings = "1200,n,8,1"
PDQComm1.InputLen = 0
PDQComm1.PortOpen = True
End Sub

__________________________________________________________
Private Sub Command2_Click()
'Test input from BSI to computer. click on data in
and then toggle datta strobe on BSI
' note, if using mscomm then substitute MSComm for PDQComm
PortOn
Do While PDQComm1.InBufferCount < 1
Loop
sresponse =Asc(PDQComm1.Input)
Text2.Text = sresponse
PDQComm1.PortOpen = False
End Sub

the EXE file for the above program
the vb40032 file

 


return to home page

Jerry Baumeister
E-Mail to:
jerry_baumeister@msn.com

Copyright ©1998, Jerry Baumeister
Revised - 1-9-98