VB.net for fluentcontrol?

Does anybody have access to a guide or API for using visual basic with fluent control? If so could you please direct me towards it or post it here? I’m quickly learning that if I want to do things variably I might want to consider using it.

Thank you!

I have some small scripts that I have found/made (Creadits to Chat-GPT for help)
Maybe it will be helpful for you to have?

Not exactly what you are asking for but maybe it can help you do what you want to do:

DeleteFile.vb
Imports Microsoft.VisualBasic
Imports System
Imports Tecan.Core.Scripting

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
    My.Computer.FileSystem.DeleteFile("C:\VBScript\test.txt")
End Sub

End Class

MoveFile.vb

Imports Microsoft.VisualBasic
Imports System
Imports Tecan.Core.Scripting

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
	My.Computer.FileSystem.MoveFile("C:\VBScript\Mytest.txt",
		"C:\VBScript\test.txt",
		FileIO.UIOption.AllDialogs,
		FileIO.UICancelOption.ThrowException)
End Sub

End Class

CreateFile.vb

Imports Microsoft.VisualBasic
Imports System
Imports Tecan.Core.Scripting
Imports System.IO
Imports System.Text

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
    Dim path As String = "C:\VBScript\MyTest.txt"

    ' Create or overwrite the file.
    Dim fs As FileStream = File.Create(path)

    ' Add text to the file.
    Dim info As Byte() = New UTF8Encoding(True).GetBytes("This is some text in the file.")
    fs.Write(info, 0, info.Length)
    fs.Close()
End Sub

End Class

I have more small scripts that I have used and tested, but I am by no means an expert here.
I hope you can use it

1 Like

Thanks for your response @MortenSkovsted ! Perhaps I’m a bit confused as to the purpose of these scripts. I was under the impression I could give arm movement commands for the fluent using VB.net and there was an API for this?

did you look through the FluentControl manual ?
Chapter 15 has details on API

functionality is limited to start method, parameter entry & monitor progress; all actions are controlled within FluentControl methods but there are various ways/means to initiate arm movements from a VB/C# environment into FC methods

Thanks Optimize, I guess I didn’t really understand what I was asking for. I was expecting something nice like opentrons API, boy was I wrong :face_with_spiral_eyes:

I’ll peruse it

Sorry if I misunderstood you, but yes API with Fluent Control is more to start methods.
I do not know how to move the arm from VB.net

1 Like

What are you trying to accomplish?

Well, I was trying to find a way to move the RGA without using fluentcontrol’s drag and drop system. I’m making a gsheet interface for users to fill out that will make a worklist based on a python file. The issue I’m seeing is I don’t have a good way to tell the machine to move all the plates to the deck that the worklist references.

I suppose I could instead just make a worklist file per say, groups of four or fewer plates, bring those out, run the worklist while they’re out, pull a variable from a file that I write, use that variable to specify the numbers of the next group of plates, then generate a new worklist for the next four or fewer plates until I’m done. I just thought there could be a more elegant way of doing it. It seems VB isn’t the way for me to go

You could write a subroutine that query’s a work list file that loops over each plate ID and moves them one at a time.

Do you have enough deck space?

1 Like

this sounds like fun,
pass a variable into FluentControl as as array for each plate to be moved,
split the array to a number of plates to move
and then use script/method to run x loops, to move plate[x] to pos[x] on worktable
you can also add variable for deckposition[], platebarcode[],labwaretype[] to be truly dynamic

if i have time, i can create an example

It may not be needed to split the large pipetting worklist into multiple small worklists per plate set. Just go over the same large worklist file with all pipetting steps every time after you bring a set of plates to the deck and let it automatically only pipette the labware that is currently on deck and skip the labware that is currently in storage (for example in hotel, carousel, cytomat, etc…). At Load Worklist select ‘Skip labware without warning’ so it doesn’t give an error when a plate from the worklist is missing.

image

1 Like

@Snowball I had this idea before too, but this doesn’t seem to work once I’ve tried it.

Given the following worklist:

Worklist
C;Removing 50uL
A;wellplate96[001];;;A4;;50;;;;
A;wellplate96[002];;;A4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;B4;;50;;;;
A;wellplate96[002];;;B4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;C4;;50;;;;
A;wellplate96[002];;;C4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;D4;;50;;;;
A;wellplate96[002];;;D4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;E4;;50;;;;
A;wellplate96[002];;;E4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;F4;;50;;;;
A;wellplate96[002];;;F4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;G4;;50;;;;
A;wellplate96[002];;;G4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;H4;;50;;;;
A;wellplate96[002];;;H4;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;A3;;50;;;;
A;wellplate96[002];;;A3;;50;;;;
D;waste;;;A1;;100;;;;
F;
A;wellplate96[001];;;B3;;50;;;;
A;wellplate96[002];;;B3;;50;;;;
D;waste;;;A1;;100;;;;
F;

If I only have wellplate96[001] on the deck and wellplate96[002] in a hotel, it skips the entire worklist

This is fluentcontrol V. 3.0.16

So pass in that array from a file I generate, and also split up my worklist within my python file so only plates that are moved are dealt with. Then every loop I guess I just overwrite my temporary_worklist.gwl with a new one using a python executable

Hi,
Is it possible to “pass a variable into FluentControl as an Array”? I have defined an array a[] in FluentControl and transferring it back using

Host.SetVariable("a", a)

Does not work. Will report a is not defined. Nor does this work Host.SetVariable("a[]", a)
Setting it individually does not work as well Host.SetWariable("a[1]", 10)

i’ve been doing this for a while

setting an array isn’t using the “variable”, but using an expression

Public Sub Execute() Implements IScriptObject.Execute
Dim strTest As String
Dim intTest As Integer

'get ubound of an array
intTest = Host.ResolveExpression("count(arrayStr[])")

'get a value from an array
strTest = Host.ResolveExpression("arrayStr[4]")

'set a value in the array
Host.ResolveExpression("arrayStr[4]:=""cat""")

End Sub

2 Likes

an actual example is below where I’m reading volumes from a file, and writing direct into a multi-dimensional array:

expression = String.Format(“VolArray1000[” & (j - 1) & “][” & i & “]:=” & InputFileArray(i, j))
Host.ResolveExpression(expression)

2 Likes

Optimize has already given a good answer but I will still add an other vb.script for context:

Readfile.vb:

Imports Microsoft.VisualBasic
Imports System
Imports Tecan.Core.Scripting
Imports System.IO
Imports System.Text
Imports System.Windows.Forms

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
Dim BarcodeArray As String() = File.ReadAllLines("C:\VBScript\FileWithBarcodes.txt")

For index As Integer = 1 To BarcodeArray.Length - 1
	Dim element As String = BarcodeArray(index)
	Dim ExpressionStr As String = "StrArray[1] := 1234"
	
	Host.ResolveExpression(ExpressionStr)
	ExpressionStr = "StrArray[" & index & "] := " & element
	MessageBox.Show(ExpressionStr)
	Host.ResolveExpression(ExpressionStr)
	

        
    Next
End Sub

End Class

1 Like

some additional points to note,

my use case is to transfer pipetting volumes directly into FluentControl,
somewhere in the region of 15,000 pipetting events

handling this through arrays via vb is not quick,
each transaction is about 100 ms

so the start up routine for this script is about 25 minutes as each array is populated

That’s insane.

25 minutes just to kick it off? No thanks.

I bet there’s a 1000x faster way to achieve the same results, maybe you could post a description of the desired inputs and outputs and we can help think of a more time efficient implementation