Hardware Reference
In-Depth Information
' Turn LED indicator green
sample_led.FillColor = "&H0000FF00"
Else
lblStatus.Caption = "Data file not written"
' Turn LED indicator grey
sample_led.FillColor = "&H00E0E0E0"
End If
End Sub
Private Sub Form_Load()
' Declare revision level of Universal Library
ULStat% = cbDeclareRevision(CURRENTREVNUM)
' Initiate error handling
ULStat% = cbErrHandling(PRINTALL, DONTSTOP)
If ULStat% <> 0 Then Stop
' Set channel number and gain
Chan% = 0
' Set default range on start-up
Gain = BIP20VOLTS
' Set default maximum number of samples
max_samples = 100000
Index% = 0
' Disable timer
tmrConvert.Enabled = False
cmbInterval.Text = "10 ms"
' Initial status message
lblStatus.Caption = "Waiting for Start button"
' Sample LED set to off
sample_led.FillColor = "&H00E0E0E0"
' Default filename
file_name = "sample.dat"
End Sub
Private Sub tmrConvert_Timer()
Index% = Index% + 1
If cmbInterval.Text = "10 ms" Then tmrConvert.Interval = 10
If cmbInterval.Text = "100 ms" Then tmrConvert.Interval = 100
If cmbInterval.Text = "1 s" Then tmrConvert.Interval = 1000
If cmbInterval.Text = "10 s" Then tmrConvert.Interval = 10000
If cmbInterval.Text = "100 s" Then tmrConvert.Interval = 100000
' Collect the data
ULStat% = cbAIn(BoardNum%, Chan%, Gain, DataValue%)
If ULStat% = 30 Then MsgBox "Gain setting not valid", 0,
"Unsupported Gain"
If ULStat% <> 0 Then Stop
ULStat% = cbToEngUnits(BoardNum%, Gain, DataValue%, EngUnits!)
If ULStat% <> 0 Then Stop
data_array(Index%) = Format$(EngUnits!, "0.00")
End Sub
Load sequencer
The client uses a manufacturing process based on eight devices that operate
from a nominal 8 A 115 V AC supply. Unfortunately, the momentary surge
current taken by each device (each of which involves a degaussing component)
Search WWH ::




Custom Search