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 ?
If you want to get all implementations of processes which appear in some flow sequence you need to:
Get the vcProcessGroups from the vcProcessFlowStep These represent the processes themselves.
Get the implementations of those processes from the vcProcessGroups, which are process routines. vcProcessGroup
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:
Get all transport links from vcTransportSystem and filter those based on the vcTransportLink.SupportedGroup value.
Get the ImplementervcTransportController 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.
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 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.