PC-Crash while running Daq Factory Runtime


christian

Recommended Posts

hi

I've some trouble with my monitoring system. We use DF with a LJ U12 to monitor our production lines.

here is the link to my former topic.

http://www.azeotech.com/board/index.php?showtopic=1838

I us the newer driver version but the problem still exists.

The new idea is about the hardware.

We use a dual core Pentium processor.

Are there any known problems with DF and such PC-Systems

the attachted file includes the exact configuration of the system.

thanks for any ideas or solutions

christian

Link to comment
Share on other sites

So are you having the same problem, or is the PC now crashing? Does it crash at a particular spot? How does it crash? Blue screen? hang? Message? These will give me clues as to what is causing the crash.

DAQFactory does not have any problems with multi-core or multi-processor systems. In fact, as a very multi-threaded application is will take full advantage of as many processors as you throw at it, and was developed entirely on multiprocessor machines.

Link to comment
Share on other sites

The PC crashes often after some hours without showing any systematic ore a special spot. I get no blue screen, the software just hang up, DF gives also no error codes (I log them) until it hangs.

The system offers enough power; we checked this by CPU usage and the ram-usage

thanks christian

Link to comment
Share on other sites

OK, so you are saying that DAQFactory stops responding, but the rest of windows is still running. This could be caused by some problems in your document. Can you please attach your .ctl document so we can review? If you don't want to make it publically available, go to www.azeotech.com and the contact page and post it their so it goes direct to us. We no longer post email addresses because of spam crawlers (which has gotten horrific, as I'm sure you know), which is the only reason I'm not simply giving you my email address here.

Link to comment
Share on other sites

OK, we received the file through the AzeoTech support center and taken a quick look. Before I jump into the problem, I'm afraid I have to give a short lecture. I don't like to do this because the customer is always right, but it is globally acknowledged among programmers that not following good code indenting is very bad. It makes code very difficult to read. I very strongly encourage you to gain that habit and use it, especially since you are writing more than just a few lines of code. Not only will it allow other people to help you debug your code, but in a few years when you go back and review the code yourself, you'll have a much easier time figuring out what you did.

I should add, though, that if you see code on a web page (or our help system, which is HTML, though I believe we have it all proper), it may not be properly indented. This is because of the way HTML parses spaces, making it somewhat more difficult to indent using normal HTML. You can type in code indented, but HTML displays it incorrectly. This forum does a pretty good job with it, provided you remember to put a CODE block around it. DAQFactory, however, provides lots of good tools to help with indenting, such as the ability to select a block of code and hit Tab or Shift-Tab to indent / outdent.

That all said, most likely your problem is that you are using the wait() statement instead of the delay() statement. As it says in the documentation, and should even warn you about in more recent releases, the wait() statement should only be used in very specific circumstances and can cause hanging if used improperly. This is because the number inside the wait (i.e. wait(3)) is the maximum wait time, not the absolute wait time. The actual wait time can be much shorter, even 0, if there are delays elsewhere. If your loops are running slow, the wait will go to 0 and then chew up 100% of your processor time since you effectively have an infinite loop with no pauses to allow other parts of DAQFactory to run. An infinite sequence running at priority 5 will run above the user interface priority and so can make DAQFactory appear hung.

So, try changing all your wait() statements to delay() and that most likely will fix the problem.

For those wondering why there is even a wait() statement, its to allow for loops that run at an exact time interval. So:

while (1)
   .. do something
   wait(1)
endwhile

will cause the loop to run every second no matter how long "do something" takes, provided its less than wait amount, in this case 1 second. If you instead did:

while (1)
   .. do something
   delay(1)
endwhile

the loop will run at more than a second, actually the sum of 1 second (the delay) and the time it takes to "do something". As I said, the problem with using wait() is that if "do something" gets delayed for more than a second, the wait() will not wait at all, trying to catch back up with the proper loop interval, and can cause DAQFactory to hang. This is why you should never use wait() with serial/ethernet communications, and really only with devices that always respond quickly (like PCI cards). The more recent versions of DAQFactory will warn you not to use wait() the first few times when you apply sequence code that contains a wait().

Link to comment
Share on other sites

I used the "wait()"statement because understood it in this way, that using this statement gives me always the same time for the sequence. I planed to have sequences that takes always the same time becaus I was afraid of missing a change of my signal.

I will use the delay() and try it. I will post it if the system runs

thanks christian

Link to comment
Share on other sites

Well, good. I'm glad you understand wait(), and you should definitely migrate back to it once you get the system stable. However, I still recommend you switch to delay(), at least temporarily, to see if this is the problem. You have a lot going on in your code and the wait()'s might not be acting the way you think. Switching to delay() is the easy fix. If it doesn't work, we can take a closer look at your document.

Unlike Windows, which seems to think that all their users are incapable of properly using a computer (and many are incapable), and thus simply keep you from doing things so you don't get yourself in trouble even if you know what you are doing (my recent favorite is that you can't share the program files directory, even if you are logged in as an admin), DAQFactory gives you complete flexibility, but with it, comes the possibility to create scripts that actually cause DAQFactory to hang. The two most common ways are:

1) creating infinite loops at priorities at or above User Interface, without the proper delay to allow the GUI to run

2) putting code in component actions, or starting functions from the command line that are not quick (I even forget this second one sometimes :). This is because the code runs in the GUI thread and so the GUI stops while the code runs, meaning DAQFactory appears hung. Screen refresh is part of the GUI too.

Link to comment
Share on other sites

1) I've a question: what do you mean with GUI?

2) I've changed all my wait() statements into delay and tried it but the result was the same. the software hang up. I logged the time when this happens it seems not to be in a critical phase like sequence-start.

could it be that the delay times are to short they range between 0.09s and 1s.

I tried to make the code a bit easier to read and attached it once more.Maybe you have any other ideas about my problem.

runtime.zip

Link to comment
Share on other sites

It appears you are having trouble attaching files. Here are a few things to try:

1) Zip up your file.

2) After browsing and selecting the file, make sure you click the add attachment button before you submit your post. After you click add attachment, you should see your draft, still in edit mode, but you should see that it shows the file attached towards the bottom.

3) Try a different browser. We all use current versions of Firefox.

Link to comment
Share on other sites

Archived

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