beautypg.com

B&B Electronics I-7060 - Quick Start Guide User Manual

Page 30

background image

Getting Started

for I-7000 Series Modules

Date: Jan-08, 2002 Version 1.02 page: 30

Figure 3-1-8. Declaration files have been added into this project.

Put a “

CommandButton

” control on “

Form1

” of this program. Add the

following codes in the sub routine “

Command1_Click()

“ :

Private Sub Command1_Click()

Dim wt As Integer

Port = 2

Open_Com Port, 9600, 8, 0, 0

SendTo7000 = "$01M"

ReceiveFrom7000 = Space(100)

Send_Receive_Cmd Port, SendTo7000, ReceiveFrom7000, 100, 0, wt

Command1.Caption = ReceiveFrom7000

Close_Com Port

End Sub

Run the program and click on the “

Command1

” button. The caption of the

Command1

” button will be changed to “!01xxxx”. The “!” is “OK”. The “01”

means “address at 0x01”. The “xxxx” is the module-ID. Refer to Figure 3-1-
9.

Figure 3-1-9. The module returns “!01xxxx”.