Hi,
Oh!, thanks for your long answer full of questions :-). I have tried to answer all your questions.
>>1. The CodeError.jpg file says that 4 errors occured, but it's scrolled down to the last two. What were the first two errors?
These are the same errors, exactly the same: LabWindows fails in a NON-FATAL RUN-TIME ERROR and ask to me if I want or . The same error item at "Run-Time Errors Window" appears each time I click on , until I click on . (At this example I clicked on three times and then once on
>>2. You say you can't acquire more than 3 channels. Do you know that the problem is the total number of channels and not just the channel number? Have you tried talking to channel 0x7 first to see if that works?
Yes, I thought that maybe the board documentation was wrong, and I tried exactly you say. The channel acquisition order was 7, 4, 5, 6. It failed at channel 6 then.
>>3. Have you looked at the return value of P100X_AdsPolling()? E.g.
WORD wPollingResult;
>>...
>>wPollingResult = P100X_AdsPolling(poll, 20);
I have looked at this now, and the result is always 0, that corresponds to P100X_NoError (p100X.h)
>>5. Have you tried casting 20 as WORD or passing a WORD rather than a constant?
I have tried both of them: casting 20 as WORD
- (WORD) 20
and passing a WORD constant,
and the result is the same.
>>6. Have you stepped through the for loop where the error occurs and watched the value of i and average?
>>7. What is the value of times when the error occurs?
Yes, it stop at first, when the i value is 0 and average is 0.000. I mean that NEVER does the operation inside
(average+=poll[i]/20) correctly
Furthermore, I say NEVER because times has the value of 1.
>>8. Do you know if you need any delay between talking to channels?
The documentation board doesn't point this feature, and I think that it would be something so important that it would point this if the feature would exist.
Anyway, I send you board library documentation in pdf.
>>9. Are you sure that you're not polling too fast on every EVENT_TIMER_TICK?
Do you mean that, probably, the acquisition is very slow and labwindows try to launch another EVENT_TIMER_TICK before that previous acquisition finishes?
I think it isn't, because I put the Timer Control interval at 5 seconds, and the problem not disappears.
>>4. Have you stepped into P100X_AdsPolling? Do you know that it's not corrupting memory?
How can I know this?
Remmember that I can run the same project with LabWindows 5.5 but not with LabWindow 6.0.
Any idea/question more?, thanks again.