NewportConnection¶
- class asgard_alignment.NewportMotor.NewportConnection(serial_port: str, resource_manager: ResourceManager)¶
Bases:
objectA class to handle the connection to the newport motors One per controller
Attributes Summary
Methods Summary
Close the connection to the motor
open_connection(resource_manager)resource_manager : pyvisa.ResourceManager object (to avoid constructing it many times)
query_str(str_to_write)Send a query through serial and return the response
write_str(str_to_write)Write a string through serial and do not expect anything to be returned
Attributes Documentation
- SERIAL_BAUD = 921600¶
- SERIAL_TERMIN = '\r\n'¶
Methods Documentation
- close_connection()¶
Close the connection to the motor
- open_connection(resource_manager: ResourceManager)¶
resource_manager : pyvisa.ResourceManager object (to avoid constructing it many times)
- query_str(str_to_write)¶
Send a query through serial and return the response
Parameters:¶
- str_to_write: str
The string to write to the serial port
Returns:¶
- return_str: str
The string returned from the serial port
- write_str(str_to_write)¶
Write a string through serial and do not expect anything to be returned
Parameters:¶
- str_to_write: str
The string to write to the serial port
- SERIAL_BAUD = 921600¶
- SERIAL_TERMIN = '\r\n'¶
- close_connection()¶
Close the connection to the motor
- open_connection(resource_manager: ResourceManager)¶
resource_manager : pyvisa.ResourceManager object (to avoid constructing it many times)