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.
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
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
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
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
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.
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)
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""")
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
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