Using the GPIB Command Set with the Model 2090
Model 2090 Multi-Device Controller
ibwrt Table%, "CP?" ' Query turntable current position
ibrd Table%, Read$ '
TableEdit.Text = Val(Read$) '
StartTime = Timer ' Read current timer count
While (Timer < Sta 0.1) ' Delay 0.1 second
DoEvents ' Let Windows do other things
Wend
If (Not TowerDone) Then
ibwrt Tower%, "*OPC?" ' Is the tower done moving?
ibrd Tower%, Read$ ' Read response
TowerDone = Val(Read$) ' =1 if done, 0 if moving
End If
If (Not TableDone) Then
ibwrt Table%, "*OPC?" ' Is the turntable done moving?
ibrd Table%, Read$ ' Read response
TableDone = Val(Read$) ' =1 if done, 0 if moving
End If
DoEvents ' Let Windows do other things
Loop While Not (TowerDone And TableDone) ' Until both devices stop
ibwrt Tower%, "UV " + Str$(UpperVertLim) ' Set upper vertical limit
Angle = 0
While (Angle < 360)
'
' Polarize the tower horizontally, after insuring that it is above
' the lower limit. (There is a one cm tolerance for polarization
' violation, so we must be sure we're within that value or we'll
' cause an error when we try to polarize.)
'
ibwrt Tower%, "CP?" ' Query tower current position
ibrd Tower%, Read$ ' Read response
LastPosition = Val(Read$) ' Save this position
While LastPosition < 99
ibwrt Tower%, "SK 100" ' Send the tower up to the lower limit
Do ' Update display while waiting
ibwrt Tower%, "CP?" ' Query tower current position
ibrd Tower%, Read$ ' Read response
TowerEdit.Text = Val(Read$) ' Display number in edit box
StartTime = Timer ' Read current timer count
While (Timer < Sta 0.1) ' Delay 0.1 second
DoEvents ' Let Windows do other things
Wend
ibwrt Tower%, "*OPC?" ' Is the tower done moving?
ibrd Tower%, Read$ ' Read response
TowerDone = Val(Read$) ' =1 if done, 0 if moving
Loop While Not TowerDone ' Until tower stops
ibwrt Tower%, "CP?" ' Query tower current position
ibrd Tower%, Read$ ' Read response
LastPosition = Val(Read$) ' Save this value
TowerEdit.Text = LastPosition ' Display number in edit box
Wend
'
' Change polarization to horizontal
'
TowerEdit.Text = "Polarizing" ' Inform user of tower status
ibwrt Tower%, "PH" ' Polarize Horizontal
78
© ETS-Lindgren– April, 2006
Revision G– P# 399199
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com