Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Unrecoverable Error w/ Timed Loop

When I use a timed loop I get an "Unrecoverable Error" (status light on FP-20xx blinks four times) after compile and run - although not immediately. When I replace the timed loops with regular while loops everything is o.k.

TommyH
0 Kudos
Message 1 of 8
(4,241 Views)
Hi TommyH,
The first thing that I would do is make sure that you are using the 1Khz clock source and not the 1Mhz source. The compact FieldPoint controllers only have a 1Khz clock. Next, I would suggest simplifying your code to do something very simple like add 2 numbers together and see if you still get the error. This will determine if the error is coming from the code within the timed loop or the timed loop itself. If you try these things and still can't determine the source of the error take a screenshot of your block diagram and attach it to the next post.

Best Regards,
Brooks W.
National Instruments
0 Kudos
Message 2 of 8
(4,224 Views)
I believe the problem lies when the loops are late. It appears as though the IA Control Environment is also a factor w/ or w/o the timed loops.
0 Kudos
Message 3 of 8
(4,212 Views)
Hi TommyH,
What do you mean by "the IA Control environment is also a factor w/ or w/o the timed loops?" What happens when the loop is late? Do you automatically get the "unrecoverable error" and if so how do you know that the loop being late caused this? Have you tried running some simplified code to determine if it is the code, or the loop that is causing the problem? Please paste a screen shot of the block diagram into the next post. Please give me as much information as possible as this will help me to give you better direction.

Best Regards,
Brooks W.
National Instruments
0 Kudos
Message 4 of 8
(4,203 Views)
Well, I know the loops are late and yes, it is only due to my code within. Of those items in my code are flash drive writes. Also, I am using the Field Point Read function which I believe may be creating the output array on each cycle. I can get the same error to occur with regular while loops by shortening the Wait Until Next Multiple time.

I guess I am not really being that clear. I am new to the embedded platform and sometimes don't knnow enough to ask the right question in the right way.

TommyH
0 Kudos
Message 5 of 8
(4,200 Views)
Hi TommyH,
Thanks for the information. I understand that all this stuff can be a little overwhelming. That's OK. We'll get through it.

Sounds like this is a case of the code not being able to execute within the allowed amount of time. So, in this case I would suggest not using the timed loop because the code will not be able to execute within 1ms. I would suggest using the regular while loop and using a wait until next millisecond multiple timer. You will need to experiment with the code to determine how long to wait. Give this a try and let me know how it goes.

Best Regards,
Brooks W.
National Instruments
0 Kudos
Message 6 of 8
(4,199 Views)
Good advice. I adjusted the thread priority and used the regular while loop with "Wait Until Next Mult." and things seem to be working fine now. I am on to discovering/fixing oter problems.

Thanks,
TommyHelter
0 Kudos
Message 7 of 8
(4,194 Views)
Hi TommyH,

I'm glad that this worked for you. Please feel free to make other posts if you run into other problems. We will be happy to help you.

Best Regards,
Brooks W.
National Instruments
0 Kudos
Message 8 of 8
(4,186 Views)