How to get all components from the flow group?

hi, I am learning visual component python coding .
I have created a flow group following the tuorial , the flow can feed material to conveyor and the robot transports it to the process machines like ProLath and CMC , once done then the robot put the finished product on another conveyor .

now I am trying to get the devices dynamically from the scene flow_group , to create a CSV which categorize the devices according to the different flow_groups

I have tried codes like below
#flow nodes
flow_groups= flow_group_manager.Groups
for node in transportSystem.Nodes:
print(“node.parent%s node.type%s”%(node.Parent.Name,node.Type))
print(node.ComponentContainer.Name)
for link in node.TransportLinks:
print(“node.parentName:%s link.Source:%s link.Destination:%s”%(node.Parent.Name,link.Source.Parent.Name,link.Destination.Parent.Name))

#flow steps
flow_sequences=flow_table2.Sequences
for sequence in flow_sequences:
flow_steps = sequence.FlowSteps
for i in range(flow_steps.size()):
step=flow_steps.get(i)

but with both methods, I still couldn’t get the full devices inside the flow_group
the transport node can show conveyors/prolath/CMC but dosent have robot’s node
and about the step , I couldnt get avalible device nodes information from it .

so can I know what is the correct way to interate the device component inside the flow group ?

thanks

If you want to get all implementations of processes which appear in some flow sequence you need to:

  1. Get the vcProcessGroups from the vcProcessFlowStep These represent the processes themselves.
  2. Get the implementations of those processes from the vcProcessGroups, which are process routines. vcProcessGroup
  3. Then get the process executor of each vcProcessRoutine through vcRoutine.Program.Executor. From there you could get the Component, but note that a single component can have more than one process executor.

If you also want to know all transport controllers which may be used in a flow group, you will need to:

  1. Get all transport links from vcTransportSystem and filter those based on the vcTransportLink.SupportedGroup value.
  2. Get the Implementer vcTransportController from each transport link. Note that there are System transport controllers for the interpolation and conveyor transport, and vcPythonTransportController behaviors in components.

The vcPythonTransportControllers are always in some component, but they generally use other components (static and mobile robots, humans) to perform the actual transport. How those transport resources are connected to the controllers is up to each implementation, but usually interface connections are used.

2 Likes

hi, thanks for your reply .
I tried to follow your suggestion with the code below:

process_controller=sim.ProcessController
flow_group_manager=process_controller.FlowGroupManager
flow_group_controller=flow_group_manager.Controller
flow_table2=flow_group_controller.FlowTable2
flow_sequences=flow_table2.Sequences

for sequence  in flow_sequences:
  flow_steps = sequence.FlowSteps
    for i in range(flow_steps.size()):
      step=flow_steps.get(i)

      for i in range(step.Groups.size()):
        group=step.Groups.get(i)
        for routine in group.Implementations:
          print(routine.Program.Executor.Parent.Name)

then I got devices information as below:
From Conveyor Process
Process Machine - ProLathe #2
Process Machine - ProLathe
Coordinate Measuring Machine
To Conveyor Process

the robot implementer still missed…

on my side, I tried the transportlink again , and I just found that the transportlink’s implementer can get the robot role.

transportSystem=flow_group_controller.TransportSystem
for node in transportSystem.Nodes:
   for link in node.TransportLinks:
        print("node.parentName:%s   link.Implementer:%s"%(node.Parent.Name,link.Implementer.Parent.Name))

the output:

node.parentName:Process Machine - ProLathe #2 link.Implementer:RobotController
node.parentName:Process Machine - ProLathe link.Implementer:RobotController
node.parentName:Coordinate Measuring Machine link.Implementer:RobotController
node.parentName:To Conveyor Process link.Implementer:RobotController
node.parentName:From Conveyor Process link.Implementer:RobotController

thanks for your reply , this is really helpful ~

so for the whole flow group, can I understand the structure as below ?

1 the flow step is made of the process steps with differet groups, and all these are logically about product processing only, like CNC proLathes.

2 the transport system is made of the transport nodes which are mainly for product transporting, like robot/conveyor/

1 and 2 build up the flow group together to transport and process a product from the start pickup point to the end finishing point.

Here is an analogy:

  • The flow sequence is your agenda for a day: Start at home, Go to work, Go buy groceries from a supermarket, Go home, Go to a gym, Go home
  • Process groups are the operations / activities. In this case Home, Work, Supermarket, Gym. There are many supermarkets and gyms (process implementations), any of which can be used, but only one home and workplace.
  • Transport system is the road network and public transit / taxi service which enable you to get to those processes.
5 Likes

thanks for your patient explanation and the analogy, it helps me a lot to understand the mechnisim of Visual component in a clear way .