alpaym Posted December 22, 2009 Share Posted December 22, 2009 We're trying to run life-tests on five shutters using LabJack U3-LV and DAQFactory Express. The sequence is fairly straightforward: * Set a digital output that serves as the command signal to all shutter drivers to open all shutters. * Wait for the output to be set properly (this is done by feeding the digital output back into a digital input port and using the "waitfor()" statement) * Wait an additional 200 msec * Assign the latest internal & external shutter states to local variables - basically, each shutter has an internal optical sensor, and I also have an external sensor to go along with that, both of which are connected as digital inputs * Check for any mismatches between the commanded and actual shutter states (internal and external). If such an "error" condition is detected, increment an internal counter and "export" the data for that particular cycle. * Also record the entire data set (= commanded as well as sensed shutter states for all shutters) in a separate data file. (I use direct file access rather than "export" for this one, as I found it to be a more reliable way of getting data stored at high rates!) * Wait an additional 300 msec. * Repeat the same cycle as above, with shutter command set to zero (to close all shutters) The whole thing is wrapped within "for" loops, so we cycle the shutters by a pre-determined number of cycles. At the end, we also "export" a summary of the findings - total number of cycles, total number of shutter errors observed, etc. I have attached the .ctl file so that you can see all the gory details. As for the problem: it looks like this sequence "hangs up" after 10-15 minutes of operation. As far as we can tell, the hang-up is happening while we are "waiting for" the command (feedback) sense to get to the correct state - as a matter of fact, when we comment out the "waitfor()" statement as in the attached version of the .ctl file, it looks like the hang-up problem disappears - but we also start detecting a lot of mismatches between commanded and actual shutter states, and I have a hard time believing these errors are "real"! (see below for why) I ran virtually the same sequence before successfully (WITH the waitfor() statement in it, too!) for >1 million cycles without any problems/errors. The only difference between now & then is that I'm now trying to replicate the same experiments for 5 shutters simultaneously, but things seem to be falling apart, and I cannot quite tell why :-( We have tried this with two different computers, and using different UD driver versions (3.06, which was the original driver included in the LabJack CD, and 3.15 which we downloaded from the web last night), and it seems to do the same in either case. We increased the sampling period for all signals from 10 msec to 20 msec, and that did not seem to make a difference, either. DAQ FactoryExpress version is 5.79A. Any suggestions??? Shutter_Test_Mehmet.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted December 23, 2009 Share Posted December 23, 2009 Well, the first thing to do is to reproduce the hanging sequence, then actually look at the condition and see if it is in fact what you think it should be. In other words, does Shutter_Cmd_Sense[0] == 0? You can tell by going to the command alert window and typing: ? Shutter_Cmd_Sense[0] == 0 if it says 0, then the waitfor() is working properly (assuming we're hanging at the first waitfor()) and the issue is that either the channel never went to 0, or it went to 0 faster than the waitfor() could detect. This second one could possibly happen if Shutter_Cmd_Sense only goes to 0 for one reading. Since your waitfor() has the same loop interval (0.02) as the timing interval on the channel, its possible that the waitfor() could actually miss it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.