beautypg.com

ETS-Lindgren 2090 Controller User Manual

Page 95

background image

Model 2090 Multi-Device Controller

End If
If (DDE And 256) Then 'Flotation Violation
Msg$ = "The controller reported that an attempt was made" + Chr$(13)
Msg$ = Msg$ + "to disengage flotation while the air flotation turntable" + Chr$(13)
Msg$ = Msg$ + "was moving. The turntable completes the previous operation" + Chr$(13)
Msg$ = Msg$ + "but will not accept new commands until the error is cleared." + Chr$(13)
MsgBox Msg$, 0, "Flotation Violation"
End If


Msg$ = "Checking the error conditions automatically clears them." + Chr$(13)
Msg$ = Msg$ + "With the exception of Polarization Limit Violation and" + Chr$(13)
Msg$ = Msg$ + "Flotation Violation errors, which can be handled by a" + Chr$(13)
Msg$ = Msg$ + "'smart' program, the program should prompt the user to" + Chr$(13)
Msg$ = Msg$ + "correct the error condition before proceeding. In the" + Chr$(13)
Msg$ = Msg$ + "case of a Communication Lost error, the error message" + Chr$(13)
Msg$ = Msg$ + "will continue to be generated as long as the condition" + Chr$(13)
Msg$ = Msg$ + "exists and position related commands are being issued" + Chr$(13)
Msg$ = Msg$ + "to the controller" + Chr$(13)
MsgBox Msg$, 0, "Note on Status Reporting"
End If
End Sub




'
' This function will use the *OPC? command to determine that the given
' device has completed its motion. It will also update the given
' display during this period.
'
Sub WaitForStop(device%, DeviceEdit)

Dim Done As Boolean, LastPosition As Single, CurrentPosition As Single
Dim StartTime As Single
Dim Read$

Read$ = Space$(20) ' Create a buffer for reads

'
' Wait for operation complete
'

Do ' Update display while waiting
DeviceEdit.Text = GetCurrentPosition(device%) ' Display current posn
StartTime = Timer ' Read current timer count
While (Timer < StartTime + 0.1) ' Delay 0.1 second
DoEvents ' Let Windows do other things
Wend
ibwrite device%, "*OPC?" ' Is the device done moving?
ibread device%, Read$ ' Read response
Done = Val(Read$) ' =1 if done, 0 if moving
Loop While Not Done ' Until device stops

DeviceEdit.Text = GetCurrentPosition(device%) ' Display current posn

End Sub


©ETS-Lindgren, April 2006

95

Revision G– P#399199