<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/</id><updated>2020-05-19T00:59:42.943000Z</updated><subtitle>Recent posts to Application Error Design Pattern</subtitle><entry><title>Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/?limit=25#e7de" rel="alternate"/><published>2020-05-19T00:59:42.943000Z</published><updated>2020-05-19T00:59:42.943000Z</updated><author><name>mr337</name><uri>https://forge.codesys.com/u/mr337/</uri></author><id>https://forge.codesys.comb3e576518570680ae288f08d2ac5ff758a84ab2e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;So funny enough we had another ECU device that started having issue. The vendor broke down the DM messages for us and sounds like I'll be deep diving on the DMs one way or another as I missed this during implementation.&lt;/p&gt;
&lt;p&gt;From the responses it sounds like either 1003h array or DMs are the way to go. I appreciate the responses!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/?limit=25#4fa7" rel="alternate"/><published>2020-05-17T16:16:41.520000Z</published><updated>2020-05-17T16:16:41.520000Z</updated><author><name>sgronchi</name><uri>https://forge.codesys.com/u/sgronchi/</uri></author><id>https://forge.codesys.com2bc4114c3a806237cbc891bb7be0594ad4c36cce</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes, in fact I talk about a projection of the various faults to the fieldbus.&lt;br/&gt;
If you have e.g. a CANopen network you can also project the fault bits onto 1003h array in object dictionary and send one or more EMCY message(s) in an independent program (better than mapping faults onto two, three or more fieldbuses in the same program).&lt;br/&gt;
I talked about DM1 because the OP talked about reporting errors via J1939, but the approach is fieldbus independent.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/?limit=250#3f96" rel="alternate"/><published>2020-05-16T23:04:03Z</published><updated>2020-05-16T23:04:03Z</updated><author><name>aliazzz</name><uri>https://forge.codesys.com/u/aliazzz/</uri></author><id>https://forge.codesys.comb731c0aeb003a17e51bbe350db8afe7e3185b499</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe it is even better to think of a fieldbus independent error diagnosis?&lt;br/&gt;
In theory the fieldbus type itself is not important.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/?limit=25#e6fa" rel="alternate"/><published>2020-05-16T21:52:02.853000Z</published><updated>2020-05-16T21:52:02.853000Z</updated><author><name>sgronchi</name><uri>https://forge.codesys.com/u/sgronchi/</uri></author><id>https://forge.codesys.comb803f407a7df0abd8da6237f66d4f68f2f071f14</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'd not use a global error variable. Each fault should have its fault bit with its own resetting/acknowledging logic.&lt;br/&gt;
Since you mention J1939, have you thought of implementing a DM1/DM2-like system?&lt;br/&gt;
With a program (not a FB) executed after the logic, you "project" the fault bits (that could be global or local) into a DM1 list and then send it as per J1939 customary.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Application Error Design Pattern</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/456ae589e3/?limit=25#5899" rel="alternate"/><published>2020-05-16T17:23:54.083000Z</published><updated>2020-05-16T17:23:54.083000Z</updated><author><name>mr337</name><uri>https://forge.codesys.com/u/mr337/</uri></author><id>https://forge.codesys.com86b7c47d350518b38cace56dedeea50229eafbc4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;New Codesys user seeing if anyone has a good design or pattern for handling application specific errors to be sent over canbus/j1939 for notification to the user. Application errors such as e-stop engaged, voltage not in bounds, or circuit disconnected etc to help inform the user what is wrong.&lt;/p&gt;
&lt;p&gt;Possible Requirements:&lt;br/&gt;
1. Persistent till error condition clears up in the event a high priority message on the bus comes in&lt;br/&gt;
2.  Only have to be one error code at a time, variable error list would be nice :)&lt;/p&gt;
&lt;p&gt;Few things I have thought:&lt;br/&gt;
1. Have a global error code variable that any FB can set. Issue is spreading error code in every other FB to handle that making the code a mess.&lt;br/&gt;
2. Think I saw a mention of having an Error FB to add or remove errors as they come up. I guess a FB would have a input for every FB it would support? Not for sure how to cleanly implement this as each FB would need to continously update the error FB when an error condition occurs or is cleared. OR have some kind of timer for each error code so if the source FB doesn't post an error, it will timeout and clear itself. This already sounds complicated!&lt;/p&gt;
&lt;p&gt;These options so far don't feel like they pass the sniff test so far or I may be crazy. Anyone has a better design to share?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>