如何在客户显示器/杆上滚动文本

时间:2016-07-09 15:19:24

标签: display customer

我正在研究DSP800客户显示器或Pole,我成功地清除了显示器,将文本写入显示器的第一行或第二行;但我没有找到一种方法在显示屏上水平滚动文本,这是用户手册中的命令:

Command Code description(hex)   Function description
----------------------------------------------------
ESC E rψ    1B 45 rψ    Set special effect or display mode of specified row

(REMARK)*Using commands “ESC E rψ”, the value of parameter
r   58=all rows
55=upper row
44=lower row
ψ special function, the value is one of
    30= shift mode(default display mode)
    31=rotation mode
    32=blink mode
    33=clear this row and switch to shift mode
    34=overwrite mode
    35=vertical mode

问:有没有办法实现滚动或闪烁显示屏上的文字?谢谢。

1 个答案:

答案 0 :(得分:0)

    public void SetMode(int row, char mode)
    {
        var data = new byte[5];
        data[0] = 0x1B;
        data[1] = (byte)'E';
        if (row == 0)
        {
            data[2] = (byte)'X';
        }
        else if (row == 1)
        {
            data[2] = (byte)'U';
        }
        else if (row == 2)
        {
            data[2] = (byte)'D';
        }

        if (mode == 0x00 || mode == '0') mode = '0';
        else if (mode == 0x01 || mode == '1') mode = '1';
        else if (mode == 0x02 || mode == '2') mode = '2';
        else if (mode == 0x03 || mode == '3') mode = '3';
        else if (mode == 0x04 || mode == '4') mode = '4';

        data[3] = (byte)mode;
        data[4] = 0x00;
        WriteBytes(data);
    }

    public void WriteBytes(byte[] data)
    {
        _port.Write(data, 0, data.Length);
    }
相关问题