Announcement

Collapse
No announcement yet.

not working communication by terminal

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • not working communication by terminal

    Hi,
    I have problem
    if executed program for example hello word
    I dont can by terminal clear screen - code ff82 (gfx_Cls),
    if I use terminal after if spe program executed, its working
    I undestand need activate com port you can look program

    #platform "Gen4-uLCD-43D"
    #inherit "4DGL_16bitColours.fnc"

    func main()
    var bufcom ;
    gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change

    print("Hello World") ; // replace with your code
    com_Reset();
    com_Init(bufcom,100,0);
    com_SetBaud(COM0 , 960); // To set Com
    //com_Count();
    repeat // maybe replace
    forever // this as well

    endfunc

    dispay sk-ge4-43d-sb connected to pc via gen4-pa by usb
    thanks
    Last edited by Andreyka; 2 weeks ago.

  • #2
    Hi,

    Welcome to the forum,

    There are several environments in which you can program/control the display.

    Designer and Visi don't have any in-built serial handling so any Serial control handling would need to be programmed by yourself in 4DGL code.

    Visi-Genie and Serial SPE have built in Serial handlers and both work differently.

    The command you are sending via the Terminal ff82 (gfx_Cls) will only be recognised by Serial SPE.

    When you create a Designer, Visi or Visi-Genie program the Serial SPE code that is pre-loaded into the display will be overwritten by the new project code and Serial SPE will no longer be installed to receive serial commands.

    You can re-install the Serial SPE code by creating a new project, then choose Serial as the programming environment. Next click on the Tools tab and then click on SPE Load.
    After the display has finished the SPE Load it will show the splash screen as when you first had the display and you can then use the terminal to send serial commands to the display.

    I hope this helps

    Best regards

    Paul

    Comment


    • #3

      Paul thanks for the answer.
      I have a project in which at the initial loading of the graphical menu the photos are loaded from the usd and then I need
      from an external microcontroller to clear the screen and download the data to the display. the question at the same time on GEN4-PA RX and TX are always active to receive data transmission or do I need to activate TX RX. thanks
      PS if you need code for first graphical menu I can Send
      and my first graphical menu I can loaded to flash and each time program mounted automatically


      Last edited by Andreyka; 2 weeks ago.

      Comment


      • #4
        Hi,

        As an example using your Hello World

        Code:
        #platform "Gen4-uLCD-43D"
        #inherit "4DGL_16bitColours.fnc"
        
        func main()
        var bufcom[50] ;
        gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
        
        print("Hello World") ; // replace with your code
        com_Reset();
        com_Init(bufcom,100,0);
        com_SetBaud(COM0 , 960); // To set Com
        //com_Count();
        repeat // maybe replace
        
          if(com_Count() > 1)
            var rx1, rx2;
            rx1 := serin();
            rx2 := serin();
            if(rx1 == 0xff && rx2 == 0x82) gfx_Cls();
          endif
        
        forever // this as well
        
        endfunc
        This may not be ideal as you would have to add code to decode the serial commands for each function you want to achieve.

        Comment


        • #5
          Paul Thanks
          Its work
          the question at the same time on GEN4-PA RX and TX are always active to receive data transmission or do I need to activate TX RX.

          Comment


          • #6
            Hi Paul,
            I changed my program
            I can mount logo from uSD to displat by com
            My questions I can open file other program from uSD and use it
            for example i write program for menu in DESIGNER and if compiled ( but where this file compiled) I can open exe file or other for this program from uSD and use com port to send data to menu

            Comment


            • #7
              SHOW LOGO BY COM PORT in display SK-GEN4-43D-SB
              HEX TO SEND EXPLICATION directive original info
              0xFF82 CLEAR SCREEN gfx_Cls() 0x06
              0xFE3C FILE MOUNT from uSD file_Mount() 0x063EF5
              0x000A file open V1.TXT file_Open("v1.txt", 'r')
              0x5631 (V1) code ASCII for letters
              0x2E54 (.T) code ASCII for letters
              0x5854 (XT) code ASCII for letters
              0x0072 r read only 0x063EC8
              0x0009 load image control v1.DAT v1.GCI file_LoadImageControl("v1.dat", "v1.gci", 1)
              0x5631 (V1) code ASCII for letters
              0x2E44 (.D) code ASCII for letters
              0x4154 (AT) code ASCII for letters
              0x0056 ( V) code ASCII for letters
              0x312E ((1.) code ASCII for letters
              0x4743 (GC) code ASCII for letters
              0x4900 (I ) code ASCII for letters
              0x0001 1 1 repondre for this 0x063D99 (hndl)
              0xFE83 image show with answer img_Show(hndl,0)
              0x3D99 this data from answer before
              0x0000 0x0601E0


              this program work in terminal no problem
              Last edited by Andreyka; 1 week ago.

              Comment


              • #8
                Hi Andreyka,

                Its great to hear that it is working.

                Yes this is possible. The Serial environment you are using has a command called file_Run() which will load an executable file from the SD card into RAM and then run it. The command can be found on page 119 in the manual.

                When using Designer, the compiled executable file can be found in the same directory as the project is saved in with a .4xe extension. This can be very useful when your display boots up in Serial waiting for a command to run a program.

                I hope this helps.

                Best regards

                Paul

                Comment


                • #9
                  Thanks Paul,
                  I will look this

                  Comment


                  • #10
                    Hi Paul, its not working
                    in page 120
                    File Mount command:
                    cmd(MSB), cmd(LSB)
                    0xFF, 0x03 - but file mount command 0xFE 0x3C
                    Response:
                    0x06 0x15 0x43 ( ACK, Status(MSB), Status(LSB) ) - in there ack all time only 0x15


                    my file exe is AD.4XE
                    I send to com (by terminal exactly
                    FF03


                    0021
                    0000
                    4865
                    6C6C
                    6F20
                    576F
                    726C
                    6400
                    ACK 010E

                    000D
                    4144
                    2E34
                    5845
                    0000
                    0300
                    0A00
                    0A00
                    0A01
                    0E


                    0022
                    010E



                    and my program it designer is

                    #platform "Gen4-uLCD-43D"


                    #inherit "4DGL_16bitColours.fnc"

                    /*Differents constants for global use*/
                    #CONST //Start Constantes
                    Zz 0xF9D0 //Color RED used for default Background
                    #END //Finish constantes
                    func main()
                    gfx_BGcolour(Zz) ; //Background color -default for change go to MyFunction.fnc >constant
                    gfx_Cls(); //Clear Screen to default background

                    /*----------------------window SETUP--------------------------------------------------------------------------------*/
                    gfx_Panel(1, 4, 2, 150, 50, BLUE); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(3); //Set the text height multiplier
                    gfx_MoveTo(20,10); //Move to a new pixel location (x,y)
                    txt_BGcolour(BLUE); //Color background for text
                    print("S E T U P"); //Message


                    gfx_Panel(1, 200, 2, 200, 50, ROSYBROWN ); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(216,13); //Move to a new pixel location (x,y)
                    txt_BGcolour(ROSYBROWN); //Color background for text
                    print("C E L L s O N / O F F"); //Message
                    gfx_MoveTo(405,13); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Put text same background
                    print(" push\n30s+SETUP"); //Message


                    /*-----------------------window DATE-TIME and message to choice it--------------------------------------------------*/
                    gfx_Panel(1, 2, 62, 110, 40, GREEN); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(10,70); //Move to a new pixel location (x,y)
                    txt_BGcolour(GREEN); //Color Background for text
                    print("DATE - TIME"); //Message
                    gfx_MoveTo(115,70); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Put text same background
                    print("push 30s"); //Message

                    /*------------------------window TEST LCD and message for choice it---------------------------------------------------*/
                    gfx_Panel(1, 2, 104, 110, 35, GRAY); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(10,110); //Move to a new pixel location (x,y)
                    txt_BGcolour(GRAY); //Color Background for text
                    print("TEST L C D"); //Message
                    gfx_MoveTo(115,110); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push 60s"); //Message

                    /*------------------------window TEST KEYs adn message for choice it--------------------------------------------------*/
                    gfx_Panel(1, 2, 141, 110, 35, BROWN); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(10,148); //Move to a new pixel location (x,y)
                    txt_BGcolour(BROWN); //Color Background for text
                    print("TEST K E Y s"); //Message
                    gfx_MoveTo(115,146); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push 600s"); //Message

                    /**************************window TEST PRINT and message for choice it------------------------------------------------*/
                    gfx_Panel(1, 2, 178, 110, 40, BLACK); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(10,185); //Move to a new pixel location (x,y)
                    txt_BGcolour(BLACK); //Color Background for text
                    print("TEST PRINT"); //Message
                    gfx_MoveTo(115,178); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push PRINT\nbaud rate\n115200"); //Message

                    /*-------------------------window TEST t'C and messge for choice it--------------------------------------------------*/
                    gfx_Panel(1, 2, 220, 110, 40, CHOCOLATE); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(10,225); //Move to a new pixel location (x,y)
                    txt_BGcolour(CHOCOLATE); //Color Background for text
                    print("TEST t'C "); //Message
                    gfx_MoveTo(115,224); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push\n30s+60s"); //Message

                    /*---------------------------window INFO and message for choice it----------------------------------------------------*/
                    gfx_Panel(1, 230, 62, 110, 40, CORNFLOWERBLUE); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(233,70); //Move to a new pixel location (x,y)
                    txt_BGcolour(CORNFLOWERBLUE); //Color Background for text
                    print(" I N F O"); //Message
                    gfx_MoveTo(350,70); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push 30s+600s"); //Message


                    /**************************window LANGUAGE and message for choice it-------------------------------------------------*/
                    gfx_Panel(1, 230, 104, 110, 40, BURLYWOOD); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(238,109); //Move to a new pixel location (x,y)
                    txt_BGcolour(BURLYWOOD); //Color Background for text
                    print(" LANGUAGE"); //Message
                    gfx_MoveTo(350,107); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print("push 60s+600s"); //Message

                    /*-------------------------window Advanced Mesurement and message for choice it-------------------------------------*/
                    gfx_Panel(1, 230, 150, 110, 70, DARKORANGE); //Panel window - 3d; x,y-position; width; height; color;
                    txt_Height(2); //Set the text height multiplier
                    gfx_MoveTo(238,159); //Move to a new pixel location (x,y)
                    txt_BGcolour(DARKORANGE); //Color Background for text
                    print(" Advanced\nMesurements"); //Message
                    gfx_MoveTo(350,157); //Move to a new pixel location (x,y)
                    txt_Height(1); //Set the text height multiplier
                    txt_BGcolour(Zz); //Color Background for text
                    print(" push\n600s+SETUP"); //Message

                    /*-------------------------Message for EXIT and background different------------------------------------------------*/
                    gfx_MoveTo(238,240); //Move to a new pixel location (x,y)
                    txt_Height(2); //Set the text height multiplier
                    txt_BGcolour(MEDIUMAQUAMARINE); //Color Background for text
                    txt_Set(TEXT_COLOUR, DARKBLUE); //Color for text
                    print(" For EXIT push SETUP+60s "); //Message
                    txt_Set(TEXT_COLOUR,LIME); //Return to default color text

                    //Finish function

                    repeat // maybe replace
                    forever // this as well

                    endfunc

                    hOW IS PROBLEM
                    THANKS

                    Comment


                    • #11
                      OO ITS WORK
                      THIS PROBLEM IN File Run command
                      000D
                      4144
                      2E34
                      5845
                      0000
                      0300
                      0A00
                      0A00
                      010E

                      THANKS SOLVED

                      THIS OTHER PROBLEM COMMAND FF82 CLEAR SCREEN IS NOT WORK WHY COM PORT NOT WORK AFTER EXECUTING FILE


                      Last edited by Andreyka; 1 week ago.

                      Comment


                      • #12
                        Hi Andreyka

                        Glad to hear you got it working.

                        The reason for this is that when the Designer code is running, the serial environment is no longer running even though the com port is still available and the designer program is stuck in a repeat forever loop.

                        You could try commenting out this

                        repeat // maybe replace
                        forever // this as well

                        And try it to see if it returns after drawing on the screen.

                        Best regards

                        Paul

                        Comment


                        • #13
                          This same problem its not work

                          Comment


                          • #14
                            Ok,

                            I initially thought that you were using serial to launch an executable and it would continue to run the executable but looking at it, File_Execute may be more suitable.

                            Could you please take a look at file_Execute in the same manual on page 121.

                            Best regards

                            Paul

                            Comment


                            • #15
                              OK I CHECKED WITH 2 VERSION (WITH
                              repeat // maybe replace
                              forever // this as well
                              AND NO
                              FILE IS NOT EXECUTE
                              IN CODE TO COM DIFFERENT ONLY File Execute command USED 0X0004

                              Comment

                              Working...
                              X