Skip to main content

Call Async Py Method

adminAbout 1 min

Call Async Py Method.vi

Asynchronously call a python function and recieve python return data. Unlike Call Py Method.vi In python script, "asyncio" package must be used and the python function must use async. ("def" method for Call Py Method.vi and "async def" method for Call Async Py Method.vi) To add function arguments before calling methods, please use Add Argument.vi before calling functions

To get the return data, please use the following vis after calling functions:

Pop_Return_Object.vim
Pop_Return_Object x2, x3 and x4.vim

pykit-for-labview.lvlib:Call Async Py Method.vi
pykit-for-labview.lvlib:Call Async Py Method.vi
type
descriptions
cdatavalrefPykit Session In
specifies a reference to the Python session.
cstrMethod Name
specifies the name of the Python async function to call. (async def $Method Name)
The async function name should be asign in the imported py script.
cfxdtArgument Object In
contains the arguments of the function. If the Python function does not have parameters, leave Argument Object In unwired.
cerrcodeclsterror in
error in can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.
Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
type
descriptions
idatavalrefPykit Session out
returns a reference to the Python session.
ifxdtArgument Object Out
contains the return data of the Python function. If the Python function does not return any value, leave Argument Object Out unwired.
ierrcodeclsterror out
contains error information.
Last update:
Contributors: ZHUO DIAO