Daqfactory Program Stops Responding


alkaram

Recommended Posts

Hello,

 

I've been using DAQFactory for over a year to monitor and control a bioreactor growing algae. 

 

I've written sequences to do all the logging and also error handling. I don't use many try-catches but I have secondary scripts in place to make sure solenoid valve doesn't stay opened longer than its specified time. Usually when an error occurs, the script just stops running. But this time, the whole program froze when the valve was open and we killed our culture by saturating it with CO2. 

 

I briefly saw the error message in the output and should have taken a screen shot but did not. I had never seen the error message that was output; it said something about an issues writing data from one of our channels and something about a file name. 

 

Is there anyway I can check the logs to determine what happened?  I really want to make sure this error doesn't happen again. 

Link to comment
Share on other sites

  • 2 weeks later...

Its really hard to say since the script you wrote could have easily caused the freeze.  The most likely cause is that you have a loop without any delay() that's running at priority 5.  It may not be completely obvious where it is if your application is more complex, but I do commonly see it when people forget to put the delay() outside their catch:

while(1)
   try
      // a bunch of code
      delay(1)
   catch()
   endcatch
endwhile

If there is an error in "bunch of code", it will jump to the catch, and immediately loop around, skipping the delay.  Presumably the error is still there, so the loop runs at full bore and starves out the CPU.

 

Anyhow, take a close look at your script and think about all pathways and make sure infinite loops have some sort of delay.

 

I should also add that you should never rely on software to do safety checks.  If the loss of your culture was just a little inconvenient, then no worries, but in cases where failure of the software could cause significant expense or worse, injury, it is very important to have external safeties in place that do not run through the software, or any logic at all really.  This is true no matter what software tool you use, not just DAQFactory, and includes PLC's too.  Yes, PLC's are generally more reliable than a PC based tool, but they are still just a computer and they do fail.  They don't fail as often because they are only doing one thing, but they still fail and you should never run safety systems through a PLC either.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.