beautypg.com

ETS-Lindgren 2090 Controller User Manual

Page 91

background image

Model 2090 Multi-Device Controller


Read$ = Space$(50)
'
' Initialize the tower
'
ibdev 0, 8, 0, T10s, 1, &HC0A, Tower% ' Initialize GPIB interface
'
' Make sure this controller supports full error event handling
'
ibwrt Tower%, "*IDN?" ' Query the identification string
ibrd Tower%, Read$ ' Read response

If (InStr(Read$, 2190) = 0) Then ' Not a 2190 (all 2190's support full
' error event handling)
If (InStr(Read$, 2090) = 0) Then ' Not a 2090!
MsgBox "The device is not a 2090 controller!", 0, "Error"
ibonl Tower%, 0 ' Free tower's GPIB port
Exit Sub
Else
Read$ = Mid$(Read$, InStr(Read$, "REV") + 3, 5) ' Get version number
If (Val(Read$) < 2.3) Then
Msg$ = "This 2090 has firmware version " + Str$(Val(Read$)) + "." + Chr$(13)
Msg$ = Msg$ + "Full error event handling was implemented in version 2.3." + Chr$(13)
Msg$ = Msg$ + "Contact the EMCO sales department for a firmware upgrade."
MsgBox Msg$, 0, "Invalid Firmware Version"
ibonl Tower%, 0 ' Free tower's GPIB port
Exit Sub
End If
End If
End If

'
' Set up event handling registers.
'
ibwrt Tower%, "*CLS" ' Clear any previous conditions
ibwrt Tower%, "*SRE 33" ' Allow ESB and DDE to generate SRQ
ibwrt Tower%, "*ESE 52" ' Command, Execution, & Query errors
ibwrt Tower%, "ERE 511" ' All defined Device Dependent errors

'
' Set 2090 numeric mode and Upper and Lower limits for tower
'

ibwrite Tower%, "N2;LL 100;UL 400" ' Set limits to 100 cm & 400 cm

'
' Note the use of commands "ibwrite" and "ibread" instead of "ibwrt" and "ibrd"
' If an error is generated by the controller, these routines will detect it and
' display an error message for the user.
'

SeekPosition 150, Tower%, TowerEdit ' Move to 150.0 cm

'
' Note the use of subroutines to perform certain tasks
'

'
' Generate a Polarization Violation Error
'
TowerEdit.Text = "Polarizing" ' Inform user of tower status
ibwrite Tower%, "PH" ' Polarize horizontal

©ETS-Lindgren, April 2006

91

Revision G– P#399199