Announcement

Collapse
No announcement yet.

string object will only display 75 characters???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • string object will only display 75 characters???

    I Have been working with the uLCD-32-ptu with a raspberry pi host. On one form i have the raspberry pi reading from a text file into a char array and then writing this array to the String0 object on the LCD. On another form i Have a keyboard object which reports its key presses to the rpi, the rpi then stores these key presses in a char array and prints this char array to the String1 object.

    The problem is that the string will only display up to 75 characters and if the text file exceeds 75 characters the String0 object disappears altogether. The String1 object just stops displaying new key presses.

    Any idea how to fix this and/or increase the number of characters that can be displayed?

    (note: there is still plenty of space for new charaters to be displayed on the string object.)

    Thanks in advance for any help.

  • #2


    Hello,

    Section 2.1.3.3 Write String (ASCII) Message

    of the ViSi-Genie Reference Manual

    http://www.4dsystems.com.au/downloads/Software/4D-Workshop4-IDE/Docs/ViSi-Genie/Visi-Genie-Reference-Manual_R_1_06.pdf


    Description:

    A place holder for ASCII string objects can be defined and created in the Genie project. In order to display a dynamic string, the host can send this Write String (ASCII) message along with the string object index and then the string to be displayed. The maximum string length is 80
    characters.

    Message length = 4 bytes + the number of string characters (including the null terminator).

    Max message length = 4 bytes + max number of string characters + null terminator

    80 = 4 + max number of string characters + 1

    max number of string characters = 75


    Any idea how to fix this and/or increase the number of characters that can be displayed?
    Perhaps you can add more string objects? And then program your Pi to write to the next string object if the first string object has already received 75 bytes.

    Hope this helps.
    Doff

    Comment


    • #3


      This could work except when a person hit the character limit mid sentence. The broken text would be very...weird, for lack of a better word. Is there no way to increase this limit? a 75/80 character limit seems a bit arbitrary to begin with.

      Comment


      • #4
        Well, I don't know about arbitrary, but it is a trade off. Too high and you will not be able to do 'other things' in Genie due to lack of RAM. Too low and you will not be able to enter a 'reasonable' amount of text.

        So what is too low? Most input fields seem to allow 25 to 30 characters per field, so our arbitrary value of 75 is 3 times the regular minimum or just over twice the regular maximum. 75 is also 'closer' to a screen width of characters, although given the range of fonts and sizes, and screens and orientations and sizes, just what is a 'screen width'.

        If you really need more and are happy with the implications, here's what to do.

        Edit C:\Program Files\4D Labs\4D Workshop 4 IDE\Genie\PICASO\p1.inc with a text editor and change 'CMDLenMAX' (~line 26) to a higher value.

        When you rebuild your Genie application the new value will take affect.
        Mark

        Comment


        • #5


          Ok i get what rou are saying about the ram n stuff. Basically this field should be able to hold enough characters for a short message. I feel that 75 is a bit too short. An sms length message of about 240 characters should be enough. What i want to know is that if i edit the file so that 240 is the limit, could the lcd handle this and most importantly could this do any hard to the lcd. Thank you

          Comment


          • #6


            Changing it to 240 should be fine for your purposes. You can't 'hurt' anything and hopefully you wont miss the 'lost' RAM.
            Mark

            Comment


            • #7


              I tried editing that value and i made it 245. Problem is the screen still won't display more than 75 characters, if i try the string variable doesn't update and goes blank. Furthermore the other forms stop working as well. Am i doing something wrong or is there another place i need to edit?

              Comment


              • #8


                Ouch, the fees of not testing something

                You will also need to change the following

                p2.inc and change the size of 'comRX' (~line 6) from 40 to 123.
                p4.inc and change the second parameter to 'com_Init' (~line 6) from 80 to 245.

                Then it should work fine.
                Mark

                Comment

                Working...
                X