Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 260
II. SOFTWARE GUIDES - 10. Driver488/W31
10F. Visual Basic
Personal488 User’s Manual, Rev. 3.0
II-245
The ADC488/16A Acquisition Engine will have one form that sets up some of the parameters of the
instrument and provides a means of collecting and displaying the data. We will also include a means
for posting a server link specification in the clipboard, so Excel can perform a Paste Link operation.
Note:
A similar example is also used within the
QUIKTEST
utility. For more information on this
utility, turn to the next Sub-Chapter “Utility Programs” in this Chapter.
All of the initialization happens in the following
Form_Load
service routine.
Sub Form_Load ()
LinkMode = 1
Chan.AddItem “1"
Chan.AddItem ”2"
Chan.AddItem “3"
Chan.AddItem ”4"
Chan.AddItem “5"
Chan.AddItem ”6"
Chan.AddItem “7"
Chan.AddItem ”8"
Chan.AddItem “9"
Chan.AddItem ”10"
Chan.AddItem “11"
Chan.AddItem ”12"
Chan.AddItem “13"
Chan.AddItem ”14"
Chan.AddItem “15"
Chan.AddItem ”16"
Chan.ListIndex = 0
Range(0).value = -1
text1.text = “”
StartFlag = 0
NL = Chr$(13) + Chr$(10)
End Sub
First the
LinkMode
is set to
SERVER (1)
. Then the combo box is initialized with the channel numbers
available from the ADC488/16A. After some form control initialization, the constant
NL
(new line) is
defined as a string consisting of a carriage return and line feed. This will be used to put a new line
between readings.
Although the ADC488/16A has many programmable
features, for the sake of brevity, this application will only
exercise a few. This application provides controls to
adjust the channel voltage range and the desired channel.
The control where the collected data is returned is a text
box with its
Multiline
and
ScrollBar
properties set
to
TRUE
at design time.
A very small bit of code resides behind the option
buttons. The option buttons are configured as a control
array. The
Click
event is serviced by the same code
which sets the value of the global variable
Rng
to the
index number of the option control.
Sub Range_Click (index As Integer)
Rng = index
End Sub
When the Acquire button is pressed, executing the
Acquire_Click
routine, the pre-configured device
ADC488 is opened and cleared. Then a string of ADC488 commands are sent to the device using the
settings from the combo box and the variable
Rng
. Lastly, the global variable
StartFlag
is set to
1
(start).
ADC488/16A Acquisition Engine Form