Thanks Graham,
I fooled around with this all day and finally got it to work acceptably. I don't know if how I did this is the easiest or cleanest way, but it works repeatably.
I still have to add all the logic for looking at the encoder. I also have to add error checking plus determining which way to turn and how many stations.
But it's a start!!

The formating is a little screwed up for some reason, and it keeps jumping around in the text window on the forum. I'm too tired to pretty it up. It should be clear enough to read.
'Inputs are as follows:
'
'
'OEMTRIG1 = Encoder Bit 1
'OEMTRIG2 = Encoder Bit 2
'OEMTRIG3 = Encoder Bit 3
'OEMTRIG4 = Encoder Bit 4
'OEMTRIG5 = Parity Bit
'OEMTRIG6 = Strobe1
'OEMTRIG7 = Strobe2
'OEMTRIG8 = Index Proximity Switch
'OEMTRIG9 = Lock Proximity Switch
'OEMTRIG10 = Door Switch
'
'
'Outputs are as follows:
'
'
'OUTPUT10 = Lock Solenoid
'
'
DoOemButton(138) 'Go home
While IsMoving() 'wait for movement
Wend 'to end
For I = 1 To 18 'Slow jog is needed
DoOemButton(112) 'for extra torque
Next I
DoOemButton(310) 'Rotate Turret CW (axis Y-)
sleep (500) 'Turn for .5 sec
DoOemButton(1003) 'Stop Motor
For I = 1 To 18 'Back to Fast jog
DoOemButton(111)
Next I
DoOemButton(310) 'Rotate Turret CW (axis Y-)
For I = 1 To 5 'Count number of stations
While Strobe1 = 0 'Wait for Strobe1 to go high
If IsActive(OEMTRIG6) Then
Strobe1 = 1
Else
Strobe1 = 0
End If
Wend
While IsActive(OEMTRIG6) 'Look for Strobe1 to go low
Wend 'Number of Srobe1 falls =
'Number of stations
Strobe1 = 0
Next I
ActivateSignal(OUTPUT10) 'Energize lock solenoid
LockProx = 0
While LockProx = 0 'Look for Lock Proximity Switch
If IsActive(OEMTRIG9) Then 'to go high
LockProx = 1
Else
LockProx = 0
End If
Wend
DoOemButton(1003) 'stop motor
Sleep(100) 'wait for damping
For I = 1 To 18 'slow jog
DoOemButton(112) 'for increased torque
Next I
DoOemButton(309) 'Reverse Motor
sleep (200) 'Turn for .2 sec
DoOemButton(1003) 'Stop Motor
For I = 1 To 18 'Fast Jog
DoOemButton(111)
Next I
DoOemButton(309) 'Reverse motor
While IndexProx = 0 'Look for IndexProx to go high
If IsActive(OEMTRIG8) Then 'IndexProx must complete
IndexProx = 1 'OFF-ON-OFF
Else
IndexProx = 0
End If
Wend
While IsActive(OEMTRIG8) 'Look for IndexProx to go low
Wend
DoOemButton(1003) 'Stop motor
sleep(200)
DeActivateSignal(OUTPUT10) 'De-Energize Lock Solenoid
'Now in position