Re: Try/Catch
- Posted by jimcbrown (admin) Jan 07, 2015
- 5837 views
I don't understand where your experience comes from.
My experience comes from working 10 hours a day since I was 14 years old.
Relevance?
And I still think that your last answer is avoiding my question.
I don't know how to make it any clearer - try/catch became popular among novice programmers because it appeared to be easier.
If that doesn't answer your question, please restate it.
Any sane human being knows that ANY machine, including PLC, can fail. And in the PLC area there are many methods and backups for this case, yet accidents happen, and yet many programmers and electricians are careless.
I am offering here to consider error handling from a different point of view.
You seemed to be saying that in PLC programming, one was not suppose to use a concept like try-catch in PLCs.
I don't know why computer program has to break its own logic and fall into a dangerous game of throw and catch. In more critical programs, such as PLC programs, this considered to be the most non-robust behaviour.
That's why there is no "fatal error" in PLC, since PLC should never stop its operation.
I just pointed out that this is wrong, and PLC programming often makes use of the try-catch concept (albeit under a different name).
Take it or leave it.
Excuse me of being rude, but I wonder where your experience comes from.
From actually working with PLC code.