in System Integration by

Hello EW Team, I am working on a project in which I have to plot a graph for which co-ordinates are sent from custom hardware. The plot scenarios are something like this:

1. My plot area in GUI is set to 400px and I am plotting upto 380px for visibility.

2. As soon as I cross 380 px, graph starts scaling, keeping the left axis constant, new values are added at the right side.

3. After sometime, I start scrolling my graph for every newly added value, for which I calculate the pixelpervalue and subtract the same from plot to add new value.

All these steps are successfully implemented. My query is:

Query 1: I am sending 2 values, X and Y from my device. Each time I receive a new value of either, Graph updates.

Eg: Coord1 - (1,2), next Coord2 - (2,4), next Coord3 - (3,4) and so on.... Number of nodes that update is "5" because in Coord3 I have same value of Y as in Coord2. So how is the plotting done? Is Coord1 plotted twice and Coord3 plotted once? I am sharing small section of my output which includes our print statement also (Xcoord is multiplied by 100 for better visibility), Note the section of Node 104, in which current Y is same as Previous Y Co-ordinate:

In updateProg_Counter;
Xcoord = 2.550000, Ycoord = 39.811569
EB3403C S       C01,P02,PRP,ET 2.549999 sec,T 7.449999 sec,P 39.81156 psig
trace: "x= ", 255.0, "y= ", 79.623138, " NodeNo= ", 100
trace: "x= ", 255.0, "y= ", 79.623138, " NodeNo= ", 101

In updateProg_Counter;
Xcoord = 2.600000, Ycoord = 39.811508
833503C S       C01,P02,PRP,ET 2.599999 sec,T 7.400000 sec,P 39.81150 psig
trace: "x= ", 260.0, "y= ", 79.623016, " NodeNo= ", 102
trace: "x= ", 260.0, "y= ", 79.623016, " NodeNo= ", 103

In updateProg_Counter;
Xcoord = 2.650000, Ycoord = 39.811508
493603C S       C01,P02,PRP,ET 2.650000 sec,T 7.349999 sec,P 39.81150 psig
trace: "x= ", 265.0, "y= ", 79.623016, " NodeNo= ", 104

In updateProg_Counter;
Xcoord = 2.700000, Ycoord = 39.811459
323703C S       C01,P02,PRP,ET 2.700000 sec,T 7.300000 sec,P 39.81145 psig
trace: "x= ", 270.0, "y= ", 79.622917, " NodeNo= ", 105
trace: "x= ", 270.0, "y= ", 79.622917, " NodeNo= ", 106

QUERY 2: When I re-plot the scaled or scrolled path, some line appears to change color and width. Please ignore the colors, as RGB format is different as used in EW and our code. But the doubt is that main graph is expected to have same color throughout the test (Yellow as per current Video), and it seems to be Yellow-Green-Yellow and plz observe the changes in Line Width. And last, do you observe flickering effect in vertical lines used as separators? Why is that happening? 

Here is the video: VID20230112152615.mp4

Thanks & Regards,

Vandana Matai

1 Answer

0 votes

Hello Vandana Matai,

concerning the first query, if I understood your question correctly, you wonder why some values appear twice. If this is the case, I suppose the values are added twice. The path implementation will not double the values by itself. Please review your implementation once more.

Concerning the second query, I suppose the problem is related to the display. Please see the Embedded Wizard logo. It appears with poor quality. Some pixel seem to be shifted. What HW are you using?

Best regards

Paul Banach


Hello Paul,

I understand that Path doesn't double the values itself, but my concern is something else. Please see the code below, I am calling the function updateProg_Counter(X,Y) and giving Coordinates as parameters to plot. Here, X is multiplied by 100 as already mentioned. This Xcoord and Ycoord are parameters for respective functions defined in DeviceDriver_ProcessData(). As soon as Xcoord gets some value, respective function is called and Variable needUpdate updates the graph. Now after that Ycoord gets some value, respective function is called and Variable needUpdate updates the graph. So, this way 2 times values are updated. Now for me, X is timer so it will be updated for sure, but Y is some Pressure value, which may or may not update (remain constant). So, what should be done? Is there a way to pass two parameters and plot? 

