-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comments
Hello,
The registers which interact with a single IO will automatically set the
direction. So reading from "FIO3", "DIO3", EIO3, "DIO11" etc. will set the
corresponding IO to input. When writing, it will set the IO to output.
In your program. During the first read, the IO gets set to input. It reads
high because the line needs some time to transition to low. When the second
read occurs, the line has transitioned low and reads as such.
You can use DIO_STATE to get the states of the lines without affecting
direction. Another option is to only read from input lines and only write
to output lines.
For full details see the DIO section of the docs:
https://support.labjack.com/docs/13-0-digital-i-o-t-series-datasheet
Kind regards,
Steve
LabJack Support
***@***.***
LabJack Corporation
6900 W JEFFERSON AVE STE 110
LAKEWOOD CO 80235-2335
V:(303)942-0228
How did we do?
Great / Okay / Not Good
<https://docs.google.com/forms/d/e/1FAIpQLSfkvhb7q6YtG-fovIkV9xUABP6f4kfsZQpTetmHzw-yHLu3cA/viewform>
…On Wed, Dec 18, 2024 at 3:51 PM Brooke ***@***.***> wrote:
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)
—
Reply to this email directly, view it on GitHub
<#24>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHTFXXUQPRW733ZFOBP5AD2GH4ATAVCNFSM6AAAAABT3WSZPSVHI2DSMVQWIX3LMV43ASLTON2WKOZSG42DQOBZGM4TSNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: