Clean & supported/futuresafe PM-way to call Python-Scripts

Hy,

as discussed in this thread:

It seems that the “Process”-Statement is not build to exist in future?!

If so, what is the supported and clean way to call custom functionality via phyton-script which is built for future??

I don’t think that I can’t realise my simulation stuff without python-scripting!

Examples:

  • Read In machine programs dynamically (xml, json, txt,…)
  • Do stuff that is out of box from Process modelling
  • Replace missing PM-Feature with Python-logic and functionality
  • Do other black magic… :wink:

Thx & Regards
Feature

Nobody here can really give you any promises about the future.

The issue with the Python process handler is that its a legacy feature “accidentally” carried over from the robot executor. It is not designed with PM functionality in mind, and neither is PM functionality designed with the process handler in mind.

Extensibility through API is not forgotten, and PM currently (VC 4.2.2) has complete API (.NET and Python) for configuration, with more runtime things probably coming later.

A bit crappy but probably future-proof way to execute Python code in the middle of a PM process is to use the SendSignal and WaitSignal statements. First you trigger a string signal that a Python script reacts to and then wait for a “completion” reply from the script using another signal. With different string values you can run different functions in the script.