No announcement yet.

4dVISI Display issue

  • Filter
  • Time
  • Show
Clear All
new posts

  • 4dVISI Display issue

    Hello,I am making a display module using uLCD43-PT and the new VISI program to communicate thru serial to an automotive ECU (megasquirt) and display a series of gauges.
    I have 15 gauges that I am allowing the user to scroll thru. All of them are the same exact style, but display a different variable and have a different min/max.
    I have created all of my gauges and written most of my code. When I load the latest dat & gci file to the SD card and download the latest program, my gauges do not show up correctly. some gauges display differently than others too. I didn't seem to have this problem when I was only using a few gauges, but now that I have finished all the gauge setups and am calling for most of them I seem to have issues.
    What I want:
    What I get:
    Any help would be appreciated!!Attached is the .4dg file along with the visi file (as a text)Note:Right now I am only calling for the "LEFT" gauges. I do have a few buttons and "RIGHT" gauges I have not called for yet. Please excuse my poor excuse for programming. Attached files Final_program_1-15-12.4dg (8.2 KB) visi_file.txt (94.4 KB)

  • #2

    Seems to be an issue when the values are not integers. Why does that cause the display to mess up? do I need to round all my variables before I use them in a gauge?


    • #3

      Not sure exactly what you are trying to say, but here goes.

      There are no real numbers in 4DGL, only Integers.

      When you specify a decimal in a gauge it treats an integer as if it had that many decimal places.

      Eg if decimals was 1 and the number was 16 then the value displayed on the gauge would be 1.6


      • #4

        As for the display issue,

        Which PmmC are you using?

        Can you zip up the .4dg, .4dvisi and .imgdata folder and its contents and attach them?


        • #5

          alright. I fixed all my gauge values to integers as a test and I am still having problems on a few of the gauge displays. I have no idea why the gauge doesn't display correctly.
          What causes the gauges to display incorrect like the picture in the original post?


          • #6

            Here are the files.

            Attached files (59.3 KB)


            • #7

              Well, the first 'funny one' is the Left_AFR. You have set it to the constant value of rpmBY10 which you have set to 500.

              There are only 11 Left_AFR values, image indexes 0-10 corresponting to values 10 to 20.

              So by setting it to 500 you have gone way past the end of Left_AFR, so what you are seeing is an attempt to display the 500th element, so that's why it looks wrong


              • #8

                My Left_AFR is set to the constant value of egoActual, not rpmBY10.
                else if (LeftGaugeSelect ==6) img_SetWord(hndl, iLeft_AFR, IMAGE_INDEX, egoActual); img_Show(hndl, iLeft_AFR);// Left Gauge 6 AFR
                I am going to go through all of my gauges and make sure that I am not out of the set range.


                • #9

                  I have removed all the code pertaining to serial communication and fixed all the gauges to a set value to test this issue.
                  I am still seeing issues on the following gauges:Left_AFRLeft_AFRTargetLeft_EgoCorrectLeft_Warmup
                  See the attached folder for all of the latest files. I have no idea where the problem is. Attached files (57 KB)


                  • #10

                    Did you think about what I was trying to say here

                    There are only 11 Left_AFR values, image indexes 0-10 corresponting to values 10 to 20.
                    You need to remove the 'zero offest', so the following fixes your problem.

                    egoActual :=18-10; // problem
                    afrTargetActual :=15-10;// problem
                    egoCorrection :=100-80;//problem
                    warmupEnrich :=100-100;//problem

                    It might be clearer to subtract the zero offset in the img_SetWord statement, it's up to you.


                    • #11

                      Ohhhhh. Ok I didnt get how the code functions. You dont call for the real value, you call for the image index.
                      Thank you VERY VERY much for all of your support. Everything else is so well documented with 4dsystems. I am looking forward to seeing better documentation for the VISI system in the future.