Thermo Scientific KingFisher Flex BindIt Driver Page#
This page has all the information specific to the Thermo Scientific KingFisher Flex BindIt driver and adapter.
Supported BindIt versions#
Thermo Scientific KingFisher Flex BindIt 4.1
Thermo Scientific KingFisher Flex BindIt Installer#
You can download the latest installer here. Before launching the driver, make sure to also launch the program MibAiServer
which is installed as part of the BindIt
application.
Thermo Scientific KingFisher Flex BindIt Adapter config.yaml
File#
log:
level: "DEBUG"
loggerLevels:
- logger: "tutorial"
level: "DEBUG"
artificial:
host: your-instance.artificial.com
lab: lab_1a2b3c-4d5e-6f7g-8h9i-123456abcdef
adapter:
name: BindItTutorialAdapter
remoteConfig: False
allowAnySequenceId: True # Useful when running in a local dev container
plugin: # all resources this adapter can connect to
resource:
name: "Bindit Flex" # user friendly name, unique in the adapter
id: "bindit"
driver:
name: "bindit" # Driver name, this is a non-configurable string that needs to match the driver identity
url: "http://bindit.webaddress.com:55175" # URL of the hardware and driver
resource_simulation: false # Set to true to run simulation without hardware
driver_simulation: false # Set to true to run simulation without a driver
cert_file: "adapter/certs/ca.crt"
workspace_name: "C:/bindit_files/Bindit i7.bif"
# BindIt uses different instrument for simulation. Must include the regular instrument and simulation instrument WITH SAME RID.
asset_sync:
devices: # device string names/prefix must match resource id above
"bindit": { rid: "d1234567-34d0-4391-be64-7aef4e0b28be" }
"bindit:KingFisher Flex simulator": { rid: "d1234567-34d0-4391-be64-7aef4e0b28be" }
Fill in the correct URL and port for the BindIt device. (The IPv4 URL can be obtained on the device by running ipconfig in a command window. The port is listed in the running driver server window.)
You may update the resource name above if you wish (any unique string will work).
If you wish to run in simulation without hardware or without a driver, change resource_simulation or driver_simulation to true, respectively.
Under asset_sync, match at least one of your devices to a Digital Twin asset ID. You can fill out the rest of the devices later. Consult the corresponding step in Hardware-Specific Adapter Setup.
Update the artificial section to the correct host and lab. Consult the corresponding step in Hardware-Specific Adapter Setup for how to do this.
Thermo Scientific KingFisher Flex BindIt Adapter adapter/main/plugin.py
File#
from artificial.adapter_common import ActionModulePlugin, action_modules
from artificial.adapter_common.plugin import PluginContext, plugin_config
from artificial.bindit.actions import BinditActions
from artificial.bindit.core import BinditResource
from artificial.bindit.event_handler import BinditEventHandler
from artificial.logging import get_logger
from artificial.resource_base.asset_syncer import ResourceAssetSyncer
from artificial.resource_base.models import PluginConfig, SyncConfig
logger = get_logger(__name__)
@action_modules(BinditActions)
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()
# create instances of resources for this adapter
resource = BinditResource(
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(BinditActions(resource))
# subscribe the driver events
event_handler = BinditEventHandler(resource)
resource.add_event_handler(event_handler)
Thermo Scientific KingFisher Flex BindIt Adapter adapter/main/__main__.py
File#
Copy the following list of actors into the file in place of the example actors.
actors = [
ActorConfig(id='bindit', abilities={'run_protocol': 1, 'substrate': 1, 'bindit': 1}),
]
Thermo Scientific KingFisher Flex BindIt Adapter pyproject.toml
Dependencies#
Run the below commands in the terminal to install the required packages:
uv add "bindit-driver-client>=2.19.0, <3.0.0"
uv add artificial-bindit-adapter==0.1.*
Your pyproject.toml
file should now include bindit-driver-client
and artificial-bindit-adapter
in the project dependencies section:
[project]
dependencies = [
"bindit-driver-client>=2.19.0, <3.0.0",
"artificial-bindit-adapter==0.1.*"
]
Thermo Scientific KingFisher Flex BindIt Simple Connectivity Workflow#
This workflow will run a method of your choosing and log a message in the UI upon successful completion. You will define which method to run in the request UI by inputting the method name with its full path (e.g., C://Protocols//mymethod.bdz
).
After copying this code into a file, remember to replace the lab_guid in the workflow heading with the one from your Lab (most easily found by opening the Lab in Artificial and looking in the browser address bar). Consult Adding and Running a Simple Connectivity Test Workflow for more info.
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 BindIt Connectivity Test Workflow',
'simple_bindit_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_bindit_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='1', 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')