Author Topic: Displaying a descriptionj string based on SPN/FMI error code  (Read 3304 times)

Offline spittet

  • PLUS+1 Guru
  • *****
  • Posts: 116
  • Karma: +6/-1
Displaying a descriptionj string based on SPN/FMI error code
« on: October 06, 2020, 04:16:41 AM »
Hi,

My customer would like the "Error Description" to be displayed next to the "Error Code" when a SPN/FMI J1939 diagnostic code is displayed on the display screen.

I'm using the "DM1_Rx" function block to retrieve the SPN/FMI codes and it is really easy to display the SPN/FMI codes and go through all the active codes.

I'm also using the "Fault Manager Library" to create my own machine related SPN/FMI code. I can display/go through them in the same manner as the DM1_Rx function block qui easily.

Now, how could I display an error description based on a specific SPN/FMI code?

I know I could do it using the a String type variables with boolean switches and hard-coded String constants, but this would not be fun to do for the 1000s of SPN/FMI codes that exists in J1939 standard. I think a database would be require to be efficient. Let say that I would have access to a such a database (Excel file???) where a column would contains the wanted String, how could I use this data in GUIDE?

Is it feasible? Did you ever do something similar? Any help would be appreciated.

Have a good day!

Sam

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 214
  • Karma: +7/-0
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #1 on: October 06, 2020, 06:02:16 PM »
Hey Spittet
I have done something similar, but I did create my database, I do not see any application where you will require all the J1939 possible SPN, but I could be wrong.

So my advise is use a MODULE for the database, it works better since the DTC is not always present.

The data base I did is for common stationary engines where you do not have a transmission J1939 enabled or additional modules like in a tractor.

But could give you an idea about how to do it

I hope it helps

Regards


if this works it means it does not let me upload pictures, I was attaching some screen shots

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 214
  • Karma: +7/-0
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #2 on: October 06, 2020, 06:05:51 PM »
mm something odd is happening when trying to upload pictures it just does not work, however the systems tells me it is already replied..

I do not see my 1st reply to this message so just in case

Hey Spittet
I have done something similar, but I did create my database, I do not see any application where you will require all the J1939 possible SPN, but I could be wrong.

So my advise is use a MODULE for the database, it works better since the DTC is not always present.

The data base I did is for common stationary engines where you do not have a transmission J1939 enabled or additional modules like in a tractor.

But could give you an idea about how to do it

I hope it helps

Regards

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 325
  • Karma: +7/-0
    • Marbek Elektronik
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #3 on: October 12, 2020, 01:00:02 PM »
Perhaps by using text-arrays?
I use them for print out text to a RS232 plotter in 16 languages. One text line is one array.
I have an excel sheet and I copy the constants in the array txt-file.

Or using pictures? With text?
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline AlbertMilani

  • PLUS+1 Developer
  • ***
  • Posts: 12
  • Karma: +0/-0
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #4 on: February 06, 2023, 04:14:35 PM »
@pinias
Could you elaborate on your MODULE?

@Anybody
1. Does anyone know of a MODULE tutorial?  Are they like POUs?
2. I was thinking of making a c file that has my database as an initializer to a structure, and then accessing it through a C POU.
 The table would be something like this:
Code: [Select]
struct dtc_list
{
   unsigned int dtc;
   unsigned int fmi;
   unsigned int pcode;
   char *desc;
};

dtc_list[] =
{
    { 1234, 3, 202, "Peu36 Space modulator voltage high" },
    { 222, 1, 123, "Intake air pressure sensor voltage high" },
...
};

Albert
   

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 214
  • Karma: +7/-0
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #5 on: February 07, 2023, 12:16:14 AM »
Albert,

this is from the advanced class, basically you start with the creation of the module on the project manager, see pictures attached.

now this was when working with the DP6xx displays.

I not longer decode the SPN or add a text about what it is-at all- , the operator now opens a PDF file with the SPN explanation on the display.  turns out I had to work with European  engines and they have tons of SPNĀ“s so the easy and most effective way to let the operator know about the issue is by allowing him to consult the PDF

what display are you working with?  perhaps you can use the pdf viewer also

I hope this helps

Regards

Offline AlbertMilani

  • PLUS+1 Developer
  • ***
  • Posts: 12
  • Karma: +0/-0
Re: Displaying a descriptionj string based on SPN/FMI error code
« Reply #6 on: February 09, 2023, 03:32:42 PM »
@pinias:
My display is a DM430E-0-0-0-0.  I don't see how I could display a PDF on it.

I'll take a look at your ideas soon.

Thanks!
Albert