Hi there, I am using the Python library mcculw on a Windows 10 mcahine. I am using the USB 231 DAQ.
I want to have a feature in my software which can show whether the connection to DAQ is alive or not.
So, I thought of a polling method like this:
def get_daq_status_str(self):
'''
Print status of daq every 1 second
'''
while True:
status = ul.get_status(self.board_num)
if status == Status.IDLE:
print('Status: Idle')
elif status == Status.RUNNING:
print('Status: Running')
else:
print('Status: Error')
time.sleep(1)
But from the docs I read that, all that ul.get_status() does is "Returns the status about the background operation currently running". So, I don't think it will work for my use case (since I am not transferring any data).
So, what function can I use for this purpose?
Apart from this, my application has to do usual a_out_scan() to send out voltages. So, as far as I can see, I must run this status check (polling method) in a separate thread, so that any other DAQ operation remains unaffected.
Question
Sid_1
Hi there, I am using the Python library mcculw on a Windows 10 mcahine. I am using the USB 231 DAQ.
I want to have a feature in my software which can show whether the connection to DAQ is alive or not.
So, I thought of a polling method like this:
But from the docs I read that, all that ul.get_status() does is "Returns the status about the background operation currently running". So, I don't think it will work for my use case (since I am not transferring any data).
So, what function can I use for this purpose?
Apart from this, my application has to do usual a_out_scan() to send out voltages. So, as far as I can see, I must run this status check (polling method) in a separate thread, so that any other DAQ operation remains unaffected.
Edited by Sid_15 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now