Exemplo n.º 1
0
#
# Examples
# OS_moveSpeed     #prints axes speeds to screen
# OS_moveAccel 500 500 1000 #set speeds in X, Y, and Z
#
#
# Rob Campbell - CSHL, December 2013



import sys
from OpenStageSerial import ser, readAndPrintBuffer, readBuffer

import re

ser.flushInput() #flush the buffer, to be safe


#First read from controller. This is done regardles of what the
#user asked for in order to get the number of axes.
ser.write('vr')
buf=readBuffer()
numAxes=len([m.start() for m in re.finditer(',', buf)]) + 1


#Either report parameters to the screen or change them
if len(sys.argv)<2:
  print(buf)
  sys.exit(0)

Exemplo n.º 2
0
# Three numbers defining the accelerations each axis in steps per s per s.
# Axes ordered X,Y,Z and all must be provided.
#
# Examples
# OS_moveAccel     #prints axes accelerations to screen
# OS_moveAccel 500 500 1000 #set accelerations in X, Y, and Z
#
#
# Rob Campbell - CSHL, December 2013

import sys
from OpenStageSerial import ser, readAndPrintBuffer, readBuffer

import re

ser.flushInput()  #flush the buffer, to be safe

#First read from controller. This is done regardles of what the
#user asked for in order to get the number of axes.
ser.write('ar')
buf = readBuffer()
numAxes = len([m.start() for m in re.finditer(',', buf)]) + 1

#Either report parameters to the screen or change them
if len(sys.argv) < 2:
    print(buf)
    sys.exit(0)

if len(sys.argv) < numAxes + 1:
    sys.stderr.write("Must provide all axes\n")
    sys.exit(0)
Exemplo n.º 3
0
# Obtain current location from OpenStage
# 
# Purpose
# Obtain stage location on each axis and display on screen
#
# Rob Campbell - CSHL, December 2013

from OpenStageSerial import ser, readAndPrintBuffer


ser.flushInput() #flush input buffer 

ser.write('p') #Issue command 
readAndPrintBuffer()
ser.close()

Exemplo n.º 4
0
# Obtain current location from OpenStage
#
# Purpose
# Obtain stage location on each axis and display on screen
#
# Rob Campbell - CSHL, December 2013

from OpenStageSerial import ser, readAndPrintBuffer

ser.flushInput()  #flush input buffer

ser.write('p')  #Issue command
readAndPrintBuffer()
ser.close()