void updateProg_Counter(float xc, float yc){
	Xcoord = xc*100;
	Ycoord = yc;
	printf("\nIn updateProg_Counter;\n");
	printf("Xcoord = %f, Ycoord = %f\n", Xcoord/100,Ycoord);
	//printf("EwMaxIssueTasks = %d\n", EwMaxIssueTasks);

int DeviceDriver_ProcessData( void )
  int needUpdate = 0;

     Get the data you want to provide to the GUI application.
     In case your are working with an operating system and your device is
     controlled from a separate task/thread/process, take all information
     from your device driver out of the message queue.
     Please note, that this function is called within the context of the main
     GUI thread.
     If you control your system by direct register access or some BSP functions,
     get all necessary data you want to provide to the GUI application.

  #ifdef _ApplicationDeviceClass_

	#ifdef _ApplicationDeviceClass__UpdateX_

    ApplicationDeviceClass__UpdateX( DeviceObject, (float)Xcoord );
    needUpdate = 1;


    #ifdef _ApplicationDeviceClass__UpdateY_

    ApplicationDeviceClass__UpdateY( DeviceObject, (float)Ycoord );
	 needUpdate = 1;


	if ( DeviceObject == 0 )
    return 0;
  return needUpdate;

}//ProcessData ends

QUERY 2: Yes, pixels seem to be shifted. But does that effect the color and line width? Or flickering observation? (I will update you with HW details soon, as this is just testing device, not the final one).



Vandana Matai


Hi Vandana Matai,

ok, if I understood it correctly, the problem is caused because the X and Y values are passed in separate invocations. The X value is passed via UpdateX() invocation and Y value via UpdateY(). If this assumption is correct I would recommend to replace the both methods UpdateX() and UpdateY() by one common method named e.g. UpdateXY()

When you edit the DeviceClass you can add new methods and modify the declaration and implementation of other methods existing already in the class. For example, the section Update multiple Properties using a common UpdateProperty() method demonstrates this application case with the values voltage and current being passed at once via single Update() invocation.

Is this the solution you are looking for? I have to admit, I'm not sure if I'm understanding the problem correctly. Possibly the problem is more logical nature. You write: "As soon as Xcoord gets some value, respective function is called and Variable needUpdate updates the graph. Now after that Ycoord gets some value, respective function is called and Variable needUpdate updates the graph. So, this way 2 times values are updated". Since the X and Y values are treated separately such implementation could provoke an incoherence between the X and Y values. I would cache X and Y value and trigger the update only when both have been received.

Concerning the second query, when I watch the attached video it looks for me as if data destined for pixel A and data for pixel B are mixed or exchanged. This may cause the pixel to appear bigger (line width changes) or it may produce unexpected colors (e.g. when only one color channel (red, green or blue) of pixel A affects pixel B. Possibly there is some short circuit in your HW in the wires connected to the LCD? Have you eventually implemented your own routine to copy the framebuffer contents? If yes, review the routine. The problem can also occur when copying the pixel information.

I would recommend to test the HW using a simple application composed of solid red, green and blue rectangles. Using this application you test whether the rectangles do appear correctly. Then you can create a second application containing rectangles filled with color gradient. Are the gradients displayed correctly? You can compare the resulting image on the LCD with the image presented in Embedded Wizard.

Best regards

Paul Banach

Hello Paul,

You understood it perfectly. Exactly that was my question "Is there a way to pass two parameters and plot? ". When you say, " I would cache X and Y value and trigger the update only when both have been received.", might create a problem, what if Y axis holds the same value as last one, and X gets updated? As I mentioned above, Coord3 holds same value of Y as in Coord2. I want Coord1, Coord2, Coord3 etc to plot as it is. And do not ignore if one or both value remains same as previous one. I'll try to pass two values simultaneously and update the result here.

Regarding HW issue, we'll get a new one and run simple example of solid RGB colors to test and verify, as you suggested.

Thank you,

Vandana Matai

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