Exchange Values/Strings between python scripts

Hey there,

I have a setup with a robot, two conveyors and three colored boxes.
The colored boxes each have their own python script.
Each box measures the time of a component.

  • blue box measures time of the conveyor 1
  • green box measures time of the robot
  • red box measures time of the conveyor 2

In each python script I accumulate an array of these times (floating numbers, like 5.678)
At the Ende of the simulation I would like the blackbox to be the master.
It should access all the data of the colored boxes, format it and write it to a file.

Currently I am facing some problems with the communication between the black and the colored boxes.
I have tried to exchange data with help of string signal behaviours as part of the colored boxes.
However, I couldn’t get it to work and even if it worked it would probably yield unsatisfactory results.

image
This is the component graph of the green box.

Is the data exchange between the boxes even possible?
If so, what is the best way to achieve it.

Thank you

Kind regards
DrBro

Maybe this is why you are having issues with signals. Signaling only works when the simulation is running because executing the signal event handlers is done asynchronously through the simulation engine.

You could try with properties since those event handlers are executed synchronously and should work when the simulation is reset as well.

For more complex communication between components there is the Action system. Its not the easiest to use but I think e.g. the Process Modeling human transport controller uses it to communicate to its resources. Actions are also used in the machine tending component library.