{"id":4677,"date":"2021-06-05T16:38:30","date_gmt":"2021-06-05T14:38:30","guid":{"rendered":"https:\/\/cobomation.de\/qmix-sdk-for-python\/"},"modified":"2021-10-08T20:43:25","modified_gmt":"2021-10-08T18:43:25","slug":"cetoni-python-sdk","status":"publish","type":"post","link":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/","title":{"rendered":"Qmix SDK (CETONI SDK) for Python"},"content":{"rendered":"[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/1&#8243; tablet_width_inherit=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221; bg_image_animation=&#8221;none&#8221;][vc_column_text]With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses. The main advantage of Python is its ease of programming, which significantly reduces the time required to develop, debug and maintain the code. In the following example we show you how easy and fast you can implement an application with Python and the Qmix SDK.<\/p>\n<h3>Installation<\/h3>\n<p>To install, simply use the Qmix SDK installation package for Windows. The SDK will be installed in a folder of your choice.<\/p>\n<h3>Integration<\/h3>\n<p>To include the Qmix SDK in your Python script you have to add the path containing the Qmix SDK modules to the module search path. In order for Python to load the shared libraries (DLLs) of the SDK, you must then add the path containing the DLLs to the Windows search path. All details are also available in the online documentation.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">import sys\nimport os\nQMIXSDK_DIR = \"C:\/temp\/QmixSDK-64bit_20180626\"\nsys.path.append(QMIXSDK_DIR + \"\/lib\/python\")\nos.environ['PATH'] += os.pathsep + QMIXSDK_DIR<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Now you can import the modules of the Qmix SDK Python integration.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">from qmixsdk import qmixbus\nfrom qmixsdk import qmixpump<\/pre>\n<p>&nbsp;<\/p>\n<h3>The first Python application<\/h3>\n<p>Now you can start developing your first application. The following program shows a small example. First a bus object is created, initialized with the path to a device configuration and then the communication is started. Then we create a pump object and connect it to the first pump in the SDK &#8211; device index 0. As a test we print the name of the pump with the print function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">def main():\n\"\"\"\nA small example that shows how to use the Qmix SDK for Python\n\"\"\"\nbus = qmixbus.Bus()\nbus.open(\"testconfig_qmixsdk\", \"\")\nbus.start()\npump = qmixpump.Pump()\npump.lookup_by_device_index(0)\nprint(pump.get_device_name())<\/pre>\n<p>&nbsp;<\/p>\n<p>In the next step we perform a reference run with the calibrate function to determine the zero position of the pump. Before the reference run, we clear any remaining errors (clear_fault) and enable the pump (enable). With the help of a timeout timer we wait until the calibration is finished.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">pump.clear_fault()\npump.enable(True)\npump.calibrate()\ntimeout_timer = qmixbus.PollingTimer(10000)\nresult = timeout_timer.wait_until(pump.is_calibration_finished, True)\nprint(result)<\/pre>\n<p>&nbsp;<\/p>\n<p>The pump is now initialized and we can start dosing. For this we set the units for volume and flow rate to milliliter and milliliter per second. As a test we will output the unit for the flow with the print function. Then we configure the syringe to be used. We use a syringe with 1 mm inner diameter and 60 mm plunger stroke. In line 41 we start the aspiration (aspirate) of 0.02 ml with a flow rate of 0.004 ml\/s. With a timeout timer we wait again until the dosage is finished.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">pump.set_volume_unit(UnitPrefix.milli, VolumeUnit.litres)\npump.set_flow_unit(UnitPrefix.milli, VolumeUnit.litres, TimeUnit.per_second)\nprint(pump.get_flow_unit()\npump.set_syringe_param(1, 60)\nprint(pump.get_syringe_param())\nprint(pump.get_volume_max())\nprint(pump.get_flow_rate_max())\npump.aspirate(0.02, 0.004)\ntimeout_timer.set_period(10000)\nresult = timeout_timer.wait_until(pump.is_pumping, False)\nprint(result)<\/pre>\n<p>&nbsp;<\/p>\n<p>At the end of the program we stop the communication and call the close function of the bus object to release all resources again.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">bus.stop()\nbus.close()<\/pre>\n<p>&nbsp;<\/p>\n<p>We hope you got a small impression of how powerful and simple the Qmix SDK for Python is. You can download the Python example from this blog post here.[\/vc_column_text][\/vc_column][\/vc_row]\n","protected":false},"excerpt":{"rendered":"<p>[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/1&#8243; tablet_width_inherit=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2823,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102,89],"tags":[109,93],"class_list":{"0":"post-4677","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-news-en","8":"category-software-en","9":"tag-news-en","10":"tag-software-en"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Qmix SDK (CETONI SDK) for Python - CETONI GmbH<\/title>\n<meta name=\"description\" content=\"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Qmix SDK (CETONI SDK) for Python - CETONI GmbH\" \/>\n<meta property=\"og:description\" content=\"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/\" \/>\n<meta property=\"og:site_name\" content=\"CETONI GmbH\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-05T14:38:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-08T18:43:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"380\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"CETONI\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CETONI\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/\"},\"author\":{\"name\":\"CETONI\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/#\\\/schema\\\/person\\\/f2d4de804c915072039aae63b057de8e\"},\"headline\":\"Qmix SDK (CETONI SDK) for Python\",\"datePublished\":\"2021-06-05T14:38:30+00:00\",\"dateModified\":\"2021-10-08T18:43:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/\"},\"wordCount\":581,\"image\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cetoni.com\\\/wp-content\\\/uploads\\\/python_logo_1280x380.jpg\",\"keywords\":[\"News\",\"Software\"],\"articleSection\":[\"News\",\"Software\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/\",\"url\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/\",\"name\":\"Qmix SDK (CETONI SDK) for Python - CETONI GmbH\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cetoni.com\\\/wp-content\\\/uploads\\\/python_logo_1280x380.jpg\",\"datePublished\":\"2021-06-05T14:38:30+00:00\",\"dateModified\":\"2021-10-08T18:43:25+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/#\\\/schema\\\/person\\\/f2d4de804c915072039aae63b057de8e\"},\"description\":\"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cetoni.com\\\/wp-content\\\/uploads\\\/python_logo_1280x380.jpg\",\"contentUrl\":\"https:\\\/\\\/cetoni.com\\\/wp-content\\\/uploads\\\/python_logo_1280x380.jpg\",\"width\":1280,\"height\":380},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/cetoni-python-sdk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/cetoni.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Qmix SDK (CETONI SDK) for Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/cetoni.com\\\/en\\\/\",\"name\":\"CETONI GmbH\",\"description\":\"Automatisierungs- und Mikrofluidikl\u00f6sungen f\u00fcr das Labor\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cetoni.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cetoni.com\\\/en\\\/#\\\/schema\\\/person\\\/f2d4de804c915072039aae63b057de8e\",\"name\":\"CETONI\",\"sameAs\":[\"http:\\\/\\\/cobomation.de\"],\"url\":\"https:\\\/\\\/cetoni.com\\\/en\\\/author\\\/cetoni\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Qmix SDK (CETONI SDK) for Python - CETONI GmbH","description":"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/","og_locale":"en_US","og_type":"article","og_title":"Qmix SDK (CETONI SDK) for Python - CETONI GmbH","og_description":"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.","og_url":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/","og_site_name":"CETONI GmbH","article_published_time":"2021-06-05T14:38:30+00:00","article_modified_time":"2021-10-08T18:43:25+00:00","og_image":[{"width":1280,"height":380,"url":"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg","type":"image\/jpeg"}],"author":"CETONI","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CETONI","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#article","isPartOf":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/"},"author":{"name":"CETONI","@id":"https:\/\/cetoni.com\/en\/#\/schema\/person\/f2d4de804c915072039aae63b057de8e"},"headline":"Qmix SDK (CETONI SDK) for Python","datePublished":"2021-06-05T14:38:30+00:00","dateModified":"2021-10-08T18:43:25+00:00","mainEntityOfPage":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/"},"wordCount":581,"image":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#primaryimage"},"thumbnailUrl":"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg","keywords":["News","Software"],"articleSection":["News","Software"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/","url":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/","name":"Qmix SDK (CETONI SDK) for Python - CETONI GmbH","isPartOf":{"@id":"https:\/\/cetoni.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#primaryimage"},"image":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#primaryimage"},"thumbnailUrl":"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg","datePublished":"2021-06-05T14:38:30+00:00","dateModified":"2021-10-08T18:43:25+00:00","author":{"@id":"https:\/\/cetoni.com\/en\/#\/schema\/person\/f2d4de804c915072039aae63b057de8e"},"description":"With the new Python integration for the Qmix SDK you can develop small applications in the shortest time, automate certain dosing processes or realize your own analyses.","breadcrumb":{"@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cetoni.com\/en\/cetoni-python-sdk\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#primaryimage","url":"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg","contentUrl":"https:\/\/cetoni.com\/wp-content\/uploads\/python_logo_1280x380.jpg","width":1280,"height":380},{"@type":"BreadcrumbList","@id":"https:\/\/cetoni.com\/en\/cetoni-python-sdk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/cetoni.com\/en\/"},{"@type":"ListItem","position":2,"name":"Qmix SDK (CETONI SDK) for Python"}]},{"@type":"WebSite","@id":"https:\/\/cetoni.com\/en\/#website","url":"https:\/\/cetoni.com\/en\/","name":"CETONI GmbH","description":"Automatisierungs- und Mikrofluidikl\u00f6sungen f\u00fcr das Labor","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cetoni.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cetoni.com\/en\/#\/schema\/person\/f2d4de804c915072039aae63b057de8e","name":"CETONI","sameAs":["http:\/\/cobomation.de"],"url":"https:\/\/cetoni.com\/en\/author\/cetoni\/"}]}},"_links":{"self":[{"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/posts\/4677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/comments?post=4677"}],"version-history":[{"count":0,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/posts\/4677\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/media\/2823"}],"wp:attachment":[{"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/media?parent=4677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/categories?post=4677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cetoni.com\/en\/wp-json\/wp\/v2\/tags?post=4677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}