beautypg.com

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

Page 36

background image

Getting Started

for I-7000 Series Modules

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

Figure 4-1-5. The “

7000 OCX

” and "CommandButton" on Form1.

Add these codes in the sub routine “

Command1_Click()

Private Sub Command1_Click()
NAP7000X1.ComPort = COM2

'Use COM2

NAP7000X1.Address = 1

'module address: 1

NAP7000X1.BaudRate = 9600

'setting the baudrate

NAP7000X1.CheckSum = False

'checksum disable

NAP7000X1.PortOpen = True

'Open the ComPort

NAP7000X1.ModuleType = I_7013

'Module ID

Command1.Caption = NAP7000X1.AI

'Get Analog input value

NAP7000X1.PortOpen = False

'Close the ComPort

End Sub

Run the program and click on the “

Command1

” button. The caption of the

Command1

” button shows the analog input value. Refer to Figure 4-1-6.

Figure 4-1-6. Shows the analog input value from the module.

The

NAP7000X

software package provides a user’s manual in HTML

format. For detailed descriptions of each property, method and event, please
refer to the NAP7000X user’s manual. It also contains demo programs for
Visual Basic, Visual C++, Delphi and BCB with complete source code.