01-25-2012 09:59 PM
harry,
Now that we can see more of your code (NICE clean-up but it is not quite "software" yet but, "functional code" is worthwile)
If you replaced an old tradtitional DAQ "Wait +(mS) with CCI Delay.vi you are golden. The old DAQ "Wait (mS).vi does have a known issue of entering an infinate loop when the millisecond timer rolls over.
A millisecond timer is just what it sounds like- It counts the number of milliseconds since the core was restarted up to the maximum value of a 32 bit signed integer (about 49 days) and then it starts at 0 again. So if you start a wait for "x" mSec after Rollover-"X mSec before" rollover you can't get there (And Wait (mS).vi never exits) You have seen this before! Wait (mS) is the exact same code when compiled as a C "Sleep" instruction. Your IT dept will tell you to log off at the end of the day (and they will push "Fixes" that force a reboot at least once per month) so you never see this in managed IT environments.
Coffee smells wonderful! unless it is poured hot into your lap. sorry you got burned
01-26-2012 04:29 PM
Lynn, you are definitely correct about improving my program architecture. Apparently I need learn more to be able to do something like you mentioned. Thanks for your suggestions!
Harry
01-26-2012 04:31 PM
Raven Fan,
Thanks for your example! I already removed the tick count functions based on other suggestion, that's why you didn't see it. Thanks!
Harry
01-26-2012 04:39 PM
Jeff,
Thanks for your explaination. Yeah I agree this is definitely not a software, but rather just a piece of code. I'm happy as long it works! 🙂
Anyway I will take this as my fix for now and will update you guys next couple of months how it goes. Hopefully I don't have to report the same problem again...
Rgds,
Harry
01-27-2012 10:20 AM
Jeff,
I still kind of wonder why this timer issue can cause my Analog Inputs not working. When the problem occurs, all the Analog Inputs show "N/A" instead of current values (when operating normally, the values shown range from 4mA to 20mA). Does this make sense to you? Why no error message shows up? Any thoughts?
I just want to rule out all possbilities (probably not gonna happen but at least i tried). Thanks!
Rgds,
Harry
01-28-2012 11:31 AM
Lookong deaper there may be other issues. If Wait +(ms) hung the while loop would not iterate at all
On the oter hand if that AI task is contiouos acquisition you could get to a point where your buffer overflows you might not notice the error since your error is on a tunnel and not a shift register.
01-30-2012 08:51 AM
Jeff,
So for #1, the CCV delay vi should take care of the issue, right?
For #2, I didn't quite get it. Is there a fix for that?
Thanks
Harry
01-30-2012 09:32 AM
@Harry.W wrote:
Jeff,
So for #1, the CCV delay vi should take care of the issue, right?
For #2, I didn't quite get it. Is there a fix for that?
Thanks
Harry
Is th AI Read Contineous? or is it configured to read x number of samples then STOP acquiring until you ask for more?
01-30-2012 09:33 AM
Jeff,
"Overflow" scares me! How can I avoid the potential buffer overflow you mentioned here? Or is there a way to monitor buffer usage?
Do you mean I should put the error aslo as a shift register? Initially I don't even have a shift register for the task but someone suggested me to put there saying it will make sure I read and write the most latest data.
Forgiving my ignorance, but wouldn't shift register keeps storing more and more data? Do i really need it?
Thanks!
Harry
01-30-2012 09:36 AM
Jeff,
At the moment, I actually read only 10 number of points each cycle. I thought the old version I used default value "-1" which should acquire 100 points every time.
Harry