请问! VF 与 MSCOMM32的有关问题
请教! VF 与 MSCOMM32的问题。
有个问题,请教各位:
有个单片机程序:

使用串口调试工具就没问题,现在改成VFP代码就调试不出来。
联机:
Thisform.Com.CommPort =3
Thisform.com.Settings ="4800,M,8,1"
Thisform.Com.InputMode = 1
Thisform.Com.PortOpen = .T.
数据发送:
DIMENSION aOutPut(7)
aOutput(1)=0x25
aOutput(2)=0x30
aOutput(3)=0x31
aOutput(4)=0x52
aOutput(5)=0x37
aOutput(6)=0x36
aOutput(7)=0x0D
Thisform.Com.OutPut = aOutPut
FOR nVar =1 TO 30
Thisform.Edit1.Value =Thisform.Edit1.Value + Thisform.Com.Input
ENDFOR
MESSAGEBOX(Thisform.Edit1.Value)
Thisform.Refresh
请报错了。
------解决方案--------------------
不用数组,就直接用字符串发过去试试:
Thisform.Com.OutPut = 0h2530315237360D
有个问题,请教各位:
有个单片机程序:
使用串口调试工具就没问题,现在改成VFP代码就调试不出来。
联机:
Thisform.Com.CommPort =3
Thisform.com.Settings ="4800,M,8,1"
Thisform.Com.InputMode = 1
Thisform.Com.PortOpen = .T.
数据发送:
DIMENSION aOutPut(7)
aOutput(1)=0x25
aOutput(2)=0x30
aOutput(3)=0x31
aOutput(4)=0x52
aOutput(5)=0x37
aOutput(6)=0x36
aOutput(7)=0x0D
Thisform.Com.OutPut = aOutPut
FOR nVar =1 TO 30
Thisform.Edit1.Value =Thisform.Edit1.Value + Thisform.Com.Input
ENDFOR
MESSAGEBOX(Thisform.Edit1.Value)
Thisform.Refresh
请报错了。
------解决方案--------------------
不用数组,就直接用字符串发过去试试:
Thisform.Com.OutPut = 0h2530315237360D