Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T7 eRead Command Triggers Disabled State #24

Open
bhathawayML opened this issue Dec 18, 2024 · 1 comment
Open

T7 eRead Command Triggers Disabled State #24

bhathawayML opened this issue Dec 18, 2024 · 1 comment

Comments

@bhathawayML
Copy link

I am communicating with a T7 LabJack device. I want to simply read the state of a pin, but while doing so this triggers the state of said pin. In the example below, I set pin MIO0 to True (validated with a vacuum line), then read the state using ljm.eReadName (same behavior with ljm.eReadAddress). This returns TRUE, however I can hear the vacuum line being disabled. When I call this same function again, it returns False and the vacuum remains disabled.

I hope I am not missing something obvious here. Any help/advice is much appreciated!

Versions: PyCharm 2023.3.7, Python 3.10, labjack-ljm 1.23.0

from labjack import ljm

device_sn = "470031969"
pin_name = "MIO0"

# Open device
try:
    device = ljm.openS("ANY", "ANY", device_sn)
except ljm.ljm.LJMError:
    raise Exception("No device detected!")

# Set pin status
ljm.eWriteName(device, pin_name, True)

# Get pin status
state = ljm.eReadName(device, pin_name)
print(bool(state))  # True

# Get pin status again
state = ljm.eReadName(device, pin_name)
print(bool(state))   # False

# Close device
ljm.close(device)
@ljrob
Copy link

ljrob commented Dec 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants