HelpWizard Pages Linking Technologies3/en: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Cg (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<strong>Linking Technologies: Python Actions</strong> link=HelpWizard Pages Linking Technologies2/en|back Datei:arrowright.png|link=…“) |
Cg (Diskussion | Beiträge) |
||
Zeile 9: | Zeile 9: | ||
# import <your actual modules here> |
# import <your actual modules here> |
||
# dummy - in reality you'd call into your module... |
|||
def readFromDevice(portNr): |
def readFromDevice(portNr): |
||
return "1.23456" |
return "1.23456" |
Version vom 17. März 2022, 17:52 Uhr
Linking Technologies: Python Actions
Lets assume, that the input to the C-function should come from a Python function (assume that you have imported a module, which reads a value from a measurement device or your device under test).
Create a new Python-action with input and output pins and type:
# import <your actual modules here> # dummy - in reality you'd call into your module... def readFromDevice(portNr): return "1.23456" def execute(): port = inPin.value() outPin.value( readFromDevice(port) )