Hello everyone! I am new to Visual Components and I am currently facing some problems I hope someone could help me out.
I am trying to print a data from a “Statistics” behaviour in the “Behaviours” section of the GenericRobot onto the Output panel just as how I have done for the Conveyor.
The data I am trying to collect is the PartsTotalTime. I would like the Robot to print how long it was in Operation, I figured if the robot detects that a part has exited the Robot, it would print PartsTotalTime.
I am fairly new to Python as well shifting from C, however this logic seems to work in my head but doesn’t seem to be working on Visual Components. There is definitely something I am understanding wrongly.
Here is the code I have written:
from vcScript import *
from vcStatistics import *
from vcHelpers.Robot2 import *
comp = getComponent()
app = getApplication()
stats = comp.findBehaviour(“Statistics”)
robot_executor = comp.findBehaviour(“Executor”)
if (stats.PartsIntervalExited != 0):
Thank you very much.