Insanely slow File I/O (read) on fluent

Hi all,

I am reading a .xslx with Tecan Fluent and it is taking 3 minutes to read 96 rows. Is this normal? The file is a single column with all floating points. Is there a way to speed this up?

Yeah - don’t use import variable

it copies the file at every line/row import

i would recommend array update from an external application (.vb) to handle the values being imported

1 Like

Lol no way… Are there any guides on how to do that? This method was setup from Tecan this way, I have 3 files to load so its taking me 10 minutes just to trouble shoot the file I/O to fix an issue with in the method. :smiling_face_with_tear:

this forum has various examples for FluentControl arrays
the Tecan scripts for Robocolumns are pretty basic for scripting and not efficient for good chromatography practices

1 Like

Thanks for the quick response! Thank you, didn’t realize this was such a common work around. Found a few examples on the forum thanks! Crazy I took the intermediate course but it did not cover anything even close to this, not even File I/O was covered. Really appreciate the help!

I may have some super old Excel code laying around if you’re still interested

@luisvillaautomata any code would be appreciated. I don’t see a section in the manual for executing VB.net.

I’m really unfamiliar with Tecans. It looks like to me at least for the Evo, maybe the Fluent, the ideal workflow as an advanced user is to do a lot of your logic operations in VBscript then pass this to the Tecan? Is this safe to say?

1 Like

Actually I think this thread gets me 90% there, I’m reading magellen files: Accessing magellan results in fluent control script - #2 by Optimize

Yep. You can execute VB.NET scripts through the Execute VB command under Programming.

If you’re a script kiddie, you can do some amazing things with extremely simple VB. However if you know your way around software, you can unlock pretty much any functionality or use any modern tool.

With that said, there are some good forum threads here but IMO this forum is not necessarily a good place for sharing knowledge in a way that teaches people. I’m going to publish a substack soon where I hope to aggregate a lot of information (github linked), blog about papers I read and hopefully teach folks some best practices.

1 Like
Imports Microsoft.VisualBasic
Imports System
Imports Tecan.Core.Scripting
Imports System.IO
Imports System.Net
Imports System.Collections
Imports System.Collections.Generic

Public Class TestClass
	
	Implements IScriptObject

	Private Host As IScriptingHost

	Public Property ScriptingHost() As IScriptingHost Implements IScriptObject.ScriptingHost
		Get
			Return Host
		End Get
		Set(ByVal value As IScriptingHost)
			Host = value
		End Set
	End Property

	Public Sub Execute() Implements IScriptObject.Execute


                ' Set Excel file path in Tecan Fluent for the variable pathExcel
                Dim pathExcel As String = Host.GetVariable("pathExcel")
                ' Set CSV file path in Tecan Fluent for the variable pathCSV
                Dim pathCSV As String = Host.GetVariable("pathCSV")

                ' Set the range of the Excel file to be read (e.g., A2:B2) (can be variabilized ranges)
                Dim rangeExcel As String = "A2:B2"

                'Boiler Plate code to open Excel file & Worksheet
                Dim xlApp As Object = CreateObject("Excel.Application")
                Dim xlBook = xlApp.Workbooks.Open(pathExcel)
                Dim xlWorksheet = xlBook.Worksheets(1)

                xlApp.DisplayAlerts = True
                xlApp.Visible = False

                ' Read the data from the Excel file
                Dim dataRange As Object = xlWorksheet.Range(rangeExcel)
                Dim dataArray As Object(,) = CType(dataRange.Value, Object(,))
                Dim valueExcel
                
                ' Open the CSV file to write the data
                ' Dim sw As StreamWriter = New StreamWriter(pathCSV)
                ' Dim output As String

                For i As Integer = 1 To dataArray.GetUpperBound(0)

                        ' Grab value from cell in Excel Worksheet
                        valueExcel = dataArray(i,2)
                        
                        ' Write the data to the CSV file	
                        ' Modify the output format as needed
                        ' output = i & ";" & valueExcel 
                        ' sw.WriteLine(output)

                        ' Or set the data to a variable in Tecan Fluent
                        ' Host.SetVariable("variableNameFromTecanFluent", valueExcel)
                
                        ' Or set the value to an array in Tecan Fluent
                        ' Dim arrayTecan = "Array[" & i & "]" 
                        ' Host.ResolveExpression("arrayTecan:=" & valueExcel) 'This may require actual execution and debugging in Tecan since I don't have an Excel file on me
                Next

                ' Close the CSV file if writing to a file
                ' sw.Close()

                ' Close the Excel file
                xlApp.DisplayAlerts = False
                xlBook.Close
                xlApp.Quit

	End Sub
End Class
	
	

Uncomment the items you want to test.

There’s a Touch Tools command for selecting a file.

Three tests

  1. Feed that filepath to a variable named pathExcel. Create pathCSV if you want to translate an Excel to a CSV. Look for completed CSV.
  2. Create a variable for passing info from Excel to variable in Tecan. Display value from variable via User Prompt on Tecan.
  3. Create an array for passing info from Excel to an array in Tecan. Display value from array via User Prompt on Tecan.

Three line tetsing script.

  1. Select File via Touch Tools
  2. Execute VB (make sure you have pathExcel and pathCSV variables as strings, arrayTecan as a string, variableNameFromTecanFluent as a string created. You need all four variables for all three scenarios)
  3. User prompt that displays value you returned to Tecan from Excel
2 Likes