|
if control == 1 and value == 1 then --確認
K = get_value(screen,2) --鍵碼
if K > 0 and K<=40 then
local send_table1={}
send_table1[0] = 0x4C --STX
send_table1[2] = 0x52 --R(RS232)
send_table1[3] = K --鍵碼
status = get_value(screen,77)
N = get_value(screen,5) --BYTE數
if status == 0 and N > 0 then
send_table1[1] = 0x53 --儲存
P = get_value(screen,3) --輸出埠
B = get_value(screen,4) --包率
if B == 9600 then
B = 1
end
if B == 19200 then
B = 2
end
if B == 38400 then
B = 3
end
if B == 115200 then
B = 4
end
send_table1[4] = P --輸出埠
send_table1[5] = B --包率
send_table1[6] = N --BYTE數
local C = 0 --C設為0(計算輸出的BYTE數)
local I = 7 --I設為7(編碼儲存的第一個文本)
repeat
D = get_text(screen,I) --讀取文本的數值
S = tonumber(D,16) --設為十六進制
send_table1[I] = S
I = I+1
C = C+1
until(C == N) --循環輸出到設定的BYTE數
send_table1[N+7] = 0xC4 --ETX
uart_send_data(send_table1)
end
在電腦上執行正常,載入串口屏(DC80480M070)後,就只發送到send_table1[6],請問有方法解決嗎? |
|