So verwenden Sie den Touchscreen

Jun 09, 2021

Eine Nachricht hinterlassen

So verwenden Sie den Touchscreen:
    The touch area control is combined with the button control. According to the user's button control settings in the supporting software, when the user clicks on the button touch area, the user can specify the connection to the next page, send the control ID number or send the coordinate value. When the user clicks in the non-button touch area, the man-machine interface terminal will not perform any operation.
    When sending the control ID number, the first 2 bytes are "FC FC" as the data frame header, indicating that the data sent is touch screen data, and the next 2 bytes are the control ID number, with the low byte in the front and the high byte in the back .
    When sending coordinate values, the first 2 bytes are "FE FE" as the data frame header, indicating that the data sent is touch screen data; the last 4 bytes are touch screen x and y coordinate data, the x coordinate is in the front, and the y coordinate is in the back , The same low byte is in the front and the high byte is in the back.
    In the case of multi-layer display, the touch zone control operation page defaults to the page of the last call operation. At this time, if you want to activate other pages, use the 1B 33 command to change the operation page.
    There is a mouse display at every point on the touch screen. If you do not want to display it, you can use the command 1B 30 00 FF FF EE FF to turn off the display.
    Touch screen mode selection command
    Format: Hexadecimal code: 1B 20 MODE FF FF EE FF
    Explanation: 1B: is the command frame header, 20: is the command. MODE: is the mode selection value, a BYTE.
    FF FF EE FF is the end of the frame.
    MODE: 0x00: Single-point trigger, that is, when the touch screen is pressed until the touch screen is lifted, only the touch screen pass code value is sent once, and there is no code break when it is lifted.
          0x01: Single-point trigger, that is, when the touch screen is pressed until the touch screen is lifted, the touch screen pass code value is sent only once, and when the touch screen is lifted, a broken code is sent.
              If it is set to return the control ID number in the property settings of the upper computer button control, the broken code is: FC F0 ID; ID is a WORD, and the low byte is in the front and the high byte is in the back.
              If it is set to return the coordinate value of the current click in the property settings of the upper computer button control, the broken code is: FE F0 X Y; X and Y are both a WORD, and the low byte is in the front and the high byte is in the back.
         0x02: Indicates continuous triggering, that is, after pressing the touch screen, the touch screen value will be sent continuously until it is lifted, and there is no code break when it is lifted. The time interval between each group of touch screen data sent can be controlled by commands. For details of the command, please refer to "Send Touch Screen Data Time Interval Setting Command".
         0x03: Indicates continuous triggering, that is, after pressing the touch screen, the touch screen value will be sent continuously until it is lifted, and a broken code will be sent when it is lifted.
              If it is set to return the control ID number in the property settings of the upper computer button control, the broken code is: FC F0 ID; ID is a WORD, and the low byte is in the front and the high byte is in the back.
              If it is set to return the coordinate value of the current click in the property settings of the upper computer button control, the broken code is: FE F0 X Y; X and Y are both a WORD, and the low byte is in the front and the high byte is in the back.

    The time interval between each group of touch screen data sent can be controlled by commands. For details of the command, please refer to "Send Touch Screen Data Time Interval Setting Command".
    Example: Select the touch screen mode as single-point trigger without sending the code break value (initialize to this mode): 1B 20 00 FF FF EE FF
           Select touch screen mode as single point trigger with broken code sending value: 1B 20 01 FF FF EE FF
           Select the touch screen mode as continuous trigger without sending broken code values: 1B 20 02 FF FF EE FF
           Select the touch screen mode as continuous trigger with broken code sending value: 1B 20 03 FF FF EE FF
           Note: The user sends the "touch screen mode selection command" to the man{{0}}machine interface. The man-machine interface only executes without saving the mode value. When the man-machine interface is reset and restarted, the touch screen mode value will be restored and initialized. The default mode value of the touch screen is 0x00 during initialization. , That is, single-point trigger, no broken code will be returned when lifted. User CPU control needs to send this command every time it is turned on.

    Send the touch screen data time interval setting command
    Format: Hexadecimal code: 1B 21 time FF FF EE FF
    Explanation: 1B: is the command frame header, 21: is the command. time: Time interval value, with 20MS as the unit, a WORD, low byte in front, high byte in the back. FF FF EE FF is the end of the frame.
    The initial interval value is 20MS. This time interval is valid only in the continuous trigger mode of the touch screen, and invalid in the single-point trigger mode.
    Example: Set the touch screen data sending time interval to 40MS: 1B 21 02 00 FF FF EE FF
    Note: The user sends "touch screen data time interval setting command" to the man-machine interface, the man-machine interface only executes without saving the interval time value, when the man-machine interface is reset and restarted, the touch screen mode value will be restored to initialization, and the touch screen data time interval during initialization For 20MS. This command is valid only after the user selects the touch screen as the continuous trigger mode. When the single-point trigger mode is selected, this command is invalid and does not need to be used. User CPU control needs to send this command every time it is turned on.

    Custom mouse display position and status
    Format: Hexadecimal code: 1B 37 X Y FF FF EE FF
    Explanation: 1B: is the command frame header, 37: is the command. X: Displays the coordinate value of the mouse in the X direction. It is a Word, with the low byte in front and the high byte in the back. Y: displays the Y coordinate value of the mouse. It is a Word, with the low byte in the front and the high byte in the back. FF FF EE FF is the end of the frame.
    Example: Customize to display the mouse at the coordinates (100, 100), send the command as follows: 1B 37 64 00 64 00 FF FF EE FF
    Note: Customizing the mouse display position is when the properties of the mouse are set to be visible. If the properties of the mouse are set to invisible, the mouse will still be invisible after customizing the mouse. Please refer to command 1B 30 for mouse attribute settings.

Anfrage senden