Reading Modul names with RAB

Hello everybody,

i would like to read out all the modules(as string) of the Robotcontroller and would like to put them listed in a combobox!

Anyone an idea how i can solve this problem

I tried some things out (in VB) but nothing really work by now.

tRob1 = ctrl.Rapid.GetTask(“T_ROB1”)
RSCol = tRob1.SearchRapidSymbol(SProp, “Module”, String.Empty)

Is “Module” correct? Or must it be “mod” or “modul”

And after that how can i read out “RSCol”

Maybe this is the complete wrong way, i don’t know
Anyone an idea?

Cheers “7”

This is the code i use in VS2008 VB
Dim TaskName As String = “T_ROB1”

Dim modulantal As Integer = robotController1.Rapid.GetTask(TaskName).GetModules.Count

ComboBoxModules.Items.Clear()

For i = 0 To modulantal - 1

Dim modul As RapidDomain.Module = robotController1.Rapid.GetTask(TaskName).GetModules(i)

ComboBoxModules.Items.Add(modul.Name)

Next

ComboBoxModules.SelectedIndex = 0

[QUOTE=Klaus] This is the code i use in VS2008 VB
Dim TaskName As String = “T_ROB1”

Dim modulantal As Integer = robotController1.Rapid.GetTask(TaskName).GetModules.Count

ComboBoxModules.Items.Clear()

For i = 0 To modulantal - 1

Dim modul As RapidDomain.Module = robotController1.Rapid.GetTask(TaskName).GetModules(i)

ComboBoxModules.Items.Add(modul.Name)

Next

ComboBoxModules.SelectedIndex = 0

[/QUOTE]

Thanks a lot Klaus, this one really help me out :clap:

But i had to change one thing!

I had to replace GetModules.Count with GetModules.Length

I don’t know why. Anway, it works :+1:

Once again thank you for the code.

Cheers “7”

super that it works