Skip to main content

AMF Tools is a python package to control Advanced Microfluics SA devices

Project description

AMF TOOLS Python Library

Description

AMF TOOLS Python Library is a python library to control AMF products (RVMFS, RVMLP, SPM and LSPOne) with a serial connection protocol.

Installation

Requirements

  • Python 3.8 or higher
  • pyserial 3.4 or higher
  • ftd2xx 1.1.2 or higher

currently only tested on Windows 11 with Python 3.11 an update will be made for alternative OS

Installation with pip

pip install AMFTools

Installation from source

git clone
cd AMFTools
python setup.py install

License

This Library is proprietary software of Advanced Microfluidics S.A. It is distributed under a proprietary license [1].

This Library is free to use for Advanced Microfluidics SA customers. It is not free to use for non-customers of Advanced Microfluidics SA.

If you have any questions about the license, please contact Advanced Microfluidics SA:

  • Chem. de la Dent d'Oche 1A, 1024 Ecublens (Switzerland)
  • +41 21 552 14 30
  • info@amf.ch

Usage

This verssion of the data sheet is for the version 0.1.1 of the AMFTools library.

Import

import amfTools

Class AMF():

AMF(product : Object, autoconect : bool = True, portnumber : int = None, syringeVolume : int = None, productAddress : int = 1, type : str = None, serialBaudrate : int = None) 

Initialize the AMF object. Either serialPort, serialNumber or a Device type object must be specified as product.

General Methods:

connect(serialBaudrate : int = defaultSerialBaudrate, serialTimeout : float = defaultSerialTimeout) -> bool

Connect to the product. If the connection is successful, return True, otherwise return False.

disconnect() 

Disconnect from the product

send(command : str, integer : bool = False, force_aws : bool = False) 

Send a command to the product. If the command is successful, return the response of the product. If integer is True, the response will be converted to an integer. If force_aws is True, the product will be temporarily set to wait for an answer even if it is set to not wait for an answer.

receive(integer = False, full : bool = False, isfloat : bool = False) -> str

Receive a line of response from the product. If integer is True, the response will be converted to an integer. If full is True, the response will be returned as is, without removing the first and last character. If float is True, the response will be converted to a float.

prepareCommand(command : str, parameter : int = None) -> str

Prepare a command to be sent to the product. If the command needs a parameter, it must be specified. The parameter must be an integer.

pullAndWait(homming_mode : bool = False) 

Wait until the valve and the pump are not busy.

LIST OF SET FUNCTIONS

setAddress(address : int) 

Set the Address of the product. The Address must be between 1 and 9. (1 by default)

setSyringeSize(size : int) 

Set the syringe size of the product. The size must be between 0 and 5000 ( $\mu l$ ).

setAnswerMode(mode : int) 

Set the answer mode of the product. The mode must be between 0 and 2. 0: synchronous, 1: Asynchronous, 2: same as asynchronous but add number of subcommand processed in its last answer

setPortNumber(portnumber : int = portnumber) 

Set the port number of the product's valves.

setSpeedVolume(speed : float, syringeVolume : int = syringeSize) -> int

Set the speed of the product. The speed must be positive. The syringe volume must be between 0 and 5000 ( $\mu l$ ).

setSpeed(speed : int) 

Set the speed of the product. The speed must be between 0 and 6000 (pulse/sec).

setSpeedCode(speed : int) 

Set the speed of the product with a code. The speed must be between 0 and 50.

setAccelerationRate(rate : int) 

Set the acceleration rate of the product. The rate must be between 1 and 59590.

setDecelerationRate(rate : int) 

Set the deceleration rate of the product. The rate must be between 1 and 59590.

setMicrostepResolution(argument : int) 

Set the microstep resolution of the product. ( 0: 0.01mm resolution/step, 1: 0.00125mm resolution/step )

setSlowMode() 

Set the slow mode of the product.

setFastMode() 

Set the fast mode of the product.

setPumpStrengthAndHome(strength : int, block : bool = True) 

Set the pump strength and home the pump. The strength must be between 0 and 3. If block is True, the function will wait until the pump is not busy.

setPlungerForce(force : int) 

Set the plunger force of the product. The force must be between 0 and 3.

setNoAwser() 

Set the product to not wait for an answer. (If the product is set to not wait for an answer, it will not send any answer even if you force it with force_aws parameters)

