This is a simple python driver for the B&K Turntable System Type 9640 using the PyVISA module, itself a wrapper around the NI-VISA library (available for windows, linux, and mac).
As of now, only absolute positioning has been implemented.
First, the NI-VISA library should be download and installed. Instructions are available in the PyVISA documentation.
Second, the PyVISA library can be installed from pip
directly.
pip install -U pyvisa
This is a simple example of setting the turntable in some absolute direction.
First, the instrument name can be printed using the convenience function turntable.list_instruments()
.
> import turntable
> print(turntable.list_instruments())
('ASRL1::INSTR','ASRL2::INSTR','ASRL3::INSTR')
Knowing the name, the turntable is controlled in the following way (assuming the third instrument is the one we need). Here the table is turned the direction at 37 degrees.
> import turntable
> table = turntable.TurnTable('ASRL3::INSTR')
> table.turn_abs(37)
The zero location of the table can be set to the current location by typing
> table.set_zero()
Copyright 2017 Robin Scheibler
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <[email protected]> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Robin Scheibler
* ----------------------------------------------------------------------------
*/