No announcement yet.

4DGL - Flash size - Read from MMC

  • Filter
  • Time
  • Show
Clear All
new posts

  • 4DGL - Flash size - Read from MMC

    Hi i am new at 4DGL. I have a uLCD-32PT display and i was using it whit SGC commands but i see you can do a lot more whit GFX LCD and get free the microcontrollator from a lot of work. I think the program is written in the Picasso Flash which size is 12K, how much program i can write in 12K, i have to do a complex interface whit a lot of menus and the LCD will take information through the UART from the microcontroller i dont know if i can write all the program in the LCD and the workshop doesnt tell me how much memory i am using at the moment.
    Can i save the program in the MMC instead of the Flash and execute it as an script? Is the same an script and a program writed in the Flash?
    Thanks you

  • #2

    When you compile the compiler tells you how much memory you have used, eg

    No Errors, code size = 2958 bytes (15360 available).

    Most programs easily fit in the available space, but, if, as you say, you need a complex interface, you may need to make use of file_LoadFunction, file_Run and/or file_Exec, which is for running programs / subroutines / functions from MMC


    • #3

      This commands according to the manual read a program from the MMC and save it to RAM and then execute it from the RAM, what happend if the program is larger than the RAM size? It automatically copy pieces of the program and execute it or generates an error? Can an script do all the things a 4DGL program does? It would be great to implement something like an script but for 4DGL but no copying to RAM, the program execution will be slower but it will allow user to generate larger interfaces.
      PD: for some reason workshop only show me the program size when i compile a script, but when i compile a 4DGL program it only shows No Errors


      • #4

        If the program is too big for RAM it reports an error.

        Sorry, (SGC) Scripts and 4DGL programs are two different things, you either sue one or the other, they cannot be intermixed.

        Have you done much 4DGL programming? I think you will be surprised at how much you can do before running out of RAM.

        when i compile a 4DGL program it only shows No Errors
        Can you paste a screenshot showing that? It doesn't make sense


        • #5

          Here are the shots. It doesnt show the memory i am using but if i compile a script it shows me the memory.

          Attached files .jpg]


          • #6

            Drag the splitter bar up a bit


            • #7

              What is the splitter? Sorry i still dont know all the english languaje. Here is other shot.
              PD: to execute a program in the MMC i just need to use file_Run("myprogram.4XE,0")? And then to exit from the program i called just go to the end of main() or execute ProgramExit()?
              Thanks you Attached files .jpg]


              • #8
                In the 4DGL example right down the bottom left it says '0 errors'. Above that is the splitter bar. Click on it and drag it up.

                HAve a look at some of the samples, eg PICASO GFX2\PICASO - LOADFUNCTIONTEST\LoadFunctionTest.4dg, File PICASO GFX2\PICASO - GENERAL\FAT16runprog.4dg and File PICASO GFX2\PICASO - GENERAL\FAT16runprog.4dg

                There are others as well, use the string search program of your choise to find them


                • #9

                  Hooooo thanks you very much i can see now the memory!! I will see the example programs thanks you very much


                  • #10

                    I'm looking in the IDE for the compiler report on what memory I have left, and I don't see it. The status bar shows "0 errors" on a good compile, but nothing else.

                    Where can I get this report from the WorkShop IDE ?
                    Roger Taylor


                    • #11

                      Workshop 3 is split into two windows. The code window is at the top. A smaller window is at the bottom and shows the compile information. These two windows are split by a splitter bar which can be dragged up or down to see more or less of the compile status window.It shows the following for every compile:0 errors
                      0 warnings
                      0 notices
                      No Errors, code size = XXXX bytes (15360 available)

                      If there are errors it will show these in detail.

                      If you can only see the first line then drag the splitter bar up the screen to show the rest of the information.

                      When Workshop compiles your program, say MyProgram.4dg
                      , it creates other files while compiling. These are placed in the same directory as the program. Look at the MyProgram.aux
                      file, it contains more detailed information about the memory allocation in the program.


                      • #12

                        Hi! Why suddenly i cant see the compiler info anymore? It doesnt show me the memory and errors :S

                        Attached files


                        • #13

                          I think you can cause this by changing the screen size to be smaller than the position of the line whilst workshop is not running. Thought it was fixed but it turns out the fix isn't perfect.

                          To fix it fire up regedit whilst Workshop isn't running, navigate to HKEY_CURRENT_USER\Software\4DLabs\Workshop and change the value of Splitter to be a smaller number (say 100 hex)



                          • #14

                            Thanks it worked perfectly