Skip to main content

a python interface to remote LabVIEW controls

Project description

lv-linkpy

a python interface to remote LabVIEW controls.
Python version above 3.6 is required.

This package depends on Pykit for LabVIEW, a LabVIEW addon. For more information, please see Pykit for LabVIEW documentation.

Installation

  • pip install lv-linkpy

Register the control on LabVIEW

Usage

Create a session

from lvlinkpy import Session
s = Session(1919)

Check control references

s.print_control_info()

This code will print all control references outline which are registered on LabVIEW.

Get control value

User can get the value from the name of the control. Suppose there is a control called "Boolean" in the LabVIEW.

print(s.get_value("Boolean"))

If the control name is incorrectly given, it will raise an error.

s.get_value("fdzggZWSdgs")

Set control value

User can set the value by the name of the control. Suppose there is a control called "Boolean" in the LabVIEW, this code will set the control value to "True".

s.set_value(valueName="Boolean", value=True)

This package will perform type check before send to LabVIEW. So, If user send a string to a bool control, it will raise an error.

However, ignore_check=True can avoid type check on python. It may lead an error on LabVIEW.

s.set_value(valueName="Boolean", value="string")
s.set_value(valueName="Boolean", value="string", ignore_check=True)

mechaction=True argument can activate mechanical actions of the control. (for example firing an event case)

s.set_value(valueName="Boolean", value=True, mechaction=True)

Notice that, a button-like latch action is not supported. If you want to activate an event case of a button, you can add a hidden boolean to the target event case structure on LabVIEW.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lv-linkpy-1.0.3.tar.gz (50.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page