========================== Hamilton Venus Driver Page ========================== This page has all the information specific to the Hamilton Venus driver and adapter. Supported Venus versions ------------------------ Venus 4 (4.5), Venus 5 (4.6), Venus 5 with Dynamic Scheduler, Venus 5 with Venus on Vantage (VoV) Venus Installer --------------- Contact Artificial for the installer. Venus Adapter :file:`config.yaml` File -------------------------------------- .. code-block:: yaml :caption: :file:`config.yaml` log: level: "DEBUG" loggerLevels: - logger: "tutorial" level: "DEBUG" artificial: host: your_namespace.notartificial.xyz lab: lab_1a2b3c-4d5e-6f7g-8h9i-123456abcdef org: artificial prefix: your_namespace adapter: name: HamiltonTutorialAdapter remoteConfig: False allowAnySequenceId: True actors: - id: hamilton-1 # must match resource id below abilities: venus: 1 run_protocol: 1 substrate: 1 # required for registering as an actor plugin: # all resources this adapter can connect to resource: name: "My Hamilton" # user friendly name, unique in the adapter id: "hamilton-1" driver: name: "hamilton" # driver server side name. use [server_url]/api/v1/drivers to list what's available url: "http://myhamilton.webaddress.com:49835" # driver server url resource_simulation: false # To run without hardware driver_simulation: false # To run without driver asset_sync: devices: # device string names/prefix must match resource id above "hamilton-1": { rid: "d1234567-34d0-4391-be64-7aef4e0b28be" } #. Fill in the correct URL and port for the hamilton device. Venus Adapter :file:`adapter/main/plugin.py` File ------------------------------------------------- .. code-block:: python :caption: :file:`adapter/main/plugin.py` file from artificial.adapter_common import ActionModulePlugin, ability_name, action_modules from artificial.adapter_common.plugin import PluginContext, plugin_config from artificial.logging import get_logger from artificial.resource_base.asset_syncer import ResourceAssetSyncer from artificial.resource_base.models import PluginConfig, SyncConfig from artificial.venus.actions import VenusActions from artificial.venus.core import VenusResource from artificial.venus.event_handler import VenusEventHandler logger = get_logger(__name__) @action_modules(VenusActions) class AdapterPlugin(ActionModulePlugin): """assemble resources components with resource configuration""" _cfg = plugin_config(PluginConfig) # this will make PluginConfig show up in the adapter config UI async def setup(self, pctx: PluginContext) -> None: plugin_conf = self._cfg prog_config = pctx.config sync_config: SyncConfig = pctx.raw_config.to_dataclass(SyncConfig, 'adapter.asset_sync') logger.debug(f'sync_config loaded: {sync_config}') # all resources in the adapter use the same res_syncer syncer = pctx.asset_sync_manager_v1(f'ResourceSyncer-{prog_config.adapter.name}') res_syncer = ResourceAssetSyncer(syncer, sync_config) await res_syncer.initialize() # creat instances of resources for this adapter resource = VenusResource( pctx.alabPyBase, lab_id=prog_config.artificial.labId, adapter_id=prog_config.adapter.name, resource_id=plugin_conf.resource.id, name=plugin_conf.resource.name, res_syncer=res_syncer, ) if resource: # hook up action modules and event handlers resource.set_driver(driver_config=plugin_conf.resource.driver, simulator=None) await resource.set_health_monitors(pctx.lab.health) self.add_module(VenusActions(resource)) # subscribe the driver events event_handler = VenusEventHandler(resource) resource.add_event_handler(event_handler) Venus Adapter :file:`PipFile` Dependencies ------------------------------------------ .. code-block:: python [packages] hamilton-driver-client = ">=2.14.0, < 3.0.0" artificial-venus-adapter = ">=1.0.0" artificial-workflows = "==0.18.*" You can include other packages as well as long as the versions don't conflict. Venus Simple Connectivity Workflow ---------------------------------- This sample workflow, when passed your method name will full path as appropriate, will run the instrument protocol and then log a message in the UI upon a successful completion. .. code-block:: python from typing import List from artificial.workflows.decorators import parameter, workflow from artificial.workflows.runtime import show_info from stubs.stubs_actions import VariableType, run_protocol_to_completion @workflow( 'Simple Venus Connectivity Test Workflow', 'simple_venus_connectivity_workflow', 'lab_af75de7a-3da7-435a-be6c-fadd7e97a82b', interactive=True, quick=True ) @parameter('method_full_name', {'required': True, 'uiTitle': 'Instrument Method Name'}) async def simple_venus_connectivity_workflow(method_full_name: str) -> None: params: List[VariableType] = [ VariableType(var_name='run_now', var_value='true', var_type='TrueFalse'), VariableType(var_name='nplates', var_value='2', var_type='Numeric'), ] await run_protocol_to_completion(protocol_full_name=method_full_name, parameters=params) await show_info('Congratulations, you successfully ran your hardware!', 'Hardware Success')