HelpWizard Pages Linking Technologies3/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „<strong>Linking Technologies: Python Actions</strong> link=HelpWizard Pages Linking Technologies2/en|back Datei:arrowright.png|link=…“)
 
 
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 4: Zeile 4:
[[Datei:arrowright.png|link=HelpWizard Pages Linking Technologies4/en|forward]]
[[Datei:arrowright.png|link=HelpWizard Pages Linking Technologies4/en|forward]]


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).
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). Also assume, that you have already installed the required Python package(s) - typically via the "pip" installer.


Create a new Python-action with input and output pins and type:
Create a new [[Expecco_API/en#Bridged_Python_Elementary_Blocks|Python-action]] with input and output pins and type:
# 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"
Zeile 17: Zeile 18:


This can now be connected to the sequence:
This can now be connected to the sequence:

[[Datei:C HelloWorld Action2.png|300px]]
[[Datei:C HelloWorld Action2.png|250px]]


[[Category: HelpWizard/en]]
[[Category: HelpWizard/en]]

Aktuelle Version vom 19. März 2022, 07:39 Uhr

Linking Technologies: Python Actions

back forward

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). Also assume, that you have already installed the required Python package(s) - typically via the "pip" installer.

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) )

This can now be connected to the sequence:

C HelloWorld Action2.png



Copyright © 2014-2024 eXept Software AG