RobG3D Posted December 5, 2022 Share Posted December 5, 2022 I am receiving an error 165 - something like can't read please try again. I have a python loop continually polling so reading again isn't the answer. It was working then quit, and then works and quits. I have cycled power. Thanks Link to comment Share on other sites More sharing options...
0 Fausto Posted December 5, 2022 Share Posted December 5, 2022 Hello @RobG3D. Are you developing with MCC's Universal Library on a Windows system? Below is error code 165 as shown in the Universal Library Help. https://www.mccdaq.com/pdfs/manuals/Mcculw_WebHelp/ULStart.htm Does your application work if you decrease your loop rate? What other steps do you have between each data read? Regards, Fausto Link to comment Share on other sites More sharing options...
0 RobG3D Posted December 5, 2022 Author Share Posted December 5, 2022 It is a Windows Application. I believe I got the python example and modified. So I assume it is the Universal Library, but if you tell me how to check I will. It has been running (a few times a week) since October. I am reading every 1/2 second in a thread: def _GetValues(self): while 1: self.value[0] = ul.t_in(self.board_num, 0, TempScale.CELSIUS) self.value[1] = ul.t_in(self.board_num, 1, TempScale.CELSIUS) self.value[2] = ul.t_in(self.board_num, 2, TempScale.CELSIUS) self.value[3] = ul.t_in(self.board_num, 3, TempScale.CELSIUS) self.value[4] = ul.t_in(self.board_num, 4, TempScale.CELSIUS) self.value[5] = ul.t_in(self.board_num, 5, TempScale.CELSIUS) self.value[6] = ul.t_in(self.board_num, 6, TempScale.CELSIUS) self.value[7] = ul.t_in(self.board_num, 7, TempScale.CELSIUS) time.sleep(0.5) # 2 samples per second The main code then calls: def Read(self): return self.value Link to comment Share on other sites More sharing options...
0 RobG3D Posted December 6, 2022 Author Share Posted December 6, 2022 I just noticed the can happen during device initialization. So I went to see how far the initialization gets. My module is self testing meaning I have a default main that test the functions of the module. I ran the module standalone and it read temperatures. Well the computer had been rebooted. So I tried the failing code that tries to monitor several different sensors - it failed with error 165. Standalone reported 0 C temperature - don't recall if it had an error. Pulled the USB cable from the USB-Temp, ran the stand alone module and got temperatures. So apparently something in the monitoring program may have changed. The scripts have been stable since October. Can you give me any clues what might cause the USB-Temp to fail when part of a larger picture? If I programmed what I thought I did there is no difference with the way USB-Temp is being accessed between the two programs. Thanks Link to comment Share on other sites More sharing options...
0 Fausto Posted December 6, 2022 Share Posted December 6, 2022 @RobG3D, From your description, it appears your overall application is calling on the USB-TEMP at different times and possibly stepping on itself. I would suggest trimming your application or reverting back to the basic examples. It does not sound like a hardware issue, but more of a programming conflict. Link to comment Share on other sites More sharing options...
0 RobG3D Posted December 7, 2022 Author Share Posted December 7, 2022 I admit the code may not be perfect, but there is only one initialization. The initialization starts a thread the read twice second. I thought I avoided being in the read and having a second call, but maybe I missed something. And it ran for a month and half; then started failing almost constantly. My current thought is a Windows update issue; this machine has had trouble with updates in the past. Thanks for your help; when I find the issue I will try and remember to report back. Link to comment Share on other sites More sharing options...
Question
RobG3D
I am receiving an error 165 - something like can't read please try again. I have a python loop continually polling so reading again isn't the answer. It was working then quit, and then works and quits. I have cycled power.
Thanks
Link to comment
Share on other sites
5 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