LIST OF GET FUNCTIONS

getSerialPort(serialNumber : str = serialNumber) -> str

Find the serial port of the product with the specified serial number

getSerialNumber(serialPort = serialPort) -> str

Get the serial number of the product

getType() 

Autoset the type of the product (SPM, RVMFS or RVMLP)

getPortNumber() -> int

Get the number of port of the product's valve

getCurrentStatus() -> str

Get the current status of the product

getValvePosition() -> int

Get the valve position of the product

getRealPlungerPosition() -> int : 

Get the real plunger position of the product

getPlungerPosition() -> int

Get the plunger position of the product

getNumberValveMovements() -> int

Get the number of valve movements of the product

getNumberValveMovementsSinceLastReport() -> int

Get the number of valve movements since last report of the product

getSpeedMode() -> str

Get the speed mode of the product

getFirmwareChecksum() -> str

Get the firmware checksum of the product

getFirmwareVersion() -> str

Get the firmware version of the product

getValveAddress() -> int

Get the valve address of the product

getValveConfiguration() -> int

Get the valve configuration of the product

getMicrostepResolution() -> int

Get the microstep resolution of the product

getPlungerCurrent() -> int

Get the plunger current of the product

getAnswerMode() -> str

Get the answer mode of the product

getAcceleration() -> int

Get the acceleration of the product

getDeceleration() -> int

Get the deceleration of the product

getSupplyVoltage() -> float

Get the supply voltage of the product

getUniqueID() -> str

Get the unique ID of the product

getValveStatus() -> int

Get the valve status of the product

getPumpStatus() -> int

Get the pump status of the product

getHomeStatus() -> bool

Get the homing status of the product (False: not homed, True: homed)

getDeviceInformation() -> object

Get all the information of the product

GLOBAL ACTION FUNCTIONS

checkValveStatus() 

Check the valve status of the product

checkPumpStatus() 

Check the pump status of the product

sendBrute(command : str, blocked : bool = True, force_aws : bool = False) 

Send a command to the product. If blocked is True, the function will wait until the product is not busy. If force_aws is True, the function will ask for an answer even if the product is set to not wait for an answer.

internalReset() 

Reset the product

executeLastCommand() 

Execute the last command of the product

delay(delay : int) 

Delay the product. The delay must be positive.

home(block = True) 

Home the product. If block is True, the function will wait until the product is not busy.

valveShortestPath(target : int, enforced : bool = False, block : bool = True) 

Move the valve to the target port with the shortest path. The target must be between 1 and the number of ports of the product. If enforced is True, the valve will Move to the target port with the shortest path even if it is not the shortest path. If block is True, the function will wait until the product is not busy.

valveIncrementalMove(target : int, enforced : bool = False, block : bool = True) 

Move the valve to the target port with an incremental Move. The target must be between 1 and the number of ports of the product. If enforced is True, the valve will Move even if they are already on the target point (1 complete rotation). If block is True, the function will wait until the product is not busy.

valveClockwiseMove(target : int, enforced : bool = False, block : bool = True) 

Move the valve to the target port with an incremental Move. The target must be between 1 and the number of ports of the product. If enforced is True, the valve will Move even if they are already on the target point (1 complete rotation). If block is True, the function will wait until the product is not busy.

valveDecrementalMove(target : int, enforced : bool = False, block : bool = True) 

Move the valve to the target port with a decremental Move. The target must be between 1 and the number of ports of the product. If enforced is True, the valve will Move even if they are already on the target point (1 complete rotation). If block is True, the function will wait until the product is not busy.

valveCounterClockwiseMove(target : int, enforced : bool = False, block : bool = True) 

Move the valve to the target port with a decremental Move. The target must be between 1 and the number of ports of the product. If enforced is True, the valve will Move even if they are already on the target point (1 complete rotation). If block is True, the function will wait until the product is not busy.

valveMove(target : int, mode : int = 0, enforced = False, block : bool = True) 

Move the valve to the target port. The target must be between 1 and the number of ports of the product. The mode must be between 0 and 2. 0: ShortestPath, 1: IncrementalMove, 2: DecrementalMove. If enforced is True, the valve will Move even if they are already on the target point (1 complete rotation). If block is True, the function will wait until the product is not busy.

hardStop() 

Stop the product (immediate stop of the valve and the pump)

