Note: If you have purchased the USB version of the hardware or if you have purchased the RS232 version but additionally bought a USB-to-RS232 converter, then first install the converter software according to the manufacturer's instructions from the disk included in the converter package or download the software. After the installation, in the Device Manager find what port number (e.g. COM1, COM12, etc.) was assigned to the new COM port by Windows and use this number as explained below.
The device adapter, which implements software interface to the Filter Cube Slider as well as to other TOFRA devices, is included in the Micro-Manager installation. To create a configuration file you can either use the Micro-Manager GUI, or use one of the two provided configuration files: TofraConfig-TCS.cfg or TofraConfig-TCS-slow.cfg, or add relevant lines to the configuration file that you currently use. Change everywhere COM3 used in these examples to the actual COM port used to communicate with the device. Start by using TofraConfig-TCS-slow.cfg; when Micro-Manager starts and you select this file, the software will home it. Take care not to have obstructions along the lenght of the slider.
TofraConfig-TCS.cfg | TofraConfig-TCS-slow.cfg |
# Reset Property,Core,Initialize,0 Property,Core,TimeoutMs,60000 # Devices Device,COM3,SerialManager,COM3 Device,TCS,Tofra,TOFRA Cube Slider # Pre-init settings for devices Property,COM3,AnswerTimeout,500.0000 Property,COM3,BaudRate,9600 Property,COM3,DelayBetweenCharsMs,0.0000 Property,COM3,Handshaking,Off Property,COM3,Parity,None Property,COM3,StopBits,1 Property,TCS,Port,COM3 Property,TCS,NumPos,6 Property,TCS,ControllerName,6 Property,TCS,SlewVelocity,400000 Property,TCS,InitVelocity,100000 Property,TCS,Acceleration,1000 Property,TCS,HomeSlewVel,50000 Property,TCS,HomeInitVel,5000 Property,TCS,HomeAccel,100 Property,TCS,HoldCurrent,5 Property,TCS,RunCurrent,70 Property,TCS,HomeOffsetUm,3500 Property,TCS,BetweenPosUm,40000 Property,TCS,LeadUm,25400 Property,TCS,MotorSteps,200 Property,TCS,StepDivide,16 # Initialize Property,Core,Initialize,1 # Labels # TCS Label,TCS,5,Cube-06 Label,TCS,4,Cube-05 Label,TCS,3,Cube-04 Label,TCS,2,Cube-03 Label,TCS,1,Cube-02 Label,TCS,0,Cube-01 |
# Reset Property,Core,Initialize,0 Property,Core,TimeoutMs,60000 # Devices Device,COM3,SerialManager,COM3 Device,TCS,Tofra,TOFRA Cube Slider # Pre-init settings for devices Property,COM3,AnswerTimeout,500.0000 Property,COM3,BaudRate,9600 Property,COM3,DelayBetweenCharsMs,0.0000 Property,COM3,Handshaking,Off Property,COM3,Parity,None Property,COM3,StopBits,1 Property,TCS,Port,COM3 Property,TCS,NumPos,6 Property,TCS,ControllerName,6 Property,TCS,SlewVelocity,100000 Property,TCS,InitVelocity,0 Property,TCS,Acceleration,500 Property,TCS,HomeSlewVel,10000 Property,TCS,HomeInitVel,0 Property,TCS,HomeAccel,50 Property,TCS,HoldCurrent,5 Property,TCS,RunCurrent,70 Property,TCS,HomeOffsetUm,3500 Property,TCS,BetweenPosUm,40000 Property,TCS,LeadUm,25400 Property,TCS,MotorSteps,200 Property,TCS,StepDivide,16 # Initialize Property,Core,Initialize,1 # Labels # TCS Label,TCS,5,Cube-06 Label,TCS,4,Cube-05 Label,TCS,3,Cube-04 Label,TCS,2,Cube-03 Label,TCS,1,Cube-02 Label,TCS,0,Cube-01 |
To tune the slider parameters for speed, use the two provided beanshell script files: Slider Parameters.bsh and Slider Speed Test.bsh. Open the Script panel in the Micro-Manager GUI, read each file and add them to the left pane for easy switching. Then select the Slider Parameters.bsh, edit parameter you wish to change, save, and run it to load parameters into the slider controller. Then select Slider Speed Test.bsh and run it. Note the switching time. Repeat until the best possible result is achieved. The parameters to tune are in bold below.
Slider Parameters.bsh | Slider Speed Test.bsh |
slider = "TCS"; // Motor-related parameters become in effect (loaded) only after initialization (homing) // Use this script together with Speed Test to optimize parameters mmc.setProperty(slider,"SlewVelocity","500000"); mmc.setProperty(slider,"InitVelocity","100000"); mmc.setProperty(slider,"Acceleration","2500"); mmc.setProperty(slider,"HomeSlewVel","50000"); mmc.setProperty(slider,"HomeInitVel","5000"); mmc.setProperty(slider,"HomeAccel","100"); mmc.setProperty(slider,"HoldCurrent","5"); mmc.setProperty(slider,"RunCurrent","90"); mmc.setProperty(slider,"HomeOffsetUm","3500"); mmc.setProperty(slider,"StepDivide","16"); // Other parameters should not be changed mmc.initializeDevice(slider); mmc.waitForDevice(slider); |
slider = "TCS"; mmc.setTimeoutMs(100000); numPos = mmc.getNumberOfStates(slider); // switch by 1 position mmc.initializeDevice(slider); mmc.waitForDevice(slider); t1 = System.currentTimeMillis(); for (int j=1;j<numPos;j++) { mmc.setState(slider,j); mmc.waitForDevice(slider); } t2 = System.currentTimeMillis(); print(((t2-t1)/(double) (numPos-1)) + " ms per 1-position switch."); // Return mmc.setState(slider,0); mmc.waitForDevice(slider); // variant 2 //for (int j=0;j<numPos;j++) { // s = "" + j; // mmc.setProperty(slider,"State",s); // mmc.waitForDevice(slider); //} |