21 views
in Embedded Wizard Studio by

Hi Team,

I need to support diagnostics popup screen, which shows diagnostic detail information as a dynamic string based on the received diagnostics code via CAN message. For example if I received fault code as "1" then then text 1,2,3 has to be updated with respective fault code information in each line(refer sample image below).

ZZ - received fault code

XX - current fault code number

YY- Total fault code received

Text 1- Fault text line 1

Text 2- Fault text line 2

Text 3 - Fault text line 3

 

Thanks in advance for your support.

1 Answer

0 votes
by

Hello,

in your application case you receive message from the CAN bus. Now you want the messages to be passed to the GUI application. The question is, what should be passed to the GUI application? The numbers or the corresponding strings?

The following sections provide the general information how to implement an interface between the GUI application and the device (e.g. CAN BUS):

Implementing a Device Interface

Implementing a Device Interface: Property

Implementing a Device Interface: Property Observer

Using the above mentioned properties you can transfer data values between device and GUI application. With the Property Observer you can react to changes of the values, and for example update the GUI, etc.

If you plan to prepare the string in advance (outside the GUI application), see the section Be careful when exchanging strings. Then you can manage a property in the Device Interface representing the latest message as string.

Alternative approach would be to implement in the Device Interface methods to query the fault codes, etc. See Implementing a Device Interface: Command. To receive notifications when new fault codes are available you could use System Event and the associated System Event Handler.

I hope it helps you further.

Best regards

Paul Banach

by

Hi Paul, 

Thanks for you response smiley

We have already supported CAN interface with embedded using device interface. Now we are working on showing strings dynamically based on fault code id and we need multi language support too.

So, I want to know how use/extern Strings::id generated in strings unit using Strings1.xls file and use in the application .c file to map the fault code id with strings id.

Thanks

by

Hello,

I would recommend following approach:

Step 1: Manage all strings within the Embedded Wizard project. For this purpose each string is represented by a constant member. The name of the constant identifies the string. Each string can contain several language dependent variants. When using *.xls files the constants are automatically generated.

Step 2: Don't use the strings from the .c code. This means, don't map the fault code to a string and pass the string from the .c code to GUI application.

Step 3: Instead, pass the fault code id to the GUI application. In the GUI application use the fault code id to select the right string constant. For this purpose create a switch-case statement matching all possible faul code ids to constants containing the corresponding error messages. This could be the switch-case implementation:

var int32  faultCode = ...
var string faultString;

switch ( faultCode )
{
  case 1  : faultString = Strings::SomeMessage1;
  case 2  : faultString = Strings::SomeMessage2;
  ...
  case N  : faultString = Strings::SomeMessageN;
  default : faultString = Strings::AllOK;
}

This mens: in the Device Interface implement an interface to transfer the fault code ids (as numbers, e.g. int32) between the device and the GUI application. In the GUI application evaluate the fault code id and select the appropriate string constant.

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...