謝謝各位,通過兩天努力我放棄了QD71C24N通信,為了感謝各位我把解決方案發(fā)給大家共享,現(xiàn)在我采用的是威倫屏的宏指令讀取數(shù)據,讀回的數(shù)據寫入PLC的D寄存器即可。
macro_command main()
short return_value
short date[9]
char comand[4] ,count[22]
comand[0] = 0x81
comand[1] = 0x04
comand[2] = 0x41
comand[3] = 0x44
OUTPORT(comand[0], "Free Protocol", 4)
INPORT(count[0], "Free Protocol",6, return_value)
SetData(count[0], "Local HMI", LW, 0, 1)
SetData(count[1], "Local HMI", LW, 1, 1)
SetData(count[2], "Local HMI", LW, 2, 1)
SetData(count[3], "Local HMI", LW, 3, 1)
SetData(count[4], "Local HMI", LW, 4, 1)
SetData(count[5], "Local HMI", LW, 5, 1)
SetData(count[6], "Local HMI", LW, 6, 1)
SetData(count[0], "MITSUBISHI Q02/02H", D, 0, 6)
end macro_command