powerOff() 

Power off the product

PUMP ACTION FUNCTIONS

pumpAbsolutePosition(position : int, block : bool = True) 

Move the pump to the specified position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pump(position : int, block : bool = True)

Move the pump to the specified position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pumpVolume(volume : int, syringeVolume : int = syringeSize, block : bool = True) 

Move the pump to the specified volume. The volume must be between 0 and 5000 ( $\mu l$ ). If syringeVolume is specified, it will be used as the syringe volume. If block is True, the function will wait until the product is not busy.

pumpRelativePickup(position : int, block : bool = True) 

Move the pump to the specified relative position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pumpPickup(position : int, block : bool = True)

Move the pump to the specified relative position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pumpPickupVolume(volume : int, syringeVolume : int = syringeSize, block : bool = True) 

Move the pump to the specified relative volume. The volume must be between 0 and 5000 ( $\mu l$ ). If syringeVolume is specified, it will be used as the syringe volume. If block is True, the function will wait until the product is not busy.

pumpRelativeDispense(position : int, block : bool = True) 

Move the pump to the specified relative position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pumpDispense(position : int, block : bool = True)

Move the pump to the specified relative position. The position must be between 0 and 3000 (or 24000). If block is True, the function will wait until the product is not busy.

pumpDispenseVolume(volume : int, syringeVolume : int = syringeSize, block : bool = True) 

Move the pump to the specified relative volume. The volume must be between 0 and 5000 ( $\mu l$ ). If syringeVolume is specified, it will be used as the syringe volume. If block is True, the function will wait until the product is not busy.

Class Device():

Attributes:

SerialNumber : str = None
ComPort : str = None
DeviceType : str = None

str method return example: "Device RVMFS on port com3 with serial number P201-O0000xxxx"

Class util():

getProductList(specified_type = None) -> list : 

Return a list of Device object. If specified_type is specified, only the Device object with the specified type will be returned (exemple of specifie type : "SPM", "RVMFS" or "RVMLP").

license-text

AMF Tools Python Package by Advanced Microfluidics SA

Copyright (C) 2023 Advanced Microfluidics SA

This Python Package is distributed to all AMF customers and partners for the sole purpose of using it with AMF products.

The right to use this Python Package is included in the price of all AMF OEM products.

REDISTRIBUTION AND USE in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- (i) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- (ii) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- (iii) Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- (iv) The use of this Python Package is restricted to AMF products.

WARRANTY OF EVICTION. Advanced Microfluidics SA represents and warrants: 
- (i) that it holds all the Intellectual Property Rights required to enter into the Agreement; 
- (ii) that the Advanced Microfluidics SA Service, as well as the elements necessary for their operation provided in performance of the Agreement, do not infringe the rights of third parties and do not constitute an infringement of any pre-existing work or even infringement of any other software or other intellectual creation belonging to a third party;

RESPONSIBILITY LIMITATION: This package is provided by the copyright holder and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Advanced Microfluidics SA reserves the right to modify this Agreement at any time by publishing a new version on https://amf.ch . The applicable terms and conditions are those in force on the date of the order.

NUMBER OF COPIES: The Customer may make as many copies of the package as necessary for the use of the Package in accordance with the terms of this Agreement. The Customer may make a copy of the Package for backup purposes. The Customer may not make copies of the Package for any other purpose.

DURATION: This Agreement is effective from the date of delivery of the AMF Product to the Customer and shall remain in force until terminated by either party.

TERMINATION: This Agreement shall terminate automatically if the Customer fails to comply with any of the terms and conditions of this Agreement. In such event, the Customer must destroy all copies of the package.

GEOGRAPHICAL RESTRICTIONS: The Customer may not export or re-export the Package or any copy or adaptation thereof in violation of any applicable locals laws or regulations.

GOVERNING LAW: This Agreement shall be governed by and construed in accordance with the laws of Switzerland. The parties agree that the United Nations Convention on Contracts for the International Sale of Goods is specifically excluded from application to this Agreement.

JURISDICTION: Any dispute arising out of or in connection with this Agreement shall be submitted to the exclusive jurisdiction of the courts of the Canton of Vaud, Switzerland.

BACK TO THE TOP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AMFTools-0.1.2.tar.gz (16.2 kB view hashes)

Uploaded Source

Built Distribution

AMFTools-0.1.2